‎2010 Jan 13 9:28 PM
Hi,
I must read data from produced idoc.
For example: I have idoc number and i know message type of idoc, i need to read data from inside that idoc.
How can i do that programatically?
Thanks.
Edited by: cml_bzl on Jan 13, 2010 10:28 PM
‎2010 Jan 13 9:39 PM
Hi,
Create a custom program having IDOC number parameter on the selection screen. Inside the program call the below mentioned function module which read the idoc data from database into internal table.
Read the IDoc detail from the database
CALL FUNCTION 'IDOC_READ_COMPLETELY'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = s_edidc
TABLES
int_edidd = itab_edidd
EXCEPTIONS
document_not_exist = 1
document_number_invalid = 2
OTHERS = 3.
Hope this helps.
Thanks!
‎2010 Jan 13 9:39 PM
Hi,
Create a custom program having IDOC number parameter on the selection screen. Inside the program call the below mentioned function module which read the idoc data from database into internal table.
Read the IDoc detail from the database
CALL FUNCTION 'IDOC_READ_COMPLETELY'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = s_edidc
TABLES
int_edidd = itab_edidd
EXCEPTIONS
document_not_exist = 1
document_number_invalid = 2
OTHERS = 3.
Hope this helps.
Thanks!
‎2010 Jan 14 8:26 AM
Thanks for your reply,
IDOC_READ_COMPLETELY function does not get data inside segments.
‎2010 Jan 14 8:52 AM
Hi,
EDIDD does have the data in string format in field SDATA You have to implement small coding after the FM call.
DATA: wa_e1edk01 TYPE eqedk01,
wa_segment2 TYPe segment2,
wa_segment3 TYPE segment3.
SORT ediddtab BY docnum.
LOOP AT ediddtab INTO wa.
CASE wa-segnam.
WHEN 'E1EDK01'.
MOVE wa-sdata TO wa_e1edk01.
WHEn..segment2
MOVE wa-sdata TO wa_segment2
WHEn...segment3
MOVE wa-sdata TO wa_segment3.
ENDCASE.
At END OF docnum.
*Here you have the data in respective work areas.*
ENDAT.
ENDLOOP.
Thanks,
Vinod.