when the PO is on changed in the header level only(for example header texts and header code) and when we execute RSNAST00 one BADI getts triggered which checks if the Item category is 9 and badi will clear the IDOC creation.
If the PO item category is = 9, the IDOC must not be created. This badi works fine if the changes are made at
1)at Item level
2)both header level and Item level
3)BADI is not working when the changes are made at the header level only. The IDOC is getting created even though the PO has the item category as 9.
I found in this case only header segments are availble while debugging and the item segments are not there to check the condition for the item category.
Please any one can suggest me possible solutions to clear idoc creation when only header level changes are made ME22N.
The BADI used is as below.
DATA : lwa_data TYPE edidd.
DATA : lw_dp01 TYPE e1edp01.
DATA : lwa_control TYPE edidc.
CHECK idoc_control-rcvprn = '3PL' AND idoc_control-idoctp = 'ORDERS05'.
LOOP AT idoc_data INTO lwa_data.
IF lwa_data-segnam = 'E1EDP01'.
lw_dp01 = lwa_data-sdata.
IF lw_dp01-pstyp = '9'.
Thanks in advance.