Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find archiv_id and archiv_doc_id ?

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member

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

0 Kudos

Hi Advait,

Thanks for your immediate response.

i have the optical archive number for my invoice in NAST table, now i can concatenate the invoice number and optical archive number to query TOA01.

Thanks,

Srilakshmi.

0 Kudos

Yes, you can concatenate the invoice number and the optical archive number. But remember as I said there are spaces in between these 2 values. if it is a SD billing document, there are 20 spaces.

But that is not enough you would first need to get the details from w_toaom to get the archive id ( this is the content server id ). In that table you will also get the SAP ArchiveLink: Link table, which is mostly TOA01.

regards,

Advait

0 Kudos

Hi Advait,

Is there any other to find archiv_id and archiv_doc_id because i cannot use NAST table.

Thanks,

Srilakshmi.

0 Kudos

Hello Ram,

You could find it easy from billing document number by following below path.

Initially,  go to T0A01 table and enter billing number (that will start with *  and  end up *) in the OBJECT ID field. Then press execute. The system will give records as much as triggered output numbers. After that, by going to VF03 transaction, you could check outputs from menu bar. I have added screenshots for making sense much more easily.

Regards

Engin KARABOĞA

0 Kudos

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