cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting Detail from an IDoc

Former Member
0 Kudos

Hi, I'm trying to extract more detailed information from an Idoc.  Currently I have to extract the data from the table using EDID4 and then manipulate the file to get the data required. 

I've also tried creating a SQVI to extract data, but this still does not allow me to extract data by article etc. 

Is there another way that I can extract data from an Idoc, or view details without having to extract the info via EDID4?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Once created the idoc, you can use the FM 'IDOC_READ_COMPLETELY' passing the idoc number

CALL FUNCTION 'IDOC_READ_COMPLETELY'

     EXPORTING

       DOCUMENT_NUMBER          = INPUT1

     IMPORTING

       IDOC_CONTROL             = IDOC_CONTROL

       NUMBER_OF_DATA_RECORDS   = NUMBER_OF_DATA_RECORDS

       NUMBER_OF_STATUS_RECORDS = NUMBER_OF_STATUS_RECORDS

     TABLES

       INT_EDIDS                = INT_EDIDS

       INT_EDIDD                = INT_EDIDD

     EXCEPTIONS

       DOCUMENT_NOT_EXIST       = 1

       DOCUMENT_NUMBER_INVALID  = 2

       OTHERS                   = 3.

   IF SY-SUBRC <> 0.

     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

After that !!

you can use a loop to see the idoc data and save it in each variable that you need to declare.

LOOP AT INT_EDIDD into lv_edidd.

IF lv_edidd-segnam = 'E1EDK01'.

    purchase_order_number = lv_edidd-sdata+83(35).

ENDIF.

ENDLOOP.

hope it helps.

Former Member
0 Kudos

Thanks Ivan. 

Former Member
0 Kudos

did this post help you ?
please mark it  as a correct answer.
Regards