Skip to Content
0
Former Member
Nov 19, 2009 at 02:32 PM

Clear IDOC creation when only header level changes are made ME22N.

48 Views

Hi All,

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

In case of 1 and 2 we have both header segment E1EDK01 and item segments E1EDP01.As a result it checks for the item category in the item segment.so idoc is not created.

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'.

CLEAR create_idoc.

ENDIF.

ENDIF.

ENDLOOP.

ENDMETHO

Thanks in advance.