Skip to Content
0

BADI is not triggering MDG_BS_MAT_API_ENRICH_BADI in change mode

Aug 22, 2017 at 07:33 AM

150

avatar image

Hi Experts,

This BADI is called from the class CL_MDG_BS_MAT_API of method SAVE in case of Material creation(for WF-BATCH user) but not in case of Material Change we want this MDG_BS_MAT_API_ENRICH_BADI BADI in Material changes for plant extension.

Kindly give your suggestion for this issue.

Regards

Mohammed Sajid

10 |10000 characters needed characters left characters exceeded

any update on this

0
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Ingo Bruß
Aug 27, 2017 at 09:43 PM
0

Hi, the BAdI should be called for create as well as update.

You can debug this via break-point in class CL_MDG_BS_MAT_API => SAVE by setting a break-point at the call of enrich_custom_segments

If this doesn't work, might be reason for a ticket.

Regards, Ingo Bruß

Share
10 |10000 characters needed characters left characters exceeded
Mohammed sajid Aug 28, 2017 at 12:34 PM
0

Hi Ingo Bruss,

Thanks for your response I tried to debug this method CL_MDG_BS_MAT_API => SAVE this method is called When we activate the material during creation of material MAT01 and the importing parameter IV_TEST_MODE = abap_false for the WF-BATCH user and that's why the BADI is called

IF iv_test_mode IS INITIAL.

TRY.

GET BADI lo_enrich_badi.

CALL BADI lo_enrich_badi->enrich

IMPORTING et_message = lt_message

CHANGING cs_data = ls_data.

APPEND LINES OF lt_message TO et_message.

CATCH cx_badi_not_implemented . "There is not BADI Implementation CATCH cx_root.

ENDTRY.

ENDIF.

But in case of material change MAT02 this method is not called for WF-BATCH user . But for the final approval user when we activate the material this method parameter fills with IV_TEST_MODE = abap_true .

kindly help on this issue.

Regards

Sajid

Share
10 |10000 characters needed characters left characters exceeded
Pavan Bhamidipati Aug 29, 2017 at 07:14 AM
0

Hi,

I am not sure what you want to achieve, but the point is very simple in either CREATE or CHANGE badi will be called only before activating the CR. If my understanding is correct the BADi is called only before the CR final approval processes is done. In case of change there can be possibility that you just try to create and save it as a draft version. I would recommend to check if the BADI is getting called if the existing material is changed by using MAT02 CR type and save but do not submit or finalize process. IN this case I guess it should trigger the BADI>

One more point which I would like to know is how and why are you creating the break points on the user WF-BATCH. Usually WF-BATCH user is a non dialog user and this makes the user of not having the rights to execute in debug mode. Please check with your basis team about this

Thanks,Pavan

Share
10 |10000 characters needed characters left characters exceeded
Loga Nathan Duraisamy Aug 29, 2017 at 02:46 PM
0

Hi,

when user clicks activate button in the final approavl process, System will check by creating material in test mode i.e iv_test_mode = abap_true. If there is any error then user is stopped with the error in the UI. In case everything is fine, system will call save method in iv_test_mode = abap_false for final save. It is the normal process for create ,change or delete material. If save method is not called in change material better to raise a tciket. also make sure that filter name of the BADI is correctly mentioned ,check the same in the debugging mode..

CALL BADI lo_enrich_badi->enrich

Thanks and regatds,

Logan.D

Share
10 |10000 characters needed characters left characters exceeded