Application Development 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: 

accessing attachments from 'services for object'

deepak_kumar11
Participant
0 Kudos
121

I have been tasked with extracting data from external attachments from the 'services for object' button. I am working in an sap ecc 6.0 environment. I have not found any tips on how to do this from google searches.

Here is an example. If you look at most of the major documents (purchase order, invoice, delivery, etc.) there will be a little dropdown icon in the upper left corner of the screen

That icon is the 'Services for Object' button. Clicking on it will display a small popup window with several options including one for attached documents.

If an attachment (could be word, excel, pdf, URL, etc.) exists it will show up and can be viewed by double clicking on it. Does anyone know how to access

that attachment programatically?

Thank you very much in advance.

deepak

1 ACCEPTED SOLUTION

Former Member
0 Kudos
43

Hi,

Create a subroutine in your program and call the FM: SWU_OBJECT_PUBLISH as below:

CALL FUNCTION 'SWU_OBJECT_PUBLISH'

EXPORTING

objtype = gc_businessobj

objkey = gw_header-vbeln

EXCEPTIONS

objtype_not_found = 1

OTHERS = 2.

This will automatically display your Services for Object ICON on your report. Here in the FM, gc_businessobj is a global business object = BUS2031(defined as a constant inside the pgm) and gw_header-vbeln can be any valid document no like a sale order, inquiry, quotation etc.

Use this code snippet and this will work.

Regards,

JLN

1 REPLY 1

Former Member
0 Kudos
44

Hi,

Create a subroutine in your program and call the FM: SWU_OBJECT_PUBLISH as below:

CALL FUNCTION 'SWU_OBJECT_PUBLISH'

EXPORTING

objtype = gc_businessobj

objkey = gw_header-vbeln

EXCEPTIONS

objtype_not_found = 1

OTHERS = 2.

This will automatically display your Services for Object ICON on your report. Here in the FM, gc_businessobj is a global business object = BUS2031(defined as a constant inside the pgm) and gw_header-vbeln can be any valid document no like a sale order, inquiry, quotation etc.

Use this code snippet and this will work.

Regards,

JLN