badi implementation for transaction cs01
DESCRIPTION
BADI Implementation for Transaction CS01TRANSCRIPT
![Page 1: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/1.jpg)
BADI implementation for transaction CS01
By Sakthivelan .T and Thrinath Kumar .K, Kaavian Systems
Aim: To create a BADI implementation for CS01 transaction, that does not allow user to create alternative BOMs for already created BOM.
Hint: If an alternative BOM is created the field STALT from MAST table will be increased by 1. We can control future creation of BOM using this field. Or if the particular material for which we are creating BOM has an entry in MAST then we should not allow to create again. So the Badi can be approached in two ways. But I use the former method in this example you try the latter method.
Step1:
Keep a break point in “CALL METHOD cl_exithandler=>get_class_name_by_interface” line inside the get_instance method of the class cl_exithandler in Class builder (SE24).
![Page 2: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/2.jpg)
Step2:
Now execute CS01 transaction, you will see the debugger that you set in SE24 transaction. Double click on the changing parameter “EXIT_NAME”. Press F8 sequentially and make a note of the exit names.
![Page 3: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/3.jpg)
Step3:
After you see CS01 just continue with the BOM creation and in mean time note all the Exit names that you come through in the debugger.
![Page 4: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/4.jpg)
Continue with BOM creation as follows.
![Page 5: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/5.jpg)
Step4:
Click on save to find final set of BADI’s.
The BADI’s triggered is as follows.
Before SCREEN1
BOM_IPPE
IPPE_DOCID
IPPE_ENG_CHECK_EXT
W_RETAIL_SYSTEM_IDENT
Before SCREEN2
ECM_BOM_DECO
ECM_DOC_DECO
ECM_IPPE_DECO
ECM_MAT_DECO
![Page 6: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/6.jpg)
ECM_055_DECO
ECM_060_DECO
ECM_061_DECO
ECM_062_DECO
ECM_ROUT_DECO
ECM_075_DECO
ECM_077_DECO
ECM_079_DECO
After clicking save:
BOM_UPDATE
BOM_EXIT
EHSS_SPEC_CHECKS
Step 5 :
Search for the “STALT” field inside any of the methods inside the BADI classes.
Shortcut : I know it’s the time killing process so I suggest you an easier way to find the specific class and method. Goto se19 in create implementation block under classic BADI enter the BADI names one by one and find out weather implementation can be created or not. After doing this you will have very less BADI’s now go to SE24 and add cl_ex_(BADI NAME) and check for methods that have the parameter STALT.
Step 6:
After finding the BADI and method in which you want to implement the code. Goto SE19 and create implementation for that particular BADI.
![Page 7: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/7.jpg)
![Page 8: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/8.jpg)
![Page 9: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/9.jpg)
Step 7:
Enter implementation short text
![Page 10: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/10.jpg)
Step 8 :
Click on interface tab.
Step 9 :
![Page 11: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/11.jpg)
Double click on the method in which you want to write code as decided. You will see the following.
Step 10 :
Write the following code in the method.
method IF_EX_BOM_UPDATE~CHANGE_AT_SAVE.
if I_STLAL > 1. message 'Alternative BOM cannot be created for this particaular material' type 'W'. endif.
LEAVE PROGRAM.
endmethod.
Step 11 :
Save and activate the code and come back.
Step 12 :
Activate the Implementation and go to CS01 and try to create BOM for second time.
![Page 12: BADI Implementation for Transaction CS01](https://reader036.vdocuments.net/reader036/viewer/2022081420/55cf92c5550346f57b996f53/html5/thumbnails/12.jpg)