Sub Screen in Module Pool Program


Description: Sub screens normally used to do all the task in a single screen without navigating to other screens. Sub Screen normally used in the main screen. The main screen declares a dedicated sub screen area

in its screen where sub screen is called and displayed in the run time. The sub screen area declared in the main screen can not be left blank. There are no user command in the sub screen.User commands can be only declared in the main screen containing the sub screen.

Step 1. Lets create a module pool program (Type – M). Right click on the Program name and select Create and then click on the screen .

Step 2.Provide the screen number ‘0001’ and then click on the Tick button to Continue.

Step 3. Provide the description and select the normal screen and then click on the Layout Button to design the screen in the  screen painter(SE51).

Step 4. Create two input fields and two Push buttons with fcode ‘SHOW1’ and ‘SHOW2’ as shown below.

Step 5.Select the sub screen element from the left column as marked. Drag it on the screen as per required width and height. Double click on the SUB SCREEN AREA element and provide the name as ‘SSA’.

Step 6. Now the first screen is ready with input fields and different buttons with sub screen area. Let’s create three sub screens : first one is just a sub screen which is called only once when the program is called as the main screen contains a sub screen area which can not be left blank. Second sub screen is called when clicked on the ‘SPFLI’ button and third sub screen is called when clicked on the ‘SFLIGHT’ button.

Step 7. Provide the screen number and click on the continue button.

Step 8.  Provide short text, select the sub screen radio button and at last click on the Layout button.

Step 9. Just create a text field  in the sub screen ‘0002’.

Step 10. Create another sub screen ‘0003’. Provide short text and click on the  Layout tab.

Step 11. Select some fields from the SPFLI table and select the attribute Output Only fro each field.

Add caption

Step 12.Lets create the final sub screen ‘0004’ for the SFLIGHT data display. Provide the short text, select the Sub Screen radio button and then click on the  Layout tab.

Step 13. Click on the Top Red button , Provide the table name as ‘SFLIGHT’ and then click on Get from Dictionary button. Select some fields that you want to display and at last click on the Continue Button.

Step 14. Set the attribute ‘Output only’ of all the fields.

Step 15. One main Screen and three sub screens are designed .Flow Logic of screen ‘0001’.

Step 16. .Flow Logic of screen ‘0002’.

Step 17. .Flow Logic of screen ‘0003’.

Step 18. .Flow Logic of screen ‘0004’.

Step 19. Define all the modules  in the flow logic of screens.

Step 20. Create T-Code for the program and run it. The sub screen area ‘SSA’ defined in the main screen is filled with the default sub screen ‘0002’.

 

Step 21. Provide some input and click on ‘Spfli’ button.

Step 22. Based on the input, a record is selected from the SPFLI table and it is displayed in the sub screen ‘0003’ which is placed in the sub screen area ‘SSA’ of the main screen ‘0001’.

Step 23. Change the input and click on the Sfflight Button.

Step 24. Now sflight data is displayed in the subscreen ‘0004’ which is placed in the sub screen area ‘SSA’ of the main screen ‘0001’.


 

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s