Generic Object Services (GOS) Toolbar Part 1 : Add New Option in the Toolbar

By | October 30, 2008 | Generic Object Services (GOS) | 42,378 | 15

Eloborates the option to add a new Menu Entry in the GOS toolbar

Generic Object Services (GOS) Toolbar offers the functions which are common to many SAP applications. This powerful toolbar provides much functionality like create attachments, notes, mails; send mails; list attachments and many more. You can find more functionality on Generic Object Services at SAP Help on Generic Object Services.

The default GOS toolbar options are somewhat like this:

Sometimes, we need to add some new toolbar entries to facilitate the business requirement. For example, in the Generic object toolbar add the new option like “Document List” which is generic to all business objects and of course we need to handle that. In this post, we will see the steps and rules to be followed to add a new Entry in the toolbar. In the next, post we will see how we can handle the added menu option to fulfill our custom requirement.

To be more specific in explaining the requirement, we will take a business requirement to add a new menu “Sales Orders List” for the GOS toolbar for Customer Master. At first we will see how we can just bring this menu option at very last position. Like:

To bring the new entry (menu option) in this GOS toolbar, we need to maintain that in the table SGOSATTR. This table can be maintained using SM30.

  • Class for Gen. Services: This is the driver class when we select the object service (menu option) from the GOS toolbar. For time being we will keep this as the CL_GOS_SRV_ATTACHMENT_LIST.
  • Service Type: We will select 1 because we want Single entry menu option on the GOS toolbar. There are options to create a main menu entry and submenus under that main menu by selecting proper service type.
  • Next Service: We will clear the value in this since we want our button at very last level. This next service field must be set when we need to put the custom option in between other options.
  • Control: We will select this, since we want to generate our output in the Custom Container.
  • Commit Work: We will not select this option because we don’t want to commit the work.

Along with creating a new entry this way, we need to set this service as next service of the previous service. In this case, our new service will come just under the “Help for object services” we need to modify that service like this:

By selecting this option Sales Orders list from the GOS toolbar, we will see the attachment list being generated by the class CL_GOS_SRV_ATTACHMENT_LIST:

NOTE: You might see the option grayed out if you don’t have any attachment created for that particular customer. To create: Select the Create.. > Create Attachment. Select any file from your PC to add as attachment.

To be able to bring that option in between of others, we need to play around with the Next Service value of the buttons. For example, I want to put my button just under the “Attachment List” option and above “Private Note”.
For this we need to:
1.Set the new option as the next Service for the “Attachment List”

2.Set the “Private Note” as the next service for the new option

3.Remove the next service from the option which will come at last. This is very important.

After following these steps, the toolbar options will look like:

In the next post, we will see how we can use our custom class to generate our fully customized code i.e. Instead of the class CL_GOS_SRV_ATTACHMENT_LIST, we will use custom class ZCL_SO_LIST.

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{273 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 273 articles.

Load comments


  • Anonymous

    Hi Naimesh,
    Do you have very detailed instructions on how to archive ‘create attachment’
    files to the archive server? I’ve read oss notes 530792, 389366 and 904711. It states it can be done but I’ve had no luck – it continues to write to SOCC3 and SOFFCONT1 SAP office tables. We already have an archiving solution for ‘business documents’ by adding the appropriate OAC2 and OAC3 confuguration entries and seeing all archived entries in TOA03. We use SAPHTTP and archivelink. Our problem is the size of SAP office tables and we cannot delete older entries because we do not know the importance of the documents users have attached to their SD documents. You have already answered my question on sdn on how to disable the ‘create attachment’ option and many thanks for that.
    Thanks for all your help.

  • Anonymous

    Part 1 and 2 are both extremely informative.
    Thanks for this useful contribution.

  • Hello Soyab,

    No, I don’t have any idea about how you can move them to archieve server.

    Naimesh Patel

  • Anonymous

    Hi Naimesh,

    Can you control the buttons on the attachment list? Example, disable the delete button (should also be disabled in the context menu) depending on the ownership of the attachment.

    Thanks in advance.

  • Anonymous

    Hi Naimesh,

    Hope u are still monitoring this blog entry.

    Can you tell me more about the object service ‘Linking an Internet Address’?
    I am wondering which table stores the entries.


  • Hello Shah,

    You asked: Can you tell me more about the object service ‘Linking an Internet Address’?
    I am wondering which table stores the entries.
    You can use the method READ_LINKS of the class CL_BINARY_RELATION to read any GOS attachements. Check this post: which reads the data from the attachement type NOTE.

    Naimesh Patel

  • Anonymous

    Hi Naimesh,
    Thanks for sharing this important information.

    Have a question here. We have a requirement User don't want to use standard GOS tool bar which comes in status bar. Instead they want 2 buttons for creating and displaying the attachments in application tool bar. We got the solution by similar way by using class cl_gos_manager.

    But on clicking the create attachment button, it is creating the attachment and once the screen is refreshed back i am getting standard GOS icon in status BAR which i dont want.

    Any idea on how to exclude this?


  • Hi Naimesh
    Can you help me to activate Services for object in my transaction..
    I dont see services for object tab in my transaction

    Vicky Patel

  • Anonymous

    Hi, I cannot get the create attachement active ibn VELO, can you give some advice

  • Anonymous

    how to exclude standard menu in SAP (ABAP)?

  • Anonymous

    Hi Nimesh,
    Is there a way to copy the attachments from one objects onto another.
    My requirement is to copy the attachments from one notification onto another notification.

    Thanks in advance.

  • Hello Sanny,

    You asked –
    Is there a way to copy the attachments from one objects onto another.

    You can find it here in this post – Generic Object Services (GOS) Toolbar Part 6 : Copy Attachments between objects

    Naimesh Patel

  • Hi Naimesh,
    How can i create attachment for the sales order through the ABAP program. Since i have more than 10000 sales orders need to attach pic. I can't record these process in BDC. Hope you can give me some advice ! THX

    Best regards,

  • Anonymous

    Hi Naimesh,

    I have requirement from business that URL to be attached should have more charaters than existing. So is it possible that we can increase number of characters for URL field.

    Thanks in advance,

  • rathish

    Hi Naimesh,

    I have requirement to disabling the delete button after PO completely released in Attachment lists.Guide me some advice to solve this maid id

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.