Tuesday, July 31, 2007

Tabstrip in selection screen

To define a tabstrip area with tab pages in selection screen, use the following statements in your selection screen definition:


SELECTION-SCREEN: BEGIN OF TABBED BLOCK FOR LINES,
TAB () USER-COMMAND
[DEFAULT [PROGRAM ] SCREEN ],
TAB () USER-COMMAND
[DEFAULT [PROGRAM ] SCREEN ],
...
END OF BLOCK .


This defines a tabstrip control with size . The tab pages , ... are assigned to the tab area. defines the width of the tab title. You must assign a function code area to each tab title.

For each tab title, the system automatically creates a character field in the ABAP program with the same name. In ititialization, you can assign a text to the field. This then appears as the title of the corresponding tab page on the selection screen.

You must assign a subscreen to each tab title. This will be displayed in the tab area when the user chooses that title. You can assign one of the following as a subscreen:



1. A subscreen screen defined using the Screen Painter.
The dialog modules containing its flow logic must be defined in the current ABAP program.

2. A selection screen subscreen, defined in an ABAP program.
User actions will trigger the AT SELECTION-SCREEN event at least twice – firstly for the "included" selection screen (we can use it for validation), then for the selection screen on which it appears.

This is simple program with three tab title.
Tab1 demonstrating input validation.
Don't forget to create subscreen 0300 for Tab3.

REPORT ZAALGAL0007.
*http://abap-gallery.blogspot.com

TABLES: sscrfields.

* SUBSCREEN 1 For Tabstrip BUTTON1

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
p2(10) TYPE c,
p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 100.

* SUBSCREEN 2 For Tabstrip BUTTON2

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: q1(10) TYPE c OBLIGATORY,
q2(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 200.

* Go to tcode SE51 Create screen no 0300
* with screen type = subscreen

* STANDARD SELECTION SCREEN

PARAMETERS: h1(10) TYPE c.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
TAB (20) button1 USER-COMMAND push1
DEFAULT SCREEN 100,
TAB (20) button2 USER-COMMAND push2
DEFAULT SCREEN 200,
TAB (20) button3 USER-COMMAND push3
DEFAULT SCREEN 300,
END OF BLOCK mytab.

INITIALIZATION.
button1 = 'This is sel-screen 100'.
button2 = 'This is sel-screen 200'.
button3 = 'This is screen 300'.
mytab-prog = sy-repid.
mytab-dynnr = 100.
mytab-activetab = 'BUTTON1'.

AT SELECTION-SCREEN.
CASE sy-dynnr.
WHEN 1000.
WHEN 100.
IF p1 IS INITIAL.
sscrfields-ucomm = 'PUSH1'.
MESSAGE I888(sabapdocu) WITH 'Make an entry in P1'.
ENDIF.
WHEN 200.
MESSAGE s888(sabapdocu) WITH 'Validation on' sy-dynnr.
ENDCASE.


START-OF-SELECTION.
WRITE: / 'P1:', p1,'Q1:', q1,
/ 'P2:', p2,'Q2:', q2,
/ 'P3:', p3.

4 comments:

Shakun said...

this information is not enough

Ray Mannion said...

It's great to see an actual EXPLANATION rather than just the code. Thanks for providing this post. I was stuck because I was clearing SSCRFIELDS-UCOMM in my AT SELECTION-SCREEN and your post helped me see that mistake.

Unknown said...

Exquisitely professional thoughts. I merely hit upon this web site and http://www.iessaywriting.net/desired to enunciate that I've definitely delighted in reckoning your blog articles or blog posts. Rest assured I'll subsist pledging to your RSS and I wish you write-up after much more shortly

Unknown said...

Thanks for telling us about writing services and many people wanted to purchase papers and many other writing services this information will help them.
http://www.helpinpapers.com/do-attentively-my-pending-coursework