cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Trigger logic in MM_PUR_S4_PO_MODIFY_ITEM BAdI

KhaingZinTun
Participant
0 Likes
1,513

I would like to create auto increase number custom field in Manage Purchase Order app.

My current development steps are as following

1. I added a custom field to Purchase Order item screen using In-App Extensibility.

2. I created new custom BO to save current increase number.

3. Write logic in Modify Purchase Order Item (MM_PUR_S4_PO_MODIFY_ITEM ) BAdI.

The problem here is the number is always increasing everytime I enter to Manage Purchase Order screen without saving or with saving. 

And, the number keeps increasing even when I only enter to Purchase Order screen just for looking information.

So, I would like to ask that

 in Manage Purchase Order app, is there any BAdI that will be trigger only when Save button is clicked (like Before Save event) and also custom field can be used ?

(Or)

 Is there any condition that can be added in Modify Purchase Order Item (MM_PUR_S4_PO_MODIFY_ITEM ) BAdI to trigger only when Save button is clicked?

Accepted Solutions (0)

Answers (1)

Answers (1)

Zhehui_Xia28
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi,

The BAdI BD_MMPUR_FINAL_CHECK_PO is designed to perform checks before a purchase order is saved. This BAdI is suitable for your requirement as it is triggered only when the purchase order is about to be saved. This ensures that your auto-increment logic will only execute when the Save button is clicked.

Besides, you can set some conditions (compare whether some values of fields are changed) in BAdI MM_PUR_S4_PO_MODIFY_ITEM, so that the BAdI won't be triggered if nothing changes.

Best Regards,

Zhehui