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

Uploading attachments in Purchase Requisition through Code

Former Member
0 Likes
3,804

Hi,

I am going to develop an BSP (SAPUI5) application where I need to create purchase requisition. Hence, instead of using ME51N, those functionality need to be available in my application. Hence, I am using some function modules like BAPI_PR_CREATE or BAPI_REQUISITION_CREATE etc for creating the purchase requisition. Uploading attachment is one of the functionality available in ME51N. Currently attachments are already available in the system which are visible through ME52n etc.

How can I replicate the functionality of uploading attachment in purchase requisition in ME51N/ME52N using ABAP code? If anybody has experience in this kind of requirement it will be of great help if you please share me the same. It is an urgent requirement.

Regards,

Subhabaha Pal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,975

Hi,

Try Class CL_BDS_DOCUMENT_SET

Regards,

Ron

6 REPLIES 6
Read only

Former Member
0 Likes
1,975

Not sure whether you are using GOS or content repository to store documents.

You need to create class handlers to receive xstring from your UI and upload into SAP via FM.

For content repository you could use FM like SCMS_DOC_CREATE , ARCHIV_CONNECTION_INSERT.

Read only

0 Likes
1,975

Hi Niyaz,

Thanks for your reply.

I am using GOS in order to store documents.

Can you please suggest any code to upload PR attachment document through code?

Regards,

Subhabaha Pal

Read only

0 Likes
1,975

Have a look at below links. Refer to reply by Kesavadas Thekkillath

http://scn.sap.com/message/13925228#13925228

Also below link.

Message was edited by: Niyaz Ahamed

Read only

0 Likes
1,975

Thanks Niyaz ... I am going through the link to see if it helps.....

Read only

Former Member
0 Likes
1,976

Hi,

Try Class CL_BDS_DOCUMENT_SET

Regards,

Ron

Read only

0 Likes
1,975

Thanks Ron for your kind help.

I have used the method SAVE in class cl_fitv_gos for attachment upload and it worked fine for me.

Thanks a lot Ron for your kind help.

Regards,

Subhabaha Pal