cancel
Showing results for 
Search instead for 
Did you mean: 

add additional PDF documents to ME21N .... Programatically. Not manually in Tcode

sapsunil498
Explorer

Hi Every One,

I am creating PO using BAPI - BAPI_PO_CREATE1 in back ground job. Once, PO created successfully, I need pick additional PDF documents from application server and add them to Purchase Order Services for Objects ( GOS) through program only. Please note, I need to add through ABAP program only and which should reflect in ME22N and ME23N in GOS menu.

I can able to read PDF files from application server. Please guide how to add them to GOS.

Is there any BAPI, BADI or any FM .

Searched in SCN and didn't find relevant threat .

Accepted Solutions (1)

Accepted Solutions (1)

raymond_giuseppi
Active Contributor

"Searched in SCN and didn't find relevant threat ." Perform (again) some search with keywords such as:

  • SO_FOLDER_ROOT_ID_GET and SO_DOCUMENT_INSERT (create uploaded document)
  • cl_binary_relation=>create_link (attach it to object with GOS)


Answers (2)

Answers (2)

maheshpalavalli
Active Contributor

Hi Sunil,

There are many blogs available which explains on how to add an attachment to a GOS object.

I am pasting one blog below, which is done using webdynpro, but the the classes you have to use are the same in your ABAP code.

https://blogs.sap.com/2014/03/10/attach-files-to-gos-with-save-retrieve-delete-functionality-in-sap-...

another blog which explains using abap and attaching document to PR

https://abapblog.com/articles/tricks/71-gos-how-to-add-business-documents-at-creation-of-object

But for your purchase order the BO is BUS2012.


Best Regards,
Mahesh

sapsunil498
Explorer
0 Kudos

Thank you

sapsunil498
Explorer
0 Kudos

Thank you ...... i found solution after I posted thread. Your response also helped. Thank you