Skip to Content
avatar image
Former Member

restricting log on user ID, in the selection screen where S_WERKS=USERID

Hi all,

I wanted to restrict the user in z programme,

Users from 6000-6999 when ever they use a particular transaction (ZSales) In the selection screen (S_WERKS) SITE=USER ID and it has to get disable. For Example if an user ID is STRMGR6009 is the user name when ever he uses a Zsales transaction, in the selection screen it has to be (S_WERKS) SITE=6009. And also he should not be able to see other site details.

I have tried to do it as follows..

PARAMETERS : p_sale RADIOBUTTON GROUP pt1," DEFAULT 'X',
                                    p_stock RADIOBUTTON GROUP pt1 .
SELECTION-SCREEN PUSHBUTTON 3(10) text-018 USER-COMMAND enter .
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-019.

SELECT-OPTIONS :s_party FOR kna1-kunnr MODIF ID 008,
                              s_werks FOR vbap-werks MODIF ID 010.
SELECTION-SCREEN: END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.
 LOOP AT SCREEN .
      IF p_sale = 'X' AND ( screen-group4 = '008' OR screen-group4 = '010').
      screen-active = 1 .
 MODIFY SCREEN .
    ENDIF.
ENDLOOP .

Please help me in restricting the users.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 07, 2010 at 10:26 AM

    Hi,

    You are approaching this the wrong way. SAP delivers a detailed authorisation mechanism to do achieve this requirement in a standard format.

    You should be checking not on the ID but on an authorisation object and appropriate values. The authorisation object & value is then assigned to roles for users who need to access it.

    Do not restrict on the userID name (SAP only does it in very, very limited circumstances), use the role concept to to this.

    Add comment
    10|10000 characters needed characters exceeded