Application Development and Automation 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: 
Read only

Attach Archived File to Archived FI Document (FB03)

0 Likes
3,491

Hi,

I am using the function BDS_BARCODE_CREATE to attach an archived PDF file to an FI document (FB03). It works fine for a "normal" FI document.
However, if the FI document itself is archived (cannot be found anymore in BKPF), it does not work. All the functions in call chain (BDS_BARCODE_CREATE -> ARCHIV_CONNECTION_INSERT) are successful (SY-SUBRC = 0), entry in table TOA02 is created, but the file does not appear in FB03 -> Services for Object -> Attachment List.

I wanted to test is it possible to attach something to an archived document at all. I tried manual file attachment in FB03 -> Services for Object -> Attachment List and it worked! So it should be possible to create a link for an existing archived PDF file.

Does anyone have experience?

Thanks!

KR,

Igor

1 ACCEPTED SOLUTION
Read only

0 Likes
2,692

Hi,

The solution to this problem was trivial in the end: a simple COMMIT WORK after the BDS_BARCODE_CREATE function did the trick.

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
2,692

BDS_BARCODE_CREATE is usually not proposed in the forum as a way to attach a file to a business object. I guess that the classic solutions (create attachment + relationship to business object) should work.

https://blogs.sap.com/2013/05/23/the-gos-generic-object-services-class-that-does-all-the-work/

https://blogs.sap.com/2012/01/22/automatically-upload-gos-attachments/

https://github.com/keremkoseoglu/ABAP-Library/blob/master/document/zcl_bc_gos_toolkit.abap

etc.

Read only

0 Likes
2,693

Hi,

The solution to this problem was trivial in the end: a simple COMMIT WORK after the BDS_BARCODE_CREATE function did the trick.