Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Tab Initialization on selection screen.

Former Member
0 Likes
489

Hi,

i have one selection screen with tabbular format and i want to make restriction for users like if they have passed data on first tab then they can not use second tab or vice-versa. can we do this in tabbular format and how to put check on that please provide sample code if you have.

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
396

Hi,

Check this example..

TABLES: sscrfields.

SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 14 LINES.

SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1

DEFAULT SCREEN 12.

SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2

DEFAULT SCREEN 2000.

SELECTION-SCREEN END OF BLOCK tabb1.

INITIALIZATION.

tabs1 = 'Tab1'.

tabs2 = 'Tab2'.

SELECTION-SCREEN BEGIN OF SCREEN 12 AS SUBSCREEN.

PARAMETERS par1 LIKE spfli-carrid.

SELECTION-SCREEN END OF SCREEN 12.

SELECTION-SCREEN BEGIN OF SCREEN 2000 AS SUBSCREEN.

SELECT-OPTIONS sel1 FOR sy-subrc.

SELECTION-SCREEN END OF SCREEN 2000.

AT SELECTION-SCREEN .

CASE sscrfields-ucomm.

WHEN 'UCOMM1'.

  • Check if there is anything given on that screen.

IF NOT sel1[] IS INITIAL.

MESSAGE e208(00) WITH 'you cannot go to other tab'.

ENDIF.

WHEN 'UCOMM2'.

  • Check if there is anything given on that screen.

IF NOT par1 IS INITIAL.

MESSAGE e208(00) WITH 'you cannot go to other tab'.

ENDIF.

ENDCASE.

START-OF-SELECTION.

WRITE: / 'Sucessful'.

Thanks,

Naren

1 REPLY 1
Read only

Former Member
0 Likes
397

Hi,

Check this example..

TABLES: sscrfields.

SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 14 LINES.

SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1

DEFAULT SCREEN 12.

SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2

DEFAULT SCREEN 2000.

SELECTION-SCREEN END OF BLOCK tabb1.

INITIALIZATION.

tabs1 = 'Tab1'.

tabs2 = 'Tab2'.

SELECTION-SCREEN BEGIN OF SCREEN 12 AS SUBSCREEN.

PARAMETERS par1 LIKE spfli-carrid.

SELECTION-SCREEN END OF SCREEN 12.

SELECTION-SCREEN BEGIN OF SCREEN 2000 AS SUBSCREEN.

SELECT-OPTIONS sel1 FOR sy-subrc.

SELECTION-SCREEN END OF SCREEN 2000.

AT SELECTION-SCREEN .

CASE sscrfields-ucomm.

WHEN 'UCOMM1'.

  • Check if there is anything given on that screen.

IF NOT sel1[] IS INITIAL.

MESSAGE e208(00) WITH 'you cannot go to other tab'.

ENDIF.

WHEN 'UCOMM2'.

  • Check if there is anything given on that screen.

IF NOT par1 IS INITIAL.

MESSAGE e208(00) WITH 'you cannot go to other tab'.

ENDIF.

ENDCASE.

START-OF-SELECTION.

WRITE: / 'Sucessful'.

Thanks,

Naren