Skip to Content
avatar image
Former Member

Need info on building object key for BAPI_DOCUMENT_GETOBJECTDOCS

I have an MII transaction that uses BAPI_DOCUMENT_GETOBJECTDOCS to retrieve documents attached to a production order. 

I set the object type to PORDER and am putting the string "000012345678H0001          000000000001" (where 12345678 is my PO) as the object key. 

I have been creating the string by simply appending the "H0001          000000000001" at the end of my PO.

This works most of the time.  However, I have a PO where the document originally got into the PO from the bill of material, instead of linked to the material master like most of my PO's.

In debugging the problem I used BAPI_DOCUMENT_GETDETAIL2 to find that the actual object key should have ended in "H0001          000000000000".  (a zero instead of a 1 in the last character)

But I'm in a chicken/egg problem because my transaction can't use BAPI_DOCUMENT_GETDETAIL2 because I only have a production order.

I understand that the string is built up from several fields, but have not found anything that details how to build it up. 

Hopefully one of you can point me to some details on how to build this string.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 17, 2012 at 02:08 PM

    I'm giving this a bump to see if I get any replies.

    I've currently wrapped a for loop from 0 to 1 and search twice, once with a 0, and again with a 1. 

    Not a very elegant solution.

    Add comment
    10|10000 characters needed characters exceeded