Common used of Dialog Screen for Display, Change, Delete

It is not required of you to create and maintain different dialog screen for each screen functions for Create, Change, Delete and Dispaly.  You can shared the used of a single Dialog Screen and used the MODIFY SCREEN to make the Field to be modify or not.  Modifications and maintenance will be easier when user request you to change any screen layout.

PROCESS BEFORE OUTPUT.
  MODULE 0250_STATUS.
  LOOP.
      MODULE STATUS_0120.
  ENDLOOP.

  LOOP.
      MODULE STATUS_0110.
  ENDLOOP.

  LOOP.
      MODULE STATUS_0100.
  ENDLOOP.
*
PROCESS AFTER INPUT.
  MODULE REFRESH_0250.
  LOOP.
       MODULE USER_COMMAND_0120.
  ENDLOOP.

  LOOP.
       MODULE USER_COMMAND_0110.
  ENDLOOP.

* For example, if the user enter the Delete Screen, you will make all the Fields non-Editable.
*?---------------------------------------------------------------------*
*?      Module  0250_STATUS  OUTPUT
*?---------------------------------------------------------------------*
*       text                                                           *
*----------------------------------------------------------------------*
MODULE 0250_STATUS OUTPUT.
SET PF-STATUS 'Z250'.
SET TITLEBAR 'Z250'.
IF OKSAVE = 'DEL'.
* Make the SAVE Menu button inactive
   SET PF-STATUS 'Z250' EXCLUDING 'SAVE'.

* Make all the Fields non-Editable
   LOOP AT SCREEN.
       SCREEN-INPUT = 0.
       MODIFY SCREEN.
   ENDLOOP.
ENDIF.

*  For example, if the user enter the Modify Screen, you will make all the Fields Group 1 that 
*  have a 'M' non-Editable.
*  You specify the 'M' for Group 1 using the Screen Painter Attribute
IF OKSAVE = 'MOD'.
*  Make the DELE Menu button inactive
   SET PF-STATUS 'Z250' EXCLUDING 'DELE'.

*  Make all the Fields Groups 'M' non-Editable
   LOOP AT SCREEN.
       check screen-group1 = 'M'.
       SCREEN-INPUT = 0.
       MODIFY SCREEN.
   ENDLOOP.
ENDIF.
CLEAR OKCODE.
ENDMODULE. 

More ABAP Tips

Main Index
SAP ERP Modules, Basis, ABAP and Other IMG Stuff

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.