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.
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:
- 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:
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”
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.