Change the Input Fields Dynamically in a Screen

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.

With Compliment: Piyusha Kirwai

Fast Links:
Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

ABAP Tips
ABAP Forum for Discussion and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.