Monday, 21 August 2017

Modal Dialog Box (Pop Up Screen)


  • Description : Modal Dialog Box is a Pop up window which is displayed on the top of the screen.
  • When calling this type of screen we have to specify the co-ordinates of the (Top-Left) corner and (Bottom-Right) corner so that the system calculates the Height and width of the screen.

  • Step 1. Create a Module pool Program (Type ‘M’ ). Right click on the Program Name, Go to Create and click on the Screen.
  • Step 2. Provide the screen Number ‘0001’ and click on the Continue Button.

  • Step 3.Provide the short description , select normal screen and then click on the Layout tab.
  • Step 4. Design the screen by creating  input fields and a push button with Function-Code.
  • Step 5. Create another screen as shown below.
  • Step 6. Provide the screen number ‘0002’ and click on the continue button
  • Step 7. Provide the short text, select the Modal Dialog ox Radio Button and click on the Layout tab.
  • Step 8. Click on the top button marked as ‘RED’. Provide the table name as ‘VBRP’ and click on the Get from dictionary button. Select some fields that you want to display and click on the continue button.
  • Step 9. Select each field and set the attribute as Output Only.
  • Step 10.Flow logic of the normal screen  ‘0001’. Define the module in the main program.
  • Step 11. Flow logic of the screen ‘0002’. Define the modules in the PBO and PAI.
  • Step 12. Provide some codes in the Modules as shown below.
  • Top Include.
TABLES : VBRP.

DATA : P_VBELN TYPE VBRP-VBELN,
       P_POSNR TYPE VBRP-POSNR. 

  • Input Include.

module USER_COMMAND_0001 input.




  CASE SY-UCOMM.
    WHEN 'DISP'.

      SELECT SINGLE * FROM VBRP WHERE VBELN = P_VBELN AND POSNR = P_POSNR.
       CALL SCREEN 0002 STARTING AT 10 08 " TOP LEFT CORNER CO-ORDINATE
                         ENDING AT  70 15 . " BOTTOM right CORNER CO-ORDINATE

  ENDCASE.


endmodule.                 " USER_COMMAND_0001  INPUT
*&      Module  USER_COMMAND_0002  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0002 input.

  CASE SY-UCOMM .
    WHEN 'ENTR' OR 'CANC'.

      LEAVE TO SCREEN 0.
  ENDCASE.



endmodule.                 " USER_COMMAND_0002  INPUT
*&---------------------------------------------------------------------* 
  • Output include.

module STATUS_0002 output.
 SET PF-STATUS 'STAT'.
*  SET TITLEBAR 'xxx'.

endmodule.                 " STATUS_0002  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  STATUS_0001  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module STATUS_0001 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.                 " STATUS_0001  OUTPUT
  • Step 14. Provide the short text and select the Dialog Box radio button and click on Continue button.
  • Step 15. Expand the  Function Keys and maintain F-codes as ‘CANCEL’ and  ‘ENTER’ as marked.
  • Step 16. Expand the Application Tool bar as shown and provide the F-codes and activate it.
  • Step 17. Create a T-Code for the Program

Output 

  • Step 18. Run the Program and provide the Input and click on the ‘DISPLAY’ button.
  • Step 19. Pop-up will appear.



No comments:

Post a Comment