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

automatic GOS create attachment in ME51n

Former Member
0 Likes
1,588

Hi,

I need to find a FM that adds an attachment to a requirement which is created from IDOC.

IDOC itself contains a link to the document that should be attached. The document is located on a network drive. The link is visable in created requirement in item texts.

As far as I could see it is imposible to use GOS in create tcode ME51n. However it is available in ME52n.

The attachment creation should be automatic.

Will appreciate ideas, clues and codes.

Regards,

MM

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
978

Try to find an userexit after save in ME51N and get the url from IDoc and try to use


data lo_attachment type ref to cl_gos_document_service.
  clear ls_url.
  create object lo_attachment.
  call method lo_attachment->create_url
       exporting  is_object = ls_object
       importing  ep_url = lp_url.

In After save userexit you will also get the pur req docno also. this is needed for INSTID_A in the link table.

a®s

Edited by: a®s on Mar 4, 2008 12:28 PM

Hi,

I need to find a FM that adds an attachment to a requirement which is created from IDOC.

IDOC itself contains a link to the document that should be attached. The document is located on a network drive. The link is visable in created requirement in item texts.

As far as I could see it is imposible to use GOS in create tcode ME51n. However it is available in ME52n.

The attachment creation should be automatic.

Will appreciate ideas, clues and codes.

Regards,

MM

2 REPLIES 2
Read only

former_member194669
Active Contributor
0 Likes
979

Try to find an userexit after save in ME51N and get the url from IDoc and try to use


data lo_attachment type ref to cl_gos_document_service.
  clear ls_url.
  create object lo_attachment.
  call method lo_attachment->create_url
       exporting  is_object = ls_object
       importing  ep_url = lp_url.

In After save userexit you will also get the pur req docno also. this is needed for INSTID_A in the link table.

a®s

Edited by: a®s on Mar 4, 2008 12:28 PM

Read only

0 Likes
978

Thanks for your reply.

I have a problem with finding the right exit in which I would have a number of purchase requisition available.

Regards,

MMM