‎2007 Apr 13 2:29 PM
Hi all,
I have a requirement like this
I have an IDOC say DOC1
DOC1 has a segment say SEG1
SEG1 has a child segment say CLD1
CLD1 has a filed say FLD1 .
i need to update the data in field FLD1.
can any one please tel me how to read data in the FLD1 and how can I update that.
‎2007 Apr 13 2:37 PM
Hi Vijay,
Please check this link for sample codes on how to update segment field.
http://www.erpgenie.com/sapedi/idoc_abap.htm#Updating%20IDoc%20data%20in%20segments
Regards,
Ferry Lianto
‎2007 Apr 13 3:33 PM
hi ferry,
Thanks for replying
The solution given in that path does not talk about nested child segment.
can u suggest me any other approch
‎2007 Apr 13 3:43 PM
Vijay,
You can try this example ...
describe table dedidd lines l_count.
loop at dedidd from v_index to l_count.
read table dedidd into st_dedidd index v_index.
if st_dedidd-segnam eq 'CLD1'.
st_dedidd-sdata+3(15) = 'Test'." Updated values
modify dedidd index sy-tabix from st_dedidd.
endif.
endloop.Hope this helps to move forward....
Message was edited by:
Ch@ndra
‎2007 Apr 13 3:44 PM
Hi Vijay,
Basically, it is used the same approach to update parent/child segment(s). You need to loop at internal table EDIDD and find the corresponding segment. Then you move to work area, do the modification and lastly update the internal table EDIDD with new value(s).
Please follow step 2 to read and update the child segment field.
DATA: wa_cld1 like CLD1.
LOOP AT itab_edidd WHERE segnam = 'CLD1'.
wa_cld1 = itab_edidd-sdata.
IF wa_cld1-field1 = <the condition>.
wa_cld1-field1 = <new value>.
itab_edidd-sdata = wa_cld1.
MODIFY itab_edidd.
EXIT.
ENDIF.
ENDLOOP.
Regards,
Ferry Lianto
‎2007 Apr 14 4:37 PM
Hi friends
thanks for giving me valuable suggestions.
I got the concept.
I m new to IDOC ....
it will be a great help if u can send me some study material on IDOC
my id is venkat_info@yahoo.com