- Description: Each tab of the Tab Strip control is attached with a sub screen. When Particular tab is clicked by the user then the appropriate sub screen is called and sits on the sub screen area.
- Step 1. Create a Module Pool program (Type ‘M’ ). Right click on the program name and choose create and click on Screen.
- Step 2. Provide the screen number ‘0001’ and click on the continue button.
- Step 3. Provide a short description and select Normal screen and then click on the Layout Button.
- Step 4. Create an Input field and a Box by selecting appropriate screen elements from the left column.
- Step 5. Now select the tab strip control element as marked in the left column, drag and drop it in the screen.
- Stretch the tab strip according to the height and width. now double click on the control and provide the name as shown below (‘TAB_STRIP’).
- Step 6. By default two tabs are automatically provided by the system. If you need some more tabs then select the push button element and drop it on the tab strip control on the screen. Double click on each tab and provide the tab name , text to be displayed and the F-Code value.
- Step 7. Now select the Sub Screen Area element from the left column as marked, drag and drop it inside the tab strip. Now Double click on the Sub Screen Area and provide the name as ‘SSA’.
- Step 8. Now Double click on each tab and in the ‘REF FIELD’ pass the sub screen area name as shown below.
- Step 9. Now the design of the first screen is over. Lets create four sub screen as we have four tabs in the Tab Strip. Right click on the program name and navigate as per the below shown path to create a screen.
- Step 10. Provide the screen number ‘0002’ and click on the continue button.
- Step 11. Provide a short text and select the Sub Screen radio button and at last click on the Layout tab .
- Step 12. Declare some variables in the program . Click on the top Button marked as red. Provide * in the Table/ Field Name and click on the button ‘Get From Program’. Select some variables as marked and click on the continue button.
- Step 13. Create some text Labels for the Fields as shown Below.
- Step 14. Now create another screen ‘0003’ for second tab. At last click on the Continue button.
- Step 15. Provide the short text and select sub screen radio button and then click on the layout button.
- Step 16. Click on the button marked as red and provide the table name as ‘MARA’ and click on Get from Dictionary button. Select the fields that you want to display and click on the Continue Button.
- Step 17. Set the attribute of each field as Output only by double clicking on each field.
- Step 18. Lets create another screen for the 3rd Tab . Give screen number as ‘0004’ and click on continue button.
- Step 19. Now provide the short text fro the screen and select the Sub Screen radio button and at last click on the Layout Button.
- Step 20. Click on the button marked as red and provide the table name as ‘MAKT’ and click on Get from Dictionary button.Select the fields that you want to display and click on the Continue Button.
- Step 21. Set the property as Output Only fro each field.
- Step 22. Lets create the final screen for the 4th tab. Provide the screen Number ‘0005’ and click on the continue button.
- Step 23. Now provide the short text for the screen and select the Sub Screen radio button and at last click on the Layout Button.
- Step 24.Click on the button marked as red and provide the table name as ‘MARC’ and click on Get from Dictionary button.Select the fields that you want to display and click on the Continue Button.
- Step 25.Set the property as Output Only fro each field.
- Step 26. The main screen with four tabs in the tab strip and four sub screen design is ready. Flow Logic of screen ‘0001’. Define the modules in PBO and PAI in the main program by double clicking on the Module name in the flow logic.
TABLES : MARA , MARC , MAKT.
DATA : P_MATNR TYPE MARA-MATNR.
DATA : USER TYPE SY-UNAME,
C_DATE TYPE D,
C_TIME TYPE D.
DATA : P_MATNR TYPE MARA-MATNR.
DATA : USER TYPE SY-UNAME,
C_DATE TYPE D,
C_TIME TYPE D.
CONTROLS : TAB_STRP TYPE TABSTRIP.
DATA : SSN TYPE SY-DYNNR VALUE '0002'.
DATA : FLAG TYPE C.
DATA : FLAG TYPE C.
- Screen 01 output module.
module STATUS_0001 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
IF FLAG IS INITIAL.
USER = SY-UNAME .
C_DATE = SY-DATUM.
* C_TIME = SY-UZEIT.
FLAG = 'X'.
ENDIF.
endmodule. " STATUS_0001 OUTPUT
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
IF FLAG IS INITIAL.
USER = SY-UNAME .
C_DATE = SY-DATUM.
* C_TIME = SY-UZEIT.
FLAG = 'X'.
ENDIF.
endmodule. " STATUS_0001 OUTPUT
- Screen 01 Input Module.
module USER_COMMAND_0001 input.
CASE SY-UCOMM.
WHEN 'ATTR'.
TAB_STRP-ACTIVETAB = 'ATTR'.
USER = SY-UNAME .
C_DATE = SY-DATUM.
* C_TIME = SY-UZEIT.
*
SSN = '0002'.
WHEN 'DISP1'.
TAB_STRP-ACTIVETAB = 'DISP1'.
SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.
SSN = '0003'.
WHEN 'DISP2'.
TAB_STRP-ACTIVETAB = 'DISP2'.
SELECT SINGLE * FROM MAKT WHERE MATNR = P_MATNR.
SSN = '0004'.
WHEN 'DISP3'.
TAB_STRP-ACTIVETAB = 'DISP3'.
SELECT SINGLE * FROM MARC WHERE MATNR = P_MATNR.
SSN = '0005'.
ENDCASE.
endmodule. " USER_COMMAND_0001 INPUT
CASE SY-UCOMM.
WHEN 'ATTR'.
TAB_STRP-ACTIVETAB = 'ATTR'.
USER = SY-UNAME .
C_DATE = SY-DATUM.
* C_TIME = SY-UZEIT.
*
SSN = '0002'.
WHEN 'DISP1'.
TAB_STRP-ACTIVETAB = 'DISP1'.
SELECT SINGLE * FROM MARA WHERE MATNR = P_MATNR.
SSN = '0003'.
WHEN 'DISP2'.
TAB_STRP-ACTIVETAB = 'DISP2'.
SELECT SINGLE * FROM MAKT WHERE MATNR = P_MATNR.
SSN = '0004'.
WHEN 'DISP3'.
TAB_STRP-ACTIVETAB = 'DISP3'.
SELECT SINGLE * FROM MARC WHERE MATNR = P_MATNR.
SSN = '0005'.
ENDCASE.
endmodule. " USER_COMMAND_0001 INPUT
- Step 32.Create a T-Code for the Program and run it.
Thanks for sharing this Information. SAP Web Dynpro Course in Gurgaon
ReplyDelete