2012 May 07 10:00 AM
Hi,
I am new to working with the SAP database, so my knowledge in this field is limited - please bear with me 🙂
I am working with BSAK / BKPF right now, and I need to find out which table / fields that are used to relate / get the attachment files tied to a document. Can anyone tell me how I will get the relations and which tables to look for to get this information ? To get the unique document id I need BUKRS, GJAHR, BELNR, but I can't seem to find any tables / fields where I can get the tied attachments to this?
Any help is appreciated, and thank you very much in advance! 🙂
2012 May 11 12:55 AM
Tables involved
BKPF
SRGBTBREL
SOOD
Join 1
BKPF – GJAHR + BKPF – AWKEY = SRGBTBREL – INSTID_A
Join 2
SRGBTBREL – INSTID_B = SOOD – OBJTP + SOOD – OBJYR + SOOD – OBJNO
Hope this helps.
Harsh
2012 May 07 2:24 PM
Dear Stephan,
SRGBTBREL is the table and the passing 'ATTA; in RELTYPE check the entries in the field INSTID_A.
Please refer to the bbelow link for more info:
http://scn.sap.com/thread/1892470
With regards,
2012 May 08 9:25 AM
Hi, and thank you very much for your reply!
However, your suggestion only gives me doc number and fiscal year - no Co code. Besides that I can not figure out how to relate this to the actual attachment, as SRGBTBREL does not hold any info about the file ? or maybe I am missing something.. There must be more tables required to interact with to get the files related to the document number ?
Thank you in advance!
2012 May 08 2:40 PM
Dear Stephan,
Goto BKPF get your company code, Document Number and Fiscal Year.
In table SRGBTBREL for field INSTID_A which is Instance ID pass your company code give a space pass your docno and fiscal year with no spaces and reltype should be ATTA .If entry exists then an attachment exists else no.
The field INSTID_A contains company code, Document Number and Fiscal Year.
Program RFBKPF00 contains the related methods for showing the attachment list. You can place the break-point in the related method and test the runtime values.
regards,
2012 May 09 12:45 PM
Hi,
Thanks once again for your reply. I will try to be more clear in my setup.. I forgot to mention from the start, that I am not working directly in SAP in this matter. I am using Auditing software called ACL. From there I have direct access to my SAP database (read-only). see below where I look into SRGBTBREL.
In SRGBTBREL i have this:
As you see, there is not enough information to have both, co code (4 cifre) doc no (10 cifre) and fiscal year (4 cifre) ?
My main goal is to locate attached files to a given document through the database only - this is to find the attached documents to potential duplicate payments and to show which ones does not have attached documents at all..
So, I have all tables available, I just can't find out how to locate the attached files only through the database, as I can't find any direct relation to the right cc code and document in a given period..
I hope you can help me, being maybe a little more specific on what I should do to get this information 🙂
2012 May 10 1:43 PM
2012 May 11 12:55 AM
Tables involved
BKPF
SRGBTBREL
SOOD
Join 1
BKPF – GJAHR + BKPF – AWKEY = SRGBTBREL – INSTID_A
Join 2
SRGBTBREL – INSTID_B = SOOD – OBJTP + SOOD – OBJYR + SOOD – OBJNO
Hope this helps.
Harsh
2012 May 11 1:33 PM
Thank you VERY much! that did half the trick!
Now I fetch documents where these kinds of attachments are present :
BUT. I don't get files attached as archived documents (these are also pdf's but apparently attached manually or something? ) :
Any idea how to get the reference to these documents also?
Thank you very much for your effort so far!