Tool for GOS attachment from one SAP system to another SAP system

Tool for GOS attachment from one SAP system to another SAP system


Your Organization (say COY, which is in SAP) acquired another company (say XYZ, which is also in SAP). As per design, business plan to load all data and process from XYZ to COY. So, they need to put the attachments from XYZ business objects to corresponding business objects in COY system.


This simple tool would upload any attachments (pdf, txt, xls, xml etc) from source sap system to target sap system for all business object types.

Step 1
Prepare file with Target Objects (PO/PR/Vendor/Materials/Contracts etc) and corresponding Source Objects. Make sure to have corresponding leading zeroes for all the objects. Example PR would have total 10 characters; materials would have total 18 characters, vendor would have total 10 characters with leading zeroes etc.

Below is an example file (xls) of Purchase Req from COY and XYZ system.


Step 2
Execute program Z_GOS_PREPARE_FILE in target system.


Step 3
Execute program Z_GOS_ATTACHMENT in target system.



Common Business Objects

Pur Req  = BUS2105      Material = BUS1001 or BUS1001006
Pur Ord  = BUS2012      Vendor  = LFA1   Contract = BUS2014  etc

Step 4
Validation for our example:

Go to ME53N for Purchase Requisition in source System


Go to ME53N for Purchase Requisition in target System


ABAPer would be more interested in the code to achieve the above functionalities. 🙂
Please find the working code attached in four files. Please click the link on the right.

1) Program to prepare the input file.     z_gos_prepare_file
2) Main program for attachments.          z_gos_attachment

Function Modules:

1) RFC FM in source (XYZ) system.    z_get_xyz_gos_attachment_rfc
2) RFC FM in target (COY) system.    z_gos_attach_to_coy_rfc

Please note: in the Main program (in PERFORM get_rfc_name), you need to put the RFC name of your system in Development, Quality and Production system respectively.

If you have any query or issue, please leave your questions at the comment section or email at mailsapyard[at]gmail[dot]com.

You might like to check our other post in GOS Attachement Program, GOS Table and class CL_FITV_GOS.

Image source :



Please enter your comment!
Please enter your name here