SAP ABAP - Sample Program To Demonstrate Tabstrips & Subscreens In Selection Screen.

This sample report program explains the use of tabstrips and subscreen in main selection screen.

*& Use of TabStrip and SubScreen explained
*& ---- The report shows the material on one tab
*& and plant on one tab.Pressing the execute button will show
*& the description of the material or plant as the case is.
*& TEXT-002 = Material Number
*& TEXT-003 = Plant Number.


REPORT zjal_tabstrip_selscr NO STANDARD PAGE HEADING LINE-SIZE 80 LINE-COUNT 60.
TABLES : sscrfields.
DATA activetab(6) TYPE c .
DATA: mat_des TYPE makt-maktx,
pl_des TYPE t001w-name1 .

SELECTION-SCREEN BEGIN OF SCREEN 001 AS SUBSCREEN NO INTERVALS.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-002 FOR FIELD matnr.
PARAMETERS matnr TYPE mara-matnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN END OF SCREEN 001.

SELECTION-SCREEN BEGIN OF SCREEN 002 AS SUBSCREEN NO INTERVALS.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 14(18) text-003 FOR FIELD matnr.
PARAMETERS werks TYPE t001w-werks.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK block2.
SELECTION-SCREEN END OF SCREEN 002.

SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 5 LINES NO INTERVALS.
SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1
DEFAULT SCREEN 001.
SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2.
SELECTION-SCREEN END OF BLOCK tabb1.

INITIALIZATION.
tabs1 = text-002.
tabs2 = text-003.
activetab = 'TABS1'.

AT SELECTION-SCREEN .

CASE sscrfields-ucomm.

WHEN 'UCOMM1'.
tabb1-prog = sy-repid.
tabb1-dynnr = 001.
tabb1-activetab = 'TABS1'.
activetab = 'TABS1' .

WHEN 'UCOMM2'.
tabb1-prog = sy-repid.
tabb1-dynnr = 002.
tabb1-activetab = 'TABS2'.
activetab = 'TABS2'.

ENDCASE.

START-OF-SELECTION.

CASE activetab.

WHEN 'TABS1'.
SELECT SINGLE maktx
FROM makt
INTO mat_des
WHERE matnr = matnr.

WRITE: 'Material ' , matnr , mat_des .

WHEN 'TABS2'.
SELECT SINGLE name1
FROM t001w
INTO pl_des
WHERE werks = werks.

WRITE: 'Plant ' , werks ,pl_des.
ENDCASE.


OUTPUT SCREEN:




MORE PROGRAMS ON REPORT PROGRAMMING:

- Setting Default Values In Selection Screen.

- Programming On Buttons In A Screen.

- Create A Screen With Two TABSTRIPS For A Report Program.

- On Using HOTSPOT Keyword In A Report Program.

- Fetch Company Code Of All The Vendors.

- ...Back To Index On Report Programming.


Your suggestions and comments are welcome in this section.

Please mail all your contributions to administrator@abapmadeeasy.com We request you to mention your Name, Designation, Experience & Organization you are working for. Your posts will be verified and posted in this site with your name.

No comments:

Post a Comment