Skip to Content
author's profile photo Former Member
Former Member

How to hide selection paramere when access via transaction code

Hi All experts,

I am writing ABAP report which has two radio button on selection screen.

REPORT

UPDATE

Now I have created transaction code(ZITEMSOURCE) for the same program. But I would like to

hide or disable UPDATE radiobutton whenever user will use transaction code.

How can I do this?

  • Data Selection options

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-h01.

SELECT-OPTIONS: s_matnr FOR eord-matnr, "Material

s_werk FOR eord-werk , "Plant

SELECTION-SCREEN END OF BLOCK b1.

***Report/update mode

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-h05.

PARAMETERS: r_report RADIOBUTTON GROUP gp1 DEFAULT 'X',

r_update RADIOBUTTON GROUP gp1.

SELECTION-SCREEN END OF BLOCK b2.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on May 22, 2009 at 04:46 PM

    Hi,

    Place Your Code :

    * Data Selection options
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-h01.
    SELECT-OPTIONS: s_matnr FOR eord-matnr, "Material
    s_werk FOR eord-werk , "Plant
    SELECTION-SCREEN END OF BLOCK b1.
    
    ***Report/update mode
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-h05.
    PARAMETERS: r_report RADIOBUTTON GROUP gp1 DEFAULT 'X',
    r_update RADIOBUTTON GROUP gp1.
    SELECTION-SCREEN END OF BLOCK b2.

    Then:

    AT SELECTION-SCREEN OUTPUT.
       Loop at screen.
         IF Screen-name = 'R_UPDATE'.
             Screen-visible = 0.
             Modify Screen.
         Endif.
       Endloop.

    Regards,

    Ramani N

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2009 at 03:49 AM

    Hi Yogesh,

    Use the below code.

    SELECTION-SCREEN BEGIN OF BLOCK b2.

    PARAMETERS: r_report RADIOBUTTON GROUP rad1 DEFAULT 'X',

    r_update RADIOBUTTON GROUP rad1.

    SELECTION-SCREEN END OF BLOCK b2.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    • Create tcode ex ZTCODE

    IF sy-tcode = 'ZTCODE'.

    IF screen-name = 'R_UPDATE'.

    screen-invisible = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDIF.

    ENDLOOP.

    Regards,

    Kumar Bandanadham

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 22, 2009 at 05:25 PM

    Hi,

    You can use the NO-DISPLAY option while declaring the radio button.

    Regards,

    Ankur Parab

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 05:38 PM

    Hi Yogesh,

    You can try this following piece of code which will help you to enable and disable the desired buttons on the screens.

    Normal Data Declarations

    • Data Selection options

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-h01.

    SELECT-OPTIONS: s_matnr FOR eord-matnr, "Material

    s_werk FOR eord-werk , "Plant

    SELECTION-SCREEN END OF BLOCK b1.

    ***Report/update mode

    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-h05.

    PARAMETERS: r_report RADIOBUTTON GROUP gp1 DEFAULT 'X',

    r_update RADIOBUTTON GROUP gp1.

    SELECTION-SCREEN END OF BLOCK b2.

    • At Selection Screen Event

    AT SELECTION-SCREEN OUTPUT.

    Loop at Screen.

    if r_report = 'X'.

    if screen-name = 'r_update'.

    screen-invisible = 1.

    modify screen.

    endif.

    endif.

    Endloop.

    Hope this will help.

    Thanks,

    Samantak.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 23, 2009 at 04:18 AM

    Hi Yogesh,

    Frist u create a new role which user authority in Update radio button. or

    Create a new table user authority in Update radio button.

    I attach the Code in Use role wise.:-

    TABLES:EORD.
    
    DATA: L_RETURN TYPE SYSUBRC.
    
    * Data Selection options
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
    SELECT-OPTIONS: S_MATNR FOR EORD-MATNR, "Material
                    S_WERK FOR  EORD-WERKS. "Plant
    SELECTION-SCREEN END OF BLOCK B1.
    
    ***Report/update mode
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-H05.
    PARAMETERS: R_REPORT RADIOBUTTON GROUP GP1 DEFAULT 'X',
    R_UPDATE RADIOBUTTON GROUP GP1.
    SELECTION-SCREEN END OF BLOCK B2.
    
    AT SELECTION-SCREEN OUTPUT.
      IF L_RETURN NE 1.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'R_UPDATE'.
            SCREEN-INVISIBLE = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    
    INITIALIZATION.
      PERFORM F_CHECK_AUTHORITY CHANGING L_RETURN.  "Authority check 
    *&---------------------------------------------------------------------*
    *&      Form  F_CHECK_AUTHORITY
    *&---------------------------------------------------------------------*
    FORM F_CHECK_AUTHORITY  CHANGING L_RETURN TYPE SYSUBRC.
    
      DATA: T_ROLE_USERS TYPE STR_AGRS OCCURS 0 WITH HEADER LINE.
    
      L_RETURN = 0.
    
    * Get all users attached to the role of ESS & MSS
      REFRESH T_ROLE_USERS.
      CALL FUNCTION 'ESS_USERS_OF_ROLE_GET'
        EXPORTING
          ROLE       = 'yyyy'  " Create a new role Which user authority in Update radio button.
        TABLES
          ROLE_USERS = T_ROLE_USERS.
    
      READ TABLE T_ROLE_USERS WITH KEY UNAME = SY-UNAME.
      IF SY-SUBRC = 0.
        L_RETURN = '1'.
      ENDIF.
    ENDFORM.                    " F_CHECK_AUTHORITY
    

    Thanks & Regards,

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.