Application Development and Automation 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: 
Read only

IDOC

Former Member
0 Likes
1,227

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.

8 REPLIES 8
Read only

Clemenss
Active Contributor
0 Likes
1,155

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

Read only

Former Member
0 Likes
1,155

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,

Read only

0 Likes
1,155

Hi

you can see the IDoc data in WE02 provided if your IDoc is not archived yet.

Tharani

Read only

Former Member
0 Likes
1,155

HI,

how to extract the sdata found in edids into particular segments.

Please advise

Read only

0 Likes
1,155

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

Read only

Former Member
0 Likes
1,155

Use the FM <b>ALE_FTCH_DATA_SEGMENTS_OF_IDOC</b> and pass the IDOC number

Read only

0 Likes
1,155

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.

Read only

Former Member
0 Likes
1,155

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