Skip to Content
avatar image
Former Member

screen

i have button in screen

i want : when i click on the button a parameter will appear in the same screen

example:

0 radio butto -


> click

parameter : |___________|

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    May 16, 2006 at 09:17 AM

    Parameters: chk1 RADIOBUTTON group g1 user-command ch,

    chk3 RADIOBUTTON group g1 default 'X',

    chk2(10) type c modif id ID1.

    at selection-screen.

    check sy-ucomm = 'CH'.

    **then

    AT SELECTION-SCREEN output.

    LOOP at SCREEN.

    screen-input = 0.

    IF screen-group1 = 'ID1' .

    if chk1 = 'X'.

    screen-input = 1 .

    ENDIF.

    modify screen.

    endif.

    ENDLOOP.

    or one more...intresting...

    Parameters: rd1 RADIOBUTTON group g1 default 'X' user-command ch,

    rd2 RADIOBUTTON group g1 ,

    kishan(10) type c modif id ID1.

    at selection-screen.

    check sy-ucomm = 'CH'.

    AT SELECTION-SCREEN output.

    LOOP at SCREEN.

    screen-input = 1 .

    IF screen-group1 = 'ID1' .

    if rd1 = 'X'.

    clear screen.

    ENDIF.

    modify screen.

    endif.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rani,

      try this code..

      selection-screen begin of block abc with frame title text-001.
      parameters:
                p_pc radiobutton group gp1 user-command 'X', "Desktop option
                p_app  radiobutton group gp1 default 'X'.   "App Server option
      parameters:
                p_file  like rlgrap-filename.  "file name
      selection-screen end of block abc.
      at selection-screen output.
        if p_pc eq 'X'.
          loop at screen.
            if screen-name eq 'P_FILE'.
              screen-input = 1.
              screen-active = 1.
              modify screen.
            endif.
            if screen-name eq '%_P_FILE_%_APP_%-TEXT'.
              screen-active = 1.
              modify screen.
            endif.
          endloop.
        else.
          loop at screen.
            if screen-name eq 'P_FILE'.
              screen-input = 0.
              screen-active = 0.
              modify screen.
            endif.
            if screen-name eq '%_P_FILE_%_APP_%-TEXT'.
              screen-active = 0.
              modify screen.
            endif.
          endloop.
        endif.
      

      Regards,

      Suresh Datti

  • avatar image
    Former Member
    May 16, 2006 at 09:19 AM

    see the code

    <b>TABLES SSCRFIELDS.

    ...

    SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.

    ...

    INITIALIZATION.

    MOVE 'My text' TO CHARLY.

    ...

    AT SELECTION-SCREEN.

    IF SSCRFIELDS-UCOMM = 'ABCD'.

    ...

    ENDIF.</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2006 at 09:25 AM
    REPORT  Z_50657_SALES MESSAGE-ID ZZ LINE-SIZE 1000 LINE-COUNT 60.
    
    *Selection Screen 1
    
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    
    PARAMETERS : P_FILE(25) TYPE C,
                 O_FILE(25) TYPE C.
    
    SELECTION-SCREEN END OF BLOCK B1.
    
    *Selection Screen 2
    
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    
    PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
                SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
    
    SELECTION-SCREEN END OF BLOCK B2.
    
    *Selection Screen 3
    
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
    
    PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
                UPDATE DEFAULT 'X' MODIF ID BL1.
    
    SELECTION-SCREEN END OF BLOCK B3.
    
    *Selection Screen 4
    
    SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
    
    
    PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
                KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
                LOC_DATE TYPE SY-DATUM MODIF ID BL2,
                USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
    
    SELECTION-SCREEN END OF BLOCK B4.
    
    ************************************************************************
    *                     At  Selection-Screen Output                      *
    ************************************************************************
    
    AT SELECTION-SCREEN OUTPUT.
    
    
      IF CAL_TRA = 'X'.
        LOOP AT SCREEN.
    
          IF SCREEN-GROUP1 = 'BL1'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
    
          IF SCREEN-GROUP1 = 'BL2'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    
      IF SESSION = 'X'.
    
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'BL1'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
    
          IF SCREEN-GROUP1 = 'BL2'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
    
          MODIFY SCREEN.
    
        ENDLOOP.
      ENDIF.

    <b>

    Copy and paste the above code and check the functionality, it hides the parameters and makes them visible based on the selection of radio button</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2006 at 09:34 AM

    HI

    GOOD

    HERE YOU HAVE NOT PROPERLY MENTIONED YOUR REQUIREMENT PROPERLY,

    WHEATHER YOU WANT TO GENERATE ANY ACTION USING THE BUTTON

    you can try this

    tables sscrfields. "Fields on selection screens

    selection-screen function key 1. "button on the application toolbar

    initialization.

    • Populating button text

    move 'my_button' to sscrfields-functxt_01.

    at selection-screen.

    if sscrfields-ucomm = 'FC01'.

    perform f_my_button.

    thanks

    mrutyun

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2006 at 09:42 AM

    hi Rani,

    i am not clear what exactly u want ; do u want to make the field invisible / visible.

    then use ACTIVE = O. instead of INPUT = 0.

    code as follows

    u have to use modif id with the parameter which u have to hide then use this code.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF <Condition>

    IF screen-group1 = 'ABC'.

    screen-active = '0'.

    MODIFY SCREEN.

    ENDIF.

    ENDIF.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2006 at 10:11 AM

    Hi Rani,

    This user command action will only work on radio buttons and check boxes. Which means if we select any thing then immediately change will appear in the same screen. Here I am providing the sample code which uses radio button user command action.

    plz reward points , if it is helpful

    REPORT ZSUMA_TEST .
    DATA: LV_FILE_PATH(20) TYPE C.
    DATA: LV_MASK(20) TYPE C VALUE ',*.XLS ,*.XLS. '.
    
    
    *-- Macro to put radiobutton on selection screen
    *-- &1 - radiobutton parameter name
    *-- &2 - text element (description)
    *-- &3 - radiobutton group
    
    SELECTION-SCREEN BEGIN OF BLOCK A0 WITH FRAME TITLE T000.
    
    PARAMETERS: RB_1 RADIOBUTTON GROUP RC USER-COMMAND RAD DEFAULT 'X'.
    
    SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE T001.
    PARAMETERS: P_FILE1 LIKE T390D-DBNAME MODIF ID XYZ. "
    SELECTION-SCREEN END OF BLOCK A1.
    PARAMETERS: RB_2 RADIOBUTTON GROUP RC.
    
    SELECTION-SCREEN END OF BLOCK A0.
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE1.
    
    CALL FUNCTION 'WS_QUERY'
    EXPORTING
    QUERY = 'CD' "// Current Directory
    IMPORTING
    RETURN = LV_FILE_PATH.
    
    
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    DEF_FILENAME = 'TA_DOWNLOAD.MDB'
    DEF_PATH = LV_FILE_PATH
    MASK = LV_MASK
    MODE = 'O'
    IMPORTING
    FILENAME = P_FILE1
    EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5.
    
    AT SELECTION-SCREEN OUTPUT.
    BREAK-POINT.
    LOOP AT SCREEN.
    IF RB_2 = 'X'.
    IF SCREEN-GROUP1 = 'XYZ'.
    SCREEN-INPUT = '0'.
    * SCREEN-INVISIBLE = '1'.
    MODIFY SCREEN.
    ENDIF.
    ENDIF.
    ENDLOOP.

    Thanks,

    Suma.

    Add comment
    10|10000 characters needed characters exceeded