Application Development and Automation 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: 
Read only

Populate Idoc segments

Former Member
0 Likes
1,117

I am modifying the ORDERS05 Idoc from an user exit EXIT_SAPLVEDC_003. I need to add the ABLAD field value to E1EDK01 segment.

The code below is not working. How can we add more values to the SDATA field?

DATA: wa_edidd LIKE edidd,

wa_e1edk01 LIKE e1edk01.

LOOP AT dint_edidd.

IF dint_edidd-segnam = 'E1EDK01'.

MOVE dint_edidd-sdata TO wa_e1edk01.

CLEAR wa_edidd.

MOVE dint_edidd TO wa_edidd.

wa_e1edk01-ablad = 'test'.

MOVE wa_e1edk01 TO wa_edidd-sdata.

APPEND wa_edidd TO dint_edidd.

ENDIF.

ENDLOOP.

4 REPLIES 4
Read only

former_member195698
Active Contributor
0 Likes
813

Instead of APPEND wa_edidd TO dint_edidd.

use

MODIFY dint_edidd from wa_edidd

Read only

former_member194669
Active Contributor
0 Likes
813

Hi,

Try this way


DATA: wa_edidd LIKE edidd,
wa_e1edk01 LIKE e1edk01.

LOOP AT dint_edidd.

IF dint_edidd-segnam = 'E1EDK01'.
MOVE dint_edidd-sdata TO wa_e1edk01.
CLEAR wa_edidd.
MOVE dint_edidd TO wa_edidd.
wa_e1edk01-ablad = 'test'.
MOVE wa_e1edk01 TO wa_edidd-sdata.
modify dint_edidd from wa_edidd. "<<<<<<<<<<<<<<<<<<<<
ENDIF.
ENDLOOP. 

a®

Read only

0 Likes
813

MODIFY statement is not the issue. Though

wa_e1edk01-ablad = 'test'

populates the segment, when

MOVE wa_e1edk01 TO wa_edidd-sdata

is excuted, the <b>edidd-sdata</b> value is the same. 'Test' needs to be appended to SDATA which is not happening. So ABLAD value remains blank.

Any thoughts?

Read only

0 Likes
813

Hi,

Please check whether you are incrementing the SEGNUM field to next available value while appending?

a®