Activating Generic Object Services Toolbar in S..

9
29/07/13 Activating Generic Object Services Toolbar in S... | SCN scn.sap.com/docs/DOC-33485 1/9 Getting Started Newsletters Store Products Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Login Register Welcome, Guest Search the Community Activity Communications Actions Brow se 0 Tweet created by Abhijeet Kapgate on Nov 21, 2012 1:35 PM, last modified by Abhijeet Kapgate on Jul 10, 2013 1:19 PM Business Requirement Many a times there is a business requirement of linking documents, entering notes, sending notes or linking an internet address to various SAP objects. These external attachments can be reference documents, pictures, Email attachments, designs, diagrams or related spreadsheets. To meet this requirement SAP has provided a tool bar called ‘Generic Object services toolbar’ or ‘GOS toolbar’. What is GOS The GOS is a toolbar that provides different functions such as adding an attachment, creating a document link, displaying all the attachments etc. The attachments are not generic for that transaction but are specific for a particular SAP object. The GOS toolbar can be activated using a class CL_GOS_MANAGER. Currently in the system the GOS toolbar is available by default only for certain SAP objects. For Ex. ME21N. See screen shot below. The GOS toolbar is highlighted. As shown above, the attachments created in ME21N screen will be linked to a particular purchase order and cannot be seen for any other purchase order in ME22N or ME23N screens. Services that the GOS toolbar provides The following list shows all possible object services. Not all object services are available - it depends on objects that are already active. Individual object services can also only be accessed using a sub-menu, so that the symbol is not displayed in the toolbox. Activating Generic Object Services Toolbar in SAP Objects Share Share Version 3

Transcript of Activating Generic Object Services Toolbar in S..

Page 1: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 1/9

Getting Started Newsletters Store

Products Services & Support About SCN Downloads

Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation

Login RegisterWelcome, Guest Search the Community

Activity Communications Actions

Brow se

0 Tweet

created by Abhijeet Kapgate on Nov 21, 2012 1:35 PM, last modif ied by Abhijeet Kapgate on Jul 10, 2013 1:19 PM

Business Requirement Many a times there is a business requirement of linking documents, entering notes, sending notes or linking

an internet address to various SAP objects. These external attachments can be reference documents,

pictures, Email attachments, designs, diagrams or related spreadsheets. To meet this requirement SAP has

provided a tool bar called ‘Generic Object services toolbar’ or ‘GOS toolbar’.

What is GOSThe GOS is a toolbar that provides different functions such as adding an attachment, creating a document link,

displaying all the attachments etc. The attachments are not generic for that transaction but are specific for a

particular SAP object. The GOS toolbar can be activated using a class CL_GOS_MANAGER.

Currently in the system the GOS toolbar is available by default only for certain SAP objects.

For Ex. ME21N. See screen shot below. The GOS toolbar is highlighted.

As shown above, the attachments created in ME21N screen will be linked to a particular purchase order and

cannot be seen for any other purchase order in ME22N or ME23N screens.

Services that the GOS toolbar provides The following list shows all possible object services. Not all object services are available - it depends on

objects that are already active. Individual object services can also only be accessed using a sub-menu, so that

the symbol is not displayed in the toolbox.

Activating Generic Object Services Toolbarin SAP Objects

ShareShare

Version 3

Page 2: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 2/9

Adding an attachment

Entering a Note with an Object

Sending an Object with a Note

Starting a Workflow for an Object

Linking an Internet Address

Entering a Bar Code

Tracing Events for the Object (Subscription)

Telephony

Displaying Object History

Displaying Workflows for the Object

Displaying Transmissions for an Object

Displaying Relationships

Displaying Attachments

Activating Generic Object Services toolbar The Class CL_GOS_MANAGER is used for activating the GOS toolbar. We have to create an instance of the

class. The instance of the class can be created by calling the constructor method. Also, a variable of type

BORIDENT needs to be created for the application business object. The object type and object key is

assigned to this variable which is then passed to the instance of the class CL_GOS_MANAGER as shown

below. This entire code has to be written either inside a suitable user-exit, enhancement point. If both user-exit

and enhancement point are not applicable, implicit enhancement can be created inside the standard of that

transaction where GOS has to be activated.

The syntax is:

DATA: LR_GOS_MANAGER TYPE REF TO CL_GOS_MANAGER,

LS_BORIDENT TYPE BORIDENT.

LS_BORIDENT-OBJTYPE = 'BUS2081'.

LS_BORIDENT-OBJKEY = '12345678902011'.

CREATE OBJECT LR_GOS_MANAGER

EXPORTING

IS_OBJECT = LS_BORIDENT

IP_NO_COMMIT = ' '

EXCEPTIONS

OBJECT_INVALID = 1.

Here the object key is the combination of the SAP fields that are mandatorily required to execute those

transactions. This will publish the GOS with the supplied BO instance if it is used in an executable program.

Earlier the Function Module SWU_OBJECT_PUBLISH was used for activating the GOS toolbar which now has

become obsolete. The object type and the object key were passed as the import parameters to the function

module.

ExampleFor the material BOM transactions (CS01, CS02, CS03), the GOS tool bar is not provided by standard SAP.

See screen shot below.

We will see below how we can activate the GOS toolbar using above class for transactions CS01 / CS02 /

CS03.

To activate it we need to do an enhancement in include ‘LCSDIFCD’ inside form OKCODE_BEARBEITEN. For

transaction ‘CS03’ material number, plant, BOM usage are the required fields. See screen shot below:

Page 3: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 3/9

1. So the object key for above example is combination of values of material number, plant and BOM usage.

How to get the object key

The object key can be found out from the object type. Enter the object type in transaction ‘SWO1’

Click on display.

E.g. If material number is 100000000000000099,

plant is – 1234 and

BOM usage – 5, the object key will be

Object-key = ‘10000000000000009912345’

2. The object type can be found in table TOBJ and also from transaction SWO1.The object type for Material

BOM (CS01/02/03) - BUS1082.

3. Leave the IP_NO_COMMIT parameter as blank.

If the parameter IP_NO_COMMIT is set, it means that your application should start ‘COMMIT WORK’

command. That is also the default value.

If the parameter is empty, the object services will call the ‘COMMIT WORK’. In this case, the data passed

should be consistent.

When called because the database changes cannot be reversed using ‘ROLLBACK’.

4. The GOS toolbar / Button will now be visible and activated in t-codes CS01, CS02 and CS03 after the

enhancement is activated.

5. For Sales order, the service can be activated by setting user parameter.Set parameter SD_SWU_ACTIVE

= ‘X’ in the user profile. This will activate the

generic object services for VA01, VA02 and VA03.

Page 4: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 4/9

Steps to create attachments for a Material BOM1] Click on the GOS toolbar. Different options will be displayed.

2. Click on ‘Create-> Create attachment’ option.

3. A pop-up window will be opened to find a file or attachment as shown below.

Select the file and click on open.

4. A success message will be displayed in the task bar.

Page 5: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 5/9

5. Now let us create an external document link. Follow the screen shot below:

6. Click on Enter.

A success message will be displayed at the status bar ‘The attachment was successfully created’.

Viewing the attachments1] To view the list of attachments, go to attachment list as shown below.

Page 6: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 6/9

Average User Rating

(9 ratings)

Tweet0

Topics: ABAP

2] The list will be displayed as shown below.

Some transactions where GOS is activated using thisclass.

4530 View s Tags: abap, gos, enhancements, activating_gos, gos_toolbar, gos_services

ShareShare

20 Comments

Like (0)

Kapil Changrani Nov 22, 2012 8:36 AM

Concise and Informative.

Like (0)

Sai Krishna Maddela Nov 22, 2012 10:33 AM

Nice Document....Thanks

Ashutosh Mishra Dec 21, 2012 12:05 PM

Hi,I am not able to write the code that you provide in above part in enhancement include "LCSDIFCD" forCS01/CS02/CS03. Please explain me how i will resolve this Issue. Thanks

Page 7: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 7/9

Like (0)

Like (0)

Abhijeet Kapgate Dec 21, 2012 12:17 PM (in response to Ashutosh Mishra)

Hi Ashutosh,You will have to create implicit enhancement to write the code.

Like (0)

Ashutosh Mishra Dec 21, 2012 12:06 PM

Helpful answer

Like (0)

Ashutosh Mishra Dec 21, 2012 2:14 PM

Hi Abhijeet,Thanks for Quick response!!! can you tell how i ll get the value as a dynamic in Object Key.

Like (0)

Abhijeet Kapgate Dec 21, 2012 2:34 PM (in response to Ashutosh Mishra)

Hi Ashutosh,If I understand your query correctly, the business object will always be known as to whichSAP object needs to be enhanced to have the GOS toolbar and will not be dynamic.For e.g.you will have clear requirement to enhance this particular transaction.Whereas the objectkey will always be dynamic and its values will be obtained in the standard structures(table,workareas) which get filled run-time inside the includes where you write the code.Hope this helps.Thanks.

Like (0)

Ashutosh Mishra Dec 21, 2012 2:40 PM

Hi Abhijeet,After doing the Implicit enhancement i did the code in below format then its working for all thematerial,Plant and BOM Usage. DATA: LR_GOS_MANAGER TYPE REF TO CL_GOS_MANAGER, IS_BORIDENT TYPE BORIDENT.data : l_objky(23) type c.CONCATENATE POMAT-matnr POMARC-werks RC29N-STLAN INTO l_objky.IS_BORIDENT-OBJTYPE = 'BUS1082'.IS_BORIDENT-OBJKEY = l_objky. CREATE OBJECT LR_GOS_MANAGEREXPORTINGIS_OBJECT = IS_BORIDENTIP_NO_COMMIT = ' 'EXCEPTIONSOBJECT_INVALID = 1.Thanks a lot for your Document.

Like (0)

Ashutosh Mishra Dec 27, 2012 11:19 AM

Hi all,If you want to activate Store Business Document then you have to pass the objtype as "BUS1080" inplace of "BUS1082" in the above code.

Like (0)

sanjeevi ramamoorthy Jun 13, 2013 11:26 AM

Nice and Informative!.. Good One .Useful.

Like (0)

Aditya Bajoria Jul 10, 2013 10:23 AM

Nice document. I have a requirement to add this toolbar at budgeting trasnactions such as CJ30-CJ38 etc. Any help??

Abhijeet Kapgate Jul 10, 2013 1:31 PM (in response to Aditya Bajoria)

Hi Aditya, Thank you for your query. You can achieve the requirement by following the above post.If you debug, you will get an include in the PBO for CJ30 where you can add this piece ofcode thru implicit enhancement.The include name is - MKBUDF02Form name - INIT_PROJ_PBOClick on the 'Enhance' button (Shift + F4). Go to Menu->Edit->Enhancement Operations->Show implicit enhancement options.A dotted line will appear. Right click->Enhancement implementation->Create

Page 8: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 8/9

Like (0)

Then write following code:DATA: LR_GOS_MANAGER TYPE REF TO CL_GOS_MANAGER, LS_BORIDENT TYPE BORIDENT. LS_BORIDENT-OBJTYPE = 'BUS2001'.CREATE OBJECT LR_GOS_MANAGEREXPORTINGIS_OBJECT = LS_BORIDENTIP_NO_COMMIT = ' 'EXCEPTIONSOBJECT_INVALID = 1.Activate the enhancement, executee CJ30 and you will see theGOS toolbar.Hope this helps. Try this out and let me know if you face anyissues.Regards,Abhijeet Kapgate

Like (0)

Hima Akkineni Jul 20, 2013 5:16 AM

Hi I am trying to use the GOS for VA41. Currently the service is enabled for VA42 and VA43. But thebusiness requirement is to enable the service for VA41 also. I did get the following docmantation for"Publishing Object and offering the Toolbox Directly" where it talks about using BOR_ID in Createtransactions. As I am new to GOS I still dont where exactly that peice of code should be implemented. Like above reply could someone help me to let me know where I can implement the GOS for VA41. Any help is appreciated. ThanksHA

Like (0)

Abhijeet Kapgate Jul 22, 2013 9:34 AM (in response to Hima Akkineni)

Hi Hima, You can achieve this by doing implicit enhancement in include'MV45AF0T_TRANSAKTION_INIT' in form 'TRANSAKTION_INIT'.PassLS_BORIDENT-OBJTYPE = 'BUSISM0030'.LS_BORIDENT-OBJKEY = vbak-auart. in the above code. Activate the enhancement and the GOS toolbar will be activatedfor VA41. Regards,Abhijeet Kapgate

Like (0)

Hima Akkineni Jul 22, 2013 5:36 PM (in response to Abhijeet Kapgate)

Thank you very much for quick reply. It worked lika a charm. I had one issue though. For customer we have implemented 2 new functionalityfor GOS. And those are coming in for VA41 also. How do I avoid that.

Like (0)

Abhijeet Kapgate Jul 23, 2013 8:49 AM (in response to Hima Akkineni)

You can put a if condition for tcode VA41.

Like (0)

Hima Akkineni Jul 23, 2013 12:34 AM (in response to Abhijeet Kapgate)

Thank you Abhijeet, this worked fine. But the workflow option is grayed out. How do I enable the Workflow. THanksHA

Hima Akkineni Jul 23, 2013 4:26 PM (in response to Hima Akkineni)

Hi Abhijeet, Thank you for your response. I have placed the condition already as Idont want this to be enabled for VA01. here is my code. IF sy-tcode = 'VA41'. DATA: LR_GOS_MANAGER TYPE REF TO CL_GOS_MANAGER, LS_BORIDENT TYPE BORIDENT.

Page 9: Activating Generic Object Services Toolbar in S..

29/07/13 Activating Generic Object Services Toolbar in S... | SCN

scn.sap.com/docs/DOC-33485 9/9

Follow SCNSite Index Contact Us SAP Help Portal

Privacy Terms of Use Legal Disclosure Copyright

Like (0)

LS_BORIDENT-OBJTYPE = 'BUSISM0030' LS_BORIDENT-OBJKEY = vbak-auart.

CREATE OBJECT LR_GOS_MANAGER EXPORTING IS_OBJECT = LS_BORIDENT IP_NO_COMMIT = 'X' IP_NO_INSTANCE = 'X' EXCEPTIONS OBJECT_INVALID = 1. here is my issue. The workflow Icon is activate, but Start workflow,workflow overview, or Archived workflows options are greyed out. But these options are available in VA42 and VA43 GOS which arestandard. ThanksHA

Like (0)

Hima Akkineni Jul 25, 2013 5:20 PM

Hi Abhijeet, Any thoughts.

Like (0)

Abhijeet Kapgate Jul 26, 2013 9:05 AM (in response to Hima Akkineni)

Hi Hima, The ICON 'Workflow' has three options - Start workflow, workflow overview and Archivedworkflows.A]Start workflow - This is used for starting workflows that use the object. All suitableworkflows automatically determine the system and are offered for execution.The SAP System contains active workflows that fulfill the following prerequisites:1.They must be allowed to start the workflow.2.The workflow is only allowed to have the object as an obligatory import parameter.When you click on start workflow - All active workflows which fulfill the prerequisites aboveare displayed.B] Display workflow - This will display the overview of the workflow, if any.C] Archieved workflow - All workflows that are running or have been executed, in which yourdocument (object) has already been edited, are displayed. So as described above this is standard feature. In my case the behavior of the 'Workflow'button on the GOS toolbar is same for VA41, VA42 and VA43 i.e. workflow Icon is activate,but Start workflow, workflow overview, or Archived workflows options are greyed out. Regards,Abhijeet