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

Services for object

Former Member
0 Likes
1,657

Certain transactions allow you to "attach" objects to documents. For those that do (ex. VBO2) there is a "services for object" button on the top left of the screen.

Is there any way to use this functionality in batch? The BDC recording disables this button. Is there a BAPI/FM out there that covers the "services for object" functionality?

Thanks

Srinivas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,292

You can have a look at this example.Maybe this will help you

start-of-selection.

DATA : gs_borident TYPE borident,

lv_service TYPE sgs_srvnam,

lp_no_commit TYPE sgs_cmode,

gl_service_selection TYPE tgos_sels,

lv_rwmode TYPE sgs_rwmod,

lv_pop TYPE sgs_cmode,

lv_status TYPE sgs_status,

lv_icon TYPE sgs_icon,

lv_event TYPE i.

gs_borident-objkey = '0000004057620001'.

gs_borident-objtype = 'QMSM'.

lv_rwmode = 'E'.

lv_service = 'PCATTA_CREA'.

CALL FUNCTION 'GOS_EXECUTE_SERVICE'

EXPORTING

ip_service = lv_service

is_object = gs_borident

ip_no_commit = lp_no_commit

ip_popup = lv_pop

ip_rwmod = lv_rwmode

it_service_selection = gl_service_selection

IMPORTING

ep_event = lv_event

ep_status = lv_status

ep_icon = lv_icon

EXCEPTIONS

execution_failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

ENDIF.

.

data: lv_class type ref to ZCL_FI_IMG_WF_OVERVIEW.

CREATE OBJECT lv_class.

CALL METHOD lv_class->update_service

EXPORTING

ip_status = lv_status

ip_icon = lv_icon

ip_event = lv_event.

.

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,292

Hi, this is the GOS(Generic Object Services), you may be able to use the class CL_GOS_MANAGER.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,293

You can have a look at this example.Maybe this will help you

start-of-selection.

DATA : gs_borident TYPE borident,

lv_service TYPE sgs_srvnam,

lp_no_commit TYPE sgs_cmode,

gl_service_selection TYPE tgos_sels,

lv_rwmode TYPE sgs_rwmod,

lv_pop TYPE sgs_cmode,

lv_status TYPE sgs_status,

lv_icon TYPE sgs_icon,

lv_event TYPE i.

gs_borident-objkey = '0000004057620001'.

gs_borident-objtype = 'QMSM'.

lv_rwmode = 'E'.

lv_service = 'PCATTA_CREA'.

CALL FUNCTION 'GOS_EXECUTE_SERVICE'

EXPORTING

ip_service = lv_service

is_object = gs_borident

ip_no_commit = lp_no_commit

ip_popup = lv_pop

ip_rwmod = lv_rwmode

it_service_selection = gl_service_selection

IMPORTING

ep_event = lv_event

ep_status = lv_status

ep_icon = lv_icon

EXCEPTIONS

execution_failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

ENDIF.

.

data: lv_class type ref to ZCL_FI_IMG_WF_OVERVIEW.

CREATE OBJECT lv_class.

CALL METHOD lv_class->update_service

EXPORTING

ip_status = lv_status

ip_icon = lv_icon

ip_event = lv_event.

.

Read only

0 Likes
1,292

Ravi

Thank you.

Does the gs_borident-objtype field contain the object I'm trying to attach (in this case a url link) or the object I'm attaching to (in this case a rebate agreement)?

Thanks

Read only

0 Likes
1,292

Len, it is the object that you are attaching to, the business object.

Regards,

Rich heilman

Read only

0 Likes
1,292

Whoa that was fast Rich thanks!

So, in my scenario where I'm attaching a URL to a rebate agreement I think I need the following:

gs_borident-objkey = the rebate number?

gs_borident-objtype = 'BUS3031'.

lv_rwmode = 'E'.

lv_service = 'URL_CREA'.

But where do I pass the actual URL value?

Thanks

Read only

0 Likes
1,292

check this weblog for code sample.

<a href="/people/rammanohar.tiwari/blog/2006/03/25/generic-object-services-gos--in-background--part-ii">Generic object services (GOS) - in Background - Part II</a>

Regards

Raja