Generic Object Services (GOS) Toolbar Part 8 : Disable Delete Function

By | January 12, 2012 | Generic Object Services (GOS) | 26,629 | 1

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.

GOS Attachment List Delete Option

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.

GOS Authorization object S_GOS_ATT

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:

  1. Create BADI implementation for filter VIEW_ATTA
  2. 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
 

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{274 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 274 articles.

Load comments

1 Comment

  • ayush

    Hi Naimesh,

    How to restrict the bahaviour of attachment list for a particular t-code. BADI GOS_SRV_REQUEST is implemented using filter ‘VIEW_ATTA’ and for a particular T-code want to disbale delete. Its not happening.

    GOS services for all t-codes are not diaplying delte button.

    CALL FUNCTION ‘GOS_ATTACHMENT_LIST_POPUP’
    EXPORTING
    is_object = lwa_object
    ip_mode = ‘D’. ” Display

    please resolve.

    Thanks
    ayush

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.