Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

logic required for enhancement

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

HI everybody,

i tried but unsucess.

please if any possibilities please help ...

Former Member
0 Kudos

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