‎2006 Jan 11 12:00 PM
Hi,
I have an idoc number with me, is it possible to retrieve the data of that particular idoc.
I tried EDIDS, but it is just a structure, Please advise me how to extract the segment data of that particular idoc.
‎2006 Jan 11 12:12 PM
Hi Anandha,
all IDOCs I know store the data in table EDID4, some older IDOCs in EDIDD.
EDID4 has some administrative fields like IDOC No, segment type,.. and a data field called SDATA. To see the data you have to put the contents of sdata into a field of corresponding segment's structure.
Just a code snippet we used to examine IDOC headers for self-defined IDOCS:
FIELD-SYMBOLS:
<edid4> TYPE edid4,
<head> TYPE "our IDOC header segment type
..
get header segments
SELECT docnum sdata
INTO CORRESPONDING FIELDS OF TABLE lt_edid4
FROM edid4 FOR ALL ENTRIES IN lt_docnum
WHERE docnum = lt_docnum-table_line
AND counter = space
AND segnum = 1
AND segnam = c_segment_head.
..
Scan headers
LOOP AT lt_edid4 ASSIGNING <edid4>.
ASSIGN <edid4>-sdata TO <head> CASTING.
now we have all header fields as defined
...
ENDLOOP.
Hope it helps,
Clemens
‎2006 Jan 11 12:13 PM
Hi,
Check in EDIDD_OLD which is a cluster table, you may also check in EDID4 for the versions above 4.0,
Hope this helps,
Rgds,
‎2006 Jan 11 12:43 PM
Hi
you can see the IDoc data in WE02 provided if your IDoc is not archived yet.
Tharani
‎2006 Jan 11 12:44 PM
HI,
how to extract the sdata found in edids into particular segments.
Please advise
‎2006 Jan 11 12:50 PM
Define work areas for each segment. For example say if you have three segments:
ZA, ZB, ZC
Then all that you need to do is:
DATA:
w_za TYPE za,
w_zb TYPE zb,
w_zc TYPE zc
LOOP AT it_edidd.
IF it_edidd-segnam = 'ZA'.
w_za = it_edidd-sdata.
ELSEIF it_edidd-segnam = 'ZB'.
w_zb = it_edidd-sdata
......
.....
.....
ENDIF.
That's it...
Regards,
Srikanth
‎2006 Jan 11 1:07 PM
Use the FM <b>ALE_FTCH_DATA_SEGMENTS_OF_IDOC</b> and pass the IDOC number
‎2006 Jan 11 1:09 PM
REPORT XX.
TABLES EDIDD.
DATA: V_GAMNG LIKE AFKO-GAMNG,
V_IGMNG LIKE AFKO-IGMNG,
V_ARBPL LIKE AFRV-ARBPL,
V_RUECK LIKE AFVC-RUECK,
V_MAKTX LIKE MAKT-MAKTX.
DATA: I_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
CONSTANTS: C_X(1) VALUE 'X',
C_ZE1AFKOL_05 LIKE EDIDD-SEGNAM VALUE 'ZE1AFKOL_05',
REFRESH I_EDIDD.
SELECT SINGLE MAKTX FROM MAKT INTO V_MAKTX WHERE MATNR = 1 "F_AFKO-MATNR
AND SPRAS = SY-LANGU.
IF SY-SUBRC EQ 0.
SELECT SINGLE GAMNG
IGMNG
FROM AFKO
INTO (V_GAMNG, V_IGMNG)
WHERE AUFNR = 1."AUFNR = F_AFKO-AUFNR.
IF SY-SUBRC EQ 0.
S_ZE1AFKOL_05-MAKTX = V_MAKTX.
S_ZE1AFKOL_05-OPENQTY = V_GAMNG - V_IGMNG.
S_ZE1AFKOL_05-ZDBSTAT = C_X.
I_EDIDD-SEGNAM = C_ZE1AFKOL_05.
I_EDIDD-SDATA = S_ZE1AFKOL_05.
APPEND I_EDIDD.
ENDIF.
ENDIF.
‎2006 Jan 11 1:11 PM
Hi,
I think you can use function module <b>IDOC_READ_COMPLETELY</b>, just pass IDOC number to <b>DOCUMENT_NUMBER</b>.
Tables Parameter <b>INT_EDIDD</b> will have the Segments data.
Hope this helps..
Sri