When I searched on the forum on how to get the SAP document numbers from IDOC relationship I could not able to find direct straight forward document mentioning how to go about and which tables to follow.


This is quiet general document. And no such document is available on the portal. Since in Retail, IDOCs are extensively used it is more related to SAP Retail.

Below document will give exact information about the issue with detailed steps , table names and field names.


Find the document from the IDOC number.

Eg. Finding the material / article document from IDOC number.

This is done using IDOC relationship tables SRRELROLES (Object Relationship Service: Roles) and IDOCREL (Links between IDoc and application object)

First go to table SRRELROLES.

/wp-content/uploads/2014/08/1_524618.jpg

Enter the field OBJKEY (Key) as IDOC number. Note that it is 16 digit fields so please enter preceding zeros if required.

/wp-content/uploads/2014/08/2_524619.jpg

Take the field ROLETYPE (Role type) from the table SRRELROLES and go to table IDOCREL.

In IDOCREL enter ROLE_A (Role GUID) = SRRELROLES – ROLETYPE

/wp-content/uploads/2014/08/3_524620.jpg

From the ROLE_A field you will get certain entries for ROLE_B in the table IDOCREL.

Also you will get Rel. Type (Binary rel. type BRELTYP). Note that IDC1 Rel. Type is used for inbound IDOC and IDC4 is used for outbound IDOC number reference.

/wp-content/uploads/2014/08/4_524621.jpg

From here take the ROLE_B for type IDC1 for inbound IDOC and again go to table SRRELROLES

Enter IDOCREL- ROLE_B = SRRELROLES – ROLEID.

If its material document then enter SRRELROLES –OBJTYPE = BUS2017.

/wp-content/uploads/2014/08/5_524622.jpg

Now in the table SRRELROLES – OBJKEY (Key) you can get the material document number with last four digits as year.

/wp-content/uploads/2014/08/6_524702.jpg

Finding outbound IDOC numbers from the delivery order.

Go to table SRRELROLES and enter delivery number in SRRELROLES – OBJKEY. Enter Object type as LIKP.

/wp-content/uploads/2014/08/7_524624.jpg

Take ROLEID (GUID of a role) from SRRELROLES for role type OUTBELEG and go to table IDOCREL.

/wp-content/uploads/2014/08/8_524626.jpg

Role type INBELEG refers to inbound and OUTBELEG refers to outbound.

Enter SRRELROLES – ROLEID = IDOCREL- ROLE_A and fetch the value for IDOCREL – ROLE_B

You will get as many entries as number of outbound IDOCs available for the said delivery.

/wp-content/uploads/2014/08/9_524627.jpg

Now again to table SERRELROLES.

SERRELROLES – ROLEID = IDOCREL – ROLE_B

/wp-content/uploads/2014/08/10_524628.jpg

Execute the selection and you will get IDOC numbers in the field SRRELROLES – OBJKEY.

/wp-content/uploads/2014/08/11_524703.jpg

Likewise you can find out various documents created from IDOC number and which are available in the relationship tab of the IDOC and vice versa.

/wp-content/uploads/2014/08/12_524630.jpg

Hope this document will be help full. I am also attaching the same document in word format.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply