Register Login

Change the Input Fields Dynamically in a Screen

Updated May 18, 2018

ABAP Dialog Programming Questions:

How to change the input fields dynamically in a screen which consists of 9 text fields?

Moreover the user must not enter values in some of the input fields where the values are given.

1.If you want to change the input fields on some user input then use 'user-command ac' after the field on which you want the action.
2.Specify the modif id 'xxx' for each screen object.
3.Then in the event 'AT SELECTION-SCREEN ON OUTPUT' loop at screen. check the screen-group1(modif id ) of screen objects and change the status of the object.
4.You can view all the screen attribute from se11.

The following example may help you:

SELECTION-SCREEN BEGIN OF BLOCK 001.
PARAMETERS: P_MRU RADIOBUTTON GROUP SEL DEFAULT 'X' USER-COMMAND AC,
P_PART RADIOBUTTON GROUP SEL.
SELECT-OPTIONS P1 FOR <field> MODIF ID PRT.
SELECT-OPTIONS G1 FOR <field> MODIF ID MRU.
SELECTION-SCREEN END OF BLOCK 001.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_MRU = 'X'.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '1'.
ENDIF.
ELSEIF P_PART = 'X'.
IF SCREEN-GROUP1 = 'MRU'.
SCREEN-INPUT = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'PRT'.
SCREEN-INPUT = '1'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.


Comments

  • 31 Jul 2009 10:16 am Guest
    should be:
    SELECT-OPTIONS P1 FOR MODIF ID PRT.
    SELECT-OPTIONS G1 FOR MODIF ID MRU.

    By Younes
  • 31 Jul 2009 10:18 am Guest
    This Editos ignores '<>'-tags

    correct is:

    SELECT-OPTIONS P1 FOR '[field]' MODIF ID PRT.
    SELECT-OPTIONS G1 FOR '[field]' MODIF ID MRU.

×