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: 

Problem GOS read_links of "follow-on" BKPF document

Tomas_Buryanek
Active Contributor
0 Kudos
2,768

Hello,

I have problem reading GOS links ( with CL_BINARY_RELATION=>read_links or any similar methods/FMs ) of FI document (type BKPF).

In SRGBTBREL table there are also no entries for this BKPF document  (in INSTID_A).

BUT I can see attachments + notes in FB03 Attachment list for this document.

After debbuging FB03 Attachment list I have found, that BKPF document does not have directly attached files, even though I can see them in FB03. Because it is "follow-on document" for invoice (which have some attached files), and there is also WF and PO in relationship browser (they have also another attachments, seen in FB03).

FB03 GOS attachment list prepares all these objects (document,invoice,WF,PO..) and reads attachments for all of them.

My question - how to read these links / attachments when I know only BKPF document in my program? Do I have to somehow programaticaly search for previous objects (invoice, PO, WF..) and after it read their attachments? I Thought that it is done automaticaly by CL_BINARY_RELATION=>read_links)...

Problem is on 731 release.

-- Tomas --
1 ACCEPTED SOLUTION

Tomas_Buryanek
Active Contributor
0 Kudos
794

Ok, I answer to myself with what I found so far:

In FB03 attachments are obtained from bussines objects:    

  • BKPF (document itself) - can be read by read_links, but in my case I have none attachmens on BKPF directly
  • BUS2081 (invoice) - can be read by read_links, but need use BKPF-AWKEY = RBKP-BELNR & GJAHR as key

I also found unreleased function FB_DOC_GET_GOS_LINKS which helped me a lot to understand where attachments come from.

In my case it was all from BUS2081 invoice. Few attachments directly attached in GOS (read by read_links method) and rest were attached on content server (can be read for example with ALINK_RFC_DOCUMENTS_GET).

-- Tomas --
10 REPLIES 10

Former Member
0 Kudos
794

Hi,

i have done it in FB03 and find an entry in SRGBRREL with RELTYPE = 'ATTA'

and TYPEID_A = 'BKPF'.

try it in your Testsystem and have a look in the table.

Regards, Dieter

0 Kudos
794

Hi, as I wrote, SRGBRREL is empty for my test document (BKPF) but in FB03 I can see attachments.

-- Tomas --

0 Kudos
794

Hi,

perhaps you have an older SAP-Release, try table: SRRELROLES.

Regards, Dieter

0 Kudos
794

Release 731, and found nothing in SRRELROLES for FB03 document.

-- Tomas --

Former Member
0 Kudos
794

Hi,

i tried the method like this:

And it works.

Regards, Dieter

0 Kudos
794

Thanks, but I guess you have file/s attached to BKPF object (you created attachment/s in FB03?) ? I don't.

-- Tomas --

0 Kudos
794

Hi,

yes i created via FB03.

0 Kudos
794

When I open FB03 document I can see attachments, but they are not created via FB03. And I need read them in program, thats my problem.

-- Tomas --

Tomas_Buryanek
Active Contributor
0 Kudos
795

Ok, I answer to myself with what I found so far:

In FB03 attachments are obtained from bussines objects:    

  • BKPF (document itself) - can be read by read_links, but in my case I have none attachmens on BKPF directly
  • BUS2081 (invoice) - can be read by read_links, but need use BKPF-AWKEY = RBKP-BELNR & GJAHR as key

I also found unreleased function FB_DOC_GET_GOS_LINKS which helped me a lot to understand where attachments come from.

In my case it was all from BUS2081 invoice. Few attachments directly attached in GOS (read by read_links method) and rest were attached on content server (can be read for example with ALINK_RFC_DOCUMENTS_GET).

-- Tomas --

former_member189849
Contributor
0 Kudos
794

Hi Tomas,

I have a requirement is like, I want to download the all attachments are in FB01/FB02 transaction ans attache into on Invoice PDF output, So can you hep on this,

Note: Invoice PDF is available but download the all attachments from FB01/FB02 is need.

Thanks,

Mahesh