Skip to Content
avatar image
Former Member

How to find archiv_id and archiv_doc_id ?

Hi All,

I have a FM ALINK_DOCUMENTS_GET_CLIENT to download an archived document to the SAP directory of user login.

My requirement is to download a PDF document of an invoice to my system. Using the above FM i can achieve this, but i need the input parameters (archiv_id, document_class, archiv_doc_id) to pass to this FM.I have only the invoice number with me.

I saw TOA01 table, but i dont have any input to pass to this table to get these parameters values.

so ,how can i get these parameter values?

Whenever an invoice is archived, in which table archiv_doc_id and archiv_id will get stored?

Thanks in advance,

Srilakshmi.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 21, 2008 at 11:37 AM

    Hi,

    If you are using output types to archive the invoice, then

    First you will have to get the Archivelink meta data from TOAOM. using the

    sap_object = 'VBRK' , this is in case of billing document

    AND ar_object = 'SDOINVOICE' this is in case of billing document

    ND ar_status = 'X'. " active

    The output is stored in the table NAST, there you will find the optical archive number when the document was stored. Now if you concatnate the objkey and the optical archive number, you will get the toa01-object_id ( note there are number of spaces between the objkey and the optical archive number, which you can get from an existing record.

    Now to fetch the data from toa01 you will have to use the conditions :

    sap_object = 'VBRK' if it is Billing document, check other values in the table TOAOM,

    object_id = concatenated nast-objky some spaces and nast-optarcnr

    archiv_id = toaom-archiv_id

    ar_object = 'SDINVOICE' , if it is billing document else you can check what this value is in your case.

    Once you get the details from TOAOM, NAST and TOA01 tables, you call the function ARCHIVOBJECT_GET_TABLE to get the data in a binary format.

    regards,

    Advait

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Just FYI.. It may not always be TOA01. It can be TOA02, TOA03 also. It depends on the configuration between document class and table.

      R