Skip to Content
avatar image
Former Member

Retrieve delivery from archived document attached in the attachment list of shipment


I have a requirement wherein, while saving a shipment with an output type (example ZD00), an attachment gets created and saved in the attachment list with the description "Shipment Delivery Note (ZD00)". On double clicking this attachment, we can navigate to Livelink Archive windows viewer. The output shown here will have the delivery num and material num. There can be multiple attachments in the attachment list and each attachment will have a archived document ID. My question is, how do we extract the delivery number linked to the selected attachment using the document ID?


Add comment
10|10000 characters needed characters exceeded

  • Former Member

    Hi All,

    Any help on this question please? Using the document ID linked to the attachment list, could we retrieve the data from the document?

  • Get RSS Feed

4 Answers

  • May 07, 2018 at 03:22 PM

    Frankly spoken you are currently trying to create an ABAP that can read a paper.

    Let us try to ignore your desired solution for a moment.

    Let us discover the business process first.

    How is this GOS attachment getting attached to your shipment? Is this done manually or automatically?

    What is this document ID and how is this related to a delivery?

    From where do you know the document ID, which you want to use to search for an attachment where you finally find a delivery number? What is here the real business process, the question that should be solved with your solution?

    Let me give you an example for such question: A user asks "how can I know which delivery numbers are contained in my shipment 4000101720?" or "Can you create a report that shows all delivery numbers from a shipment".

    A screenshot from GOS may also help.

    My GOS for an attachment looks like this and I attached it manually:

    If there are more than one attachment, how would a user in your case know in which attachment he has to look to find the desired delivery number?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      To answer your questions:

      How is this GOS attachment getting attached to your shipment? Is this done manually or automatically? Ans: Automatically while saving the shipment output.

      What is this document ID and how is this related to a delivery? Ans: Document ID is unique number linked to each attachment in the attachment list.

      Let me describe the relationship. For an output type (ZD00 in our case) and object key (= shipment num), NAST table will contain multiple entries having unique OPTARCH values. Passing the concatenated string of object key+OPTARCH value (which is a unique string) to the TOAOM table, will give the relationship table (TOA02 in our case) and the archiving ID. Passing the archiving ID and the necessary inputs to TOA02 table will give us the document number linked to the object key+OPTARCH string.This document number is linked to an attachment in the attachment list.

      On double clicking the attachment, it opens up a document which contains the delivery number in its output (816226811 in our case.see the attached).

      Hope the logic for fetching the document ID is clear. Now my question is how to retrieve the delivery number from this document using the document ID and the other inputs that I had mentioned in my previous post.attachment-list.pngoutput.png

      Please see if you can help me get this data.


      output.png (10.3 kB)
  • May 07, 2018 at 06:07 AM

    The output type is homemade, we do not really know what it exactly is and from which tables the information for this output type is fetched by the driver program, and also do not know what this Document ID is and why this document ID is the starting point to look for delivery numbers. We do not even know if the attachment in the archive is a PDF or some other data format.

    If you just want to see which deliveries are belonging to a shipment then the document flow table would be a good source of information.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Each attachment in the attachment list GOS, is linked to a unique document ID. When we double click an attachment, a PDF is shown, which displays the delivery note within it. So I tried to debug this functionality to check how the delivery number is populated in the PDF, in this process, I noticed that the "System-call plugin" statement is called. When the control hits this statement, the PDF is straightaway displayed. Since the system-call happens at the Kernel level and cannot be debugged, I was unable to find out how the delivery number is being populated on the PDF output. Hence does anybody have an idea of how to retrieve the delivery number using the document ID? Is there any FM to achieve this functionality.

      The inputs I have with me are:

      Arch. Doc. ID;

      Archive ID;

      Document class;

      SAP object type;

      Object ID;

      Document type.

      I found FMs with ALINK_* but was unable to find which of these FMs can retrieve data for a particular Arch. Doc. ID.

      Any help on this will be highly appreciated.

  • May 07, 2018 at 07:34 PM

    I'm still quite confused by the whole story but I feel by pursuing some "document ID" and debugging Archivelink you're just getting too deep into the woods. There is no way you can get into a PDF (binary content) stored as a generic object and make sense of it.

    The best you could do is put whatever information is needed in the object properties somewhere (e.g. description or file name). This needs to be done by whatever process creates the GOS attachment. After the fact, I'm afraid it's just not feasible, sorry.

    Add comment
    10|10000 characters needed characters exceeded

  • May 10, 2018 at 09:06 AM

    In my words: you are just storing a copy of an output message as GOS attachment

    If such message has the needed information, then this information is as well available in SAP standard tables, otherwise the value could not have been moved to the form.

    So it should be much easier to fetch this value from the table, like it is done when the message is created originally - ask the ABAPer who created the form and its driver program - than trying to read from a GOS attachment (which is from my point of view not possible at all)

    isn't the information not already contained in the document flow: , which would be table VBFA

    Add comment
    10|10000 characters needed characters exceeded