Online Tutorials & Training Materials | STechies.com
Register Login

Dynamically Selection Screen Modification

|| || 3

Dynamically Selection Screen Modification
Stechies

How To Dynamically Change Selection Screen in ABAP?

Hello SAP Experts,

I want to change the selection screen dynamically based up on some condition. I want to disable some fields on the selection screen based on the user selection condition of the radio button. 

How can I achieve this?

By default, one radio button will be selected for that criterion the selection screen has to be displayed initially with some fields in disable mode after that based upon user requirement the selection screen has to change.

Please help me.


Comments

  • 09 Aug 2017 4:10 pm

    Modifying Screens Dynamically

    The screen table

    • Screen is like an internal table with header line
    • Do not need to declare it in your program
    • Cannot use any work area other than its header line to address it

    Some components of screen table

    • Name
    • Input
    • Output
    • Required
    • Intensified
    • Invisible

    Loop at Screen

    • You can modify screen in your ABAP program
    • The only statements that can be used with SCREEN are

    Loop at screen.
    ...
    Modify screen.
    ...
    Endloop.

    No further additions are allowed in the LOOP AT SCREEN statement

    Loop at Screen Contd..

    Example

    Loop at screen.
    IF screen-group1 = 'MOD'.
    IF flag = ' '.
    Screen-input = '0'.
    ELSEIF flag = 'X'.
    Screen-input = '1'.
    ENDIF.
    Modify screen.
    ENDIF.
    Endloop.

     

  • 19 Apr 2012 5:01 am
    Hi Sriram,

    Program:here i am taking small example with Customer no(Kunnr)and MaterialNo(Matnr)


    PARAMETERS : P_KUNNR TYPE KNA1-KUNNR MODIF ID AAA .
    PARAMETERS : P_CNAME TYPE KNA1-NAME1 MODIF ID AAA .
    PARAMETERS : P_LIFNR TYPE LFA1-LIFNR MODIF ID BBB .
    PARAMETERS : P_VNAME TYPE LFA1-NAME1 MODIF ID BBB .
    PARAMETERS : RB_CUST RADIOBUTTON GROUP ABC DEFAULT 'X' USER-COMMAND UCOMM,
    RB_VEND RADIOBUTTON GROUP ABC .


    AT SELECTION-SCREEN OUTPUT .
    IF RB_CUST = 'X' .
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'AAA' .
    SCREEN-INPUT = '1' .
    MODIFY SCREEN .
    ELSEIF SCREEN-GROUP1 = 'BBB' .
    SCREEN-INPUT = '0' .
    MODIFY SCREEN .
    ENDIF .
    ENDLOOP .
    ELSEIF RB_VEND = 'X' .
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'AAA' .
    SCREEN-INPUT = '0' .
    MODIFY SCREEN .
    ELSEIF SCREEN-GROUP1 = 'BBB' .
    SCREEN-INPUT = '1' .
    MODIFY SCREEN .
    ENDIF .
    ENDLOOP .
    ENDIF .

    Regards,
    Sateesh

    Email: sateesh.byd@gmail.com
  • 22 Jun 2012 3:20 am
    thank u @sateesh

Related Articles