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: 

data not populating in my idoc

Former Member
0 Kudos

Hi guru,

i am writting these below code .

please look my code.here date i am moving from : move W_datum1 to int_edidd-sdata.

so in debugging mode i am getting date value in int_edidd-sdata.

but why the value is not populating in my segment of idoc.can u tell me where is the probleam in my code???

If XVBDKR-VKORG = 'EDM1'

*CONTROL_RECORD_OUT-STDMES = 'INVOIC'

AND DOBJECT-KSCHL = 'ZEDI'.

if INT_EDIDD-SEGNAM = 'E1EDK02'.

LOOP AT INT_EDIDD WHERE SEGNAM = 'E1EDK02'.

E1EDK02 = INT_EDIDD-SDATA.

IF E1EDK02-QUALF = '009'.

W_datum2 = E1EDK02-datum.

ELSEIF E1EDK02-QUALF = '012'.

W_datum1 = E1EDK02-datum.

ENDIF.

ENDLOOP.

endif.

IF W_datum1 GT W_datum2.

W_datum1 = W_datum2.

move W_datum1 to int_edidd-sdata.

MODIFY int_edidd INDEX hilfe_tabix.

EXIT.

ENDIF.

ENDIF.

1 ACCEPTED SOLUTION

former_member195698
Active Contributor
0 Kudos

W_datum1 = W_datum2.

move W_datum1 to int_edidd-sdata.

MODIFY int_edidd INDEX hilfe_tabix.

instead of the statement marked in RED above, you should use a work area of type E1EDK02.

First get the existing value in the Segment by using

move int_edidd-sdata to WA_E1EDK02.... "this will be in the start where you are retrieving the current segment value

and when updating the time you should use ..

WA_E1EDK02-DATUM = W_datum1.

move WA_E1EDK02 to int_edidd-sdata.

MODIFY int_edidd INDEX hilfe_tabix.

8 REPLIES 8

former_member195698
Active Contributor
0 Kudos

W_datum1 = W_datum2.

move W_datum1 to int_edidd-sdata.

MODIFY int_edidd INDEX hilfe_tabix.

instead of the statement marked in RED above, you should use a work area of type E1EDK02.

First get the existing value in the Segment by using

move int_edidd-sdata to WA_E1EDK02.... "this will be in the start where you are retrieving the current segment value

and when updating the time you should use ..

WA_E1EDK02-DATUM = W_datum1.

move WA_E1EDK02 to int_edidd-sdata.

MODIFY int_edidd INDEX hilfe_tabix.

0 Kudos

hi,

i am tring a lot but date value is not populating in my idoc segment.

in debugging mode perfectly date value is coming in int_edidd-sdata.

why not coming in my final segment>>

what u told i also tried..but unsucess...

please help me ...

awaiting for ur reply....

0 Kudos

Send the Complete Code. We will try to solve the issue.

have you tried the option that i have suggested?

Regards,

Aj

0 Kudos

Hi,

Can you please write your current code used to populate the field ?

KR Jaideep,

0 Kudos

hi,

my current code is below...

please help

If XVBDKR-VKORG = 'EDM1' and

CONTROL_RECORD_OUT-MESTYP = 'INVOIC'

AND DOBJECT-KSCHL = 'ZEDI'.

if INT_EDIDD-SEGNAM = 'E1EDK02'.

MOVE int_edidd-sdata TO e1edk02.

loop at INT_EDIDD where SEGNAM = 'E1EDK02'.

E1EDK02 = INT_EDIDD-SDATA.

IF E1EDK02-QUALF = '009'.

W_datum2 = E1EDK02-datum.

ELSEIF E1EDK02-QUALF = '012'.

W_datum1 = E1EDK02-datum.

ENDIF.

ENDLOOP.

endif.

IF W_datum1 GT W_datum2.

W_datum1 = W_datum2.

W_E1EDK02-DATUM = W_datum1.

int_edidd-segnam = 'E1EDK02'.

move W_E1EDK02-datum to int_edidd-sdata.

APPEND int_edidd.

  • MODIFY int_edidd INDEX hilfe_tabix

  • lv_flag = 'X'.

CLEAR: W_datum1,W_datum2.

EXIT.

ENDIF.

ENDIF.

0 Kudos

Hi,

Looking at your code it seems like your values are overwritten. Check in debugging after all the segments get populated whether E1EDK01 have the desired values. Also, why are you appending the segment? Do you need another segment with new Qualifier IF yes then you must assign the qualifier as well before passing E1EDK01 to sdata else you must modify the segment.

int_edidd-segnam = 'E1EDK02'.

move W_E1EDK02-datum to int_edidd-sdata.

APPEND int_edidd.

KR Jaideep,

0 Kudos

Hi,

One more correction instead of moving datum please move w_e1edk02 INTO int_edidd-sdata.

int_edidd-segnam = 'E1EDK02'.

move W_E1EDK02-datum to int_edidd-sdata.
replace it with move W_E1EDK02 to INT_EDIDD-SDATA.
APPEND int_edidd.

former_member181995
Active Contributor
0 Kudos

Are you modifying the data or Any custom extensions needs to be appended in Standard IDOC?

If Modify is your case then you might go with AJ;s solution or if you are want to populate custom extension then you might see the below code snippet:

IF  int_edidd-segnam = 'E1EDPA1'.
*  BREAK-POINT.
  MOVE int_edidd-sdata TO e1edpa1.
  CHECK e1edpa1-parvw = 'WE'.

  SELECT SINGLE * FROM kna1 WHERE kunnr = e1edpa1-partn.
  MOVE: kna1-bahne TO zloc-bahne,
        kna1-locco TO zloc-locco.

  MOVE 'ZLOC' TO int_edidd-segnam.    " administrative section

  MOVE zloc TO int_edidd-sdata.       " data section

  APPEND int_edidd.

ENDIF.

P.s post your query in relevant forums.