Badi ME_PROCESS_PO_CUST is used for standard user exits for transaction ME21N,ME22n and ME23n
I am using the method PROCESS_ITEM to check a condtion on an item level and then update a fieald in the condtion (KWERT) and then i want to update the condtion.
This is the code in method process_item :
data: ls_mepoitem type mepoitem
,ls_condition TYPE komv
,lt_conditions type MMPUR_TKOMV.
ls_mepoitem = im_item->get_data( ).
im_item->get_conditions( IMPORTING EX_CONDITIONS = lt_conditions ).
LOOP AT lt_conditions INTO ls_condition WHERE kschl = 'PB00'.
ls_condition-kwert = '88.8'
MODIFY lt_conditions FROM ls_condition.
im_item->set_conditions( lt_conditions ).
The code compiles and can be executed, but the result is that the standard SAP framework starts in an endless loop and exits after severals loops.
If I remove the im_item->set_conditions statement, then there is no endless loop, so the fault is in the set_conditions method. (Which is a standard method). I also get this error message from the system and there it seems that it is just impossible to update the KWERT field.
Can anyone confirm to me that this is the case or can anyone help me to make this work ( change the KWERT field in conditions when the PO is processing the items). ?
Here is the error messages from the system.
Data from Business Add-In ME_PROCESS_PO_CUST not adopted
Message no. MEPO151
An endless loop occurred during the processing of the Business Add-In ME_PROCESS_PO_CUST. The system terminated the processing.
Contact your system administrator.
Procedure for System Administration
Check whether standard fields are changed in the implementation of the Business Add-In ME_PROCESS_PO_CUST.
Changes to standard fields that are part of the Include structure MEPOITEM_TECH and/or MEPOSCHEDULE_TECH are generally not allowed. In addition, no field values that are not changeable through the field settings in the Enjoy transactions can be changed in the BAdI. Correct the implementation accordingly.