04-07-2010 9:29 AM
Hi,
i written a piece of code in exit EXIT_SAPLEINM_002.
but the probleam is now in the idoc in one segment the e1edp16 the value is repeating and taking the second line item values.
could u let me know where is the probleam in my below code??
loop at DEKEK_X.
if DEKEK_X-stpin = 1.
delete DEKEK_X where stpin = 1.
delete xekpo where ebelp eq DEKEK_X-ebelp.
endif.
endloop.
loop at xekpo.
if DEKEK_X[] is initial.
delete xekpo.
endif.
endloop.
04-07-2010 9:40 AM
Try following corrections.
loop at DEKEK_X.
if DEKEK_X-stpin = 1.
delete DEKEK_X where stpin = 1. "Not required - already in if condition"
delete xekpo where ebelp eq DEKEK_X-ebelp.
endif.
endloop.
loop at xekpo.
if DEKEK_X[] is initial. " No conditions for deleting zekpo ?
" I think should read for value of ebelp and if not found the delete"
delete xekpo.
endif.
endloop.
Regards
Vinod
04-07-2010 9:39 AM
Hi,
Sequences is wrong 1st delete xekpo table then delete DEKEK_X table
like below mentioned
loop at DEKEK_X.
if DEKEK_X-stpin = 1.
delete xekpo where ebelp eq DEKEK_X-ebelp.
delete DEKEK_X where stpin = 1.
endif.
Salil
04-07-2010 9:40 AM
Try following corrections.
loop at DEKEK_X.
if DEKEK_X-stpin = 1.
delete DEKEK_X where stpin = 1. "Not required - already in if condition"
delete xekpo where ebelp eq DEKEK_X-ebelp.
endif.
endloop.
loop at xekpo.
if DEKEK_X[] is initial. " No conditions for deleting zekpo ?
" I think should read for value of ebelp and if not found the delete"
delete xekpo.
endif.
endloop.
Regards
Vinod
04-07-2010 10:18 AM
HI everybody,
i tried but unsucess.
please if any possibilities please help ...
04-07-2010 9:40 AM
Hi,
Chk the sample code written in the same Exit. Please change the Data in IDOC based on conditions..
TABLES e1edka1.
DATA: lv_lines TYPE sy-tabix.
FIELD-SYMBOLS: <fs_ekpo> TYPE uekpo.
IF dobject-kappl EQ 'EL'.
CASE int_edidd-segnam.
WHEN 'E1EDKA1'.
MOVE int_edidd-sdata TO e1edka1.
IF e1edka1-parvw EQ 'AG'.
READ TABLE xekpo ASSIGNING <fs_ekpo> INDEX 1.
e1edka1-partn = <fs_ekpo>-bukrs.
MOVE e1edka1 TO int_edidd-sdata.
DESCRIBE TABLE int_edidd LINES lv_lines.
MODIFY int_edidd INDEX lv_lines.
ENDIF.
ENDCASE.
ENDIF.
Regards,
Srinivas N