02-07-2008 2:16 AM
Hello Experts,
Is there an available FM to read the data in the segments of a given IDOC?
Because I need to get the delivery number and other details like line item, etc.
Also, I need to get the meaning of the IDOC status numbers. For example, if the status
is '3',then it was successfully sent. Are there any available FMs for this?
Hope you can help me guys. Thank you and take care!
02-07-2008 3:16 AM
Hi,
The best way to get the data is to use FM EDI_SEGMENTS_GET_ALL (u have 2 use EDI_DOCUMENT_OPEN_FOR_READ b4 and EDI_DOCUMENT_CLOSE_READ after) by the idoc number. The data is returned in the table IDOC_CONTAINERS which is also by the same logic as in db table EDID4: the data is concatenated in field SDATA, by the structure that is written in field SEGNAM (in your data declaration create a structure of the type of what's written in SEGNAM and then move SDATA to it).
Don't forget to reward if useful...
02-07-2008 2:28 AM
Try with fm READ_IDOC_COMPLETELY and finding out table behind stats in WE02 press f1 in stats you can table
a®
02-07-2008 3:16 AM
Hi,
The best way to get the data is to use FM EDI_SEGMENTS_GET_ALL (u have 2 use EDI_DOCUMENT_OPEN_FOR_READ b4 and EDI_DOCUMENT_CLOSE_READ after) by the idoc number. The data is returned in the table IDOC_CONTAINERS which is also by the same logic as in db table EDID4: the data is concatenated in field SDATA, by the structure that is written in field SEGNAM (in your data declaration create a structure of the type of what's written in SEGNAM and then move SDATA to it).
Don't forget to reward if useful...
02-07-2008 3:27 AM
Hi Again Guys,
Thank you for your helpful replies. However, is there a table that shows a 'flag' for a given IDOC status. for example, if the status is '02', then is shows an 'X' or an red light. If it has a status of '03', then it has a 'check' or a 'green light'. I do now want to use FM IDOC_GET_MESSAGE_ATTRIBUTE since it only shows text. Thanks again and take care!
02-07-2008 4:31 AM
Hi,
1. Is there an available FM to read the data in the segments of a given IDOC?
Because I need to get the delivery number and other details like line item, etc.
you can as well code the logic for it. Kindly refer to code snippet below:
Logic to capture the URL from idoc
Check if the segment name is 'E1EDKT1', if yes proceed further to
check the text identifier of the segment
IF ls_data-segnam EQ c_mainseg_nam_url.
CLEAR: ls_mainseg_data_url.
Get the text identifier
ls_mainseg_data_url = ls_data-sdata.
Check if Text identifier is 'F27', if yes set a flag to identify
that the main segment is triggered
IF ls_mainseg_data_url-tdid EQ c_main_seg_txid_f27.
CLEAR: f_main_seg_f27.
f_main_seg_f27 = c_true.
ENDIF.
ENDIF.
Check if the segment name is 'E1EDKT2' and the respective flag is set
if yes, Capture the URL
IF ls_data-segnam EQ c_childseg_nam_url.
IF f_main_seg_f27 EQ c_true.
CLEAR: ls_childseg_data_url.
REFRESH: lt_url[].
Get URL from the segment, URL will be present in 'TDLINE' field
ls_childseg_data_url = ls_data-sdata.
APPEND ls_childseg_data_url-tdline TO lt_url.
CLEAR: f_main_seg_f27.
ELSE.
CLEAR: ls_childseg_data_url.
ls_childseg_data_url = ls_data-sdata.
APPEND ls_childseg_data_url-tdline TO lt_url.
ENDIF.
ENDIF.
ENDLOOP.
2. Also, I need to get the meaning of the IDOC status numbers. For example, if the status
is '3',then it was successfully sent. Are there any available FMs for this?
Transaction WE47 maintains a list of all the status codes with its description
Regards,
Farheen.
Edited by: Farheen Fatima on Feb 7, 2008 5:32 AM