Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

GOS Restrictions

Former Member
0 Kudos

Hi,

I'm looking for a possibility to restrict(deactivate to be more specific) some of the GOS fields. I found in this forum 2 possible options:

1) making a copy of the service class from SGOSM and use it as a Z class in SGOS

2) implementing the BADI GOS_SRV_SELECT.

Is there a more simple way to deactivate some fields? Like for example PCATTA_CREA or restrict it via authorisation, not sure if the authorisation role SAP_BC_GOS_ATTACHMENT_LIST will help here.

Thanks a lot.

Best Regards,

Ray

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Last time I used GOS_SRV_SELECT to implement an authority-check. First I created an authorization object with fields BOROBJTYPE and a Z_CLSNAME referring data element SGS_SRVNAM and check table SGOSATTR.

Then I implemented BAdI GOS_SRV_SELECT.

METHOD if_ex_gos_srv_select~select_services.
* Local data
     DATA: ls_option TYPE sgos_sels.
     FIELD-SYMBOLS <service> TYPE sgosattr.
* Check authorization per service/object type
     LOOP AT services ASSIGNING <service>.
       AUTHORITY-CHECK OBJECT 'ZXXXXXX'
       ID 'BOROBJTYPE' FIELD is_lpor-typeid
       ID 'Z_CLSNAME' FIELD <service>-name.
       IF sy-subrc NE 0.
         ls_option-sign   = 'E'.
         ls_option-option = 'EQ'.
         ls_option-low    = <service>-name.
         APPEND ls_option TO et_options.
       ENDIF.
     ENDLOOP.
   ENDMETHOD.                    "if_ex_gos_srv_select~select_services

METHOD class_constructor.
* Read whole services list
   SELECT *
   INTO TABLE services " this is an attribute of the class
   FROM sgosattr.
ENDMETHOD.                    "class_constructor

Regards,

Raymond

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos

Last time I used GOS_SRV_SELECT to implement an authority-check. First I created an authorization object with fields BOROBJTYPE and a Z_CLSNAME referring data element SGS_SRVNAM and check table SGOSATTR.

Then I implemented BAdI GOS_SRV_SELECT.

METHOD if_ex_gos_srv_select~select_services.
* Local data
     DATA: ls_option TYPE sgos_sels.
     FIELD-SYMBOLS <service> TYPE sgosattr.
* Check authorization per service/object type
     LOOP AT services ASSIGNING <service>.
       AUTHORITY-CHECK OBJECT 'ZXXXXXX'
       ID 'BOROBJTYPE' FIELD is_lpor-typeid
       ID 'Z_CLSNAME' FIELD <service>-name.
       IF sy-subrc NE 0.
         ls_option-sign   = 'E'.
         ls_option-option = 'EQ'.
         ls_option-low    = <service>-name.
         APPEND ls_option TO et_options.
       ENDIF.
     ENDLOOP.
   ENDMETHOD.                    "if_ex_gos_srv_select~select_services

METHOD class_constructor.
* Read whole services list
   SELECT *
   INTO TABLE services " this is an attribute of the class
   FROM sgosattr.
ENDMETHOD.                    "class_constructor

Regards,

Raymond

FredericGirod
Active Contributor
0 Kudos

Hi,

I was used the badi GOS_SRC_SELECT and it was really simple ...

regards

Fred

Former Member
0 Kudos

Thanks a lot. We already look into this possibility, we are only trying to look if a customising table exist to deactivates this fields. I guess there is none.

Best Regards,

Ray

0 Kudos

Like said, check the table SGOSATTR, this table will give you the possibility to change the menu.

And if you want to remove some option of the menu, you have to use the badi GOS_SRC_SELECT. You could do this by trans (object in fact) / user.

What do you need more than this ??

regards

Fred

0 Kudos

Hi, Frederic,

I understand and we know that option also. We are only looking if there is a customizing table exist were you don't need to delete entry in order to deactivate it.

Best Regards,

Raynard

0 Kudos

But you don't need to delete entries with the badi ..

here an example :

the BADI :

  data : is_option type SGOS_SELS.


* Si on est chez les clients. on active que le menu client.
IF is_lpor-typeid EQ 'KNA1'.

MOVE : 'I'          TO is_option-sign ,
'EQ'         TO is_option-option ,
'ZKNA1_001'  TO is_option-low.
APPEND is_option to et_options.

MOVE : 'I'          TO is_option-sign ,
'EQ'         TO is_option-option ,
'ZKNA1_999'  TO is_option-low.
APPEND is_option to et_options.

ENDIF.

The table SGOSATTR :

I have define my own entries for the customer, but the class are the same.

So when the users are in a transaction for customer and the press the GOS button, they only have two lines : One to enter doc, the second to get the list of the docs.

It's really simple and usefull.

Regards

Fred


0 Kudos

Thanks Fred! We were trying to avoid the use of BADI or any other modification in the system but this is already helpful.

Thanks again.

Best Regards,

Ray