Many times, I have received the request to disable Delete Function on Attachment list of the Generic Object Services (GOS) in SAP.
Option in question
This delete option on the GOS attachment list, is in the question.
Authorization Object S_GOS_ATT
Authorization object S_GOS_ATT was introduced in recent support pack releases. Check out the OSS Note 1293080 – GOS: Attachment list autorization object S_GOS_ATT for more information on which Support Pack contains this Authorization object. If you are on the latest support pack, this authorization object should exist in your system.
The object is available under Object class BC_Z – Basis – Central Functions. By setting up proper ACTVT field values in the Users Security Profile, we can control the Delete Access of the attachment. We can also control, who can change the attachment.
Workaround when Authorization Object is missing
When your system doesn’t have S_GOS_ATT object yet available, you may use this workaround.
In SAP, we have a BADI GOS_SRV_REQUEST which triggers before start of every service in GOS toolbar. This BADI is filter dependent. We have a FM GOS_ATTACHMENT_LIST_POPUP which also generates the Attachment List.
So, here what you need to do to achieve the workaround:
- Create BADI implementation for filter VIEW_ATTA
- In the implementation,
- call the FM GOS_ATTACHMENT_LIST_POPUP to generate the Attachment list popup
- Set the parameter IP_MODE as D for Display. This parameter drives which toolbar buttons would be active or inactive. So, setting it to display more will gray out Create, Change and Display.
Sample code snippet:
GOS BADI Implementation for GOS list
DATA: lwa_object TYPE sibflporb. lwa_object-instid = is_lpor-instid. lwa_object-objtype = is_lpor-typeid. lwa_object-catid = 'BO'. CALL FUNCTION 'GOS_ATTACHMENT_LIST_POPUP' EXPORTING is_object = lwa_object ip_mode = 'D'. " Display