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

Tabstrip

Former Member
0 Likes
870

How do I not allow the user to go to my other tabs of my tabstrip when the field of my first tab (IO_NAME) is not entered upon clicking the 'Save' button?

Codes examples is needed for me to understand better.

9 REPLIES 9
Read only

Vijay
Active Contributor
0 Likes
853

hi

just make the fields which u want to be filled before shift another screen as mandatory.

this will solve ur problem

regards

vijay

reward points if helpful

Read only

Former Member
0 Likes
853

Hi,

In PBO,

Check if any field is initial..

if yes set a flag...

check that flage in PBO of sub screen...

if set SHOW A ERROR MSG..

Call back the default sub screen.

Reward if helpful,

Gaurav J.

Read only

0 Likes
853

Anyone have codes to show me?

Read only

0 Likes
853

Hi,

check this

process before output.

module status_0100.

module tabstrp_active_tab_set.

call subscreen subscreen

including g_tabstrp-prog g_tabstrp-subscreen.

process after input.

call subscreen subscreen.

module tabstrp_active_tab_get.

module user_command_0100.

CODE:----


program z11gauravprogram35 .

controls : tabstrp type tabstrip.

data : ok_code(4).

data: rd1 type c value 'X'.

data: rd2 type c.

data: temp type c.

data: begin of g_tabstrp,

subscreen like sy-dynnr,

prog like sy-repid value 'Z11GAURAVPROGRAM35',

pressed_tab like sy-ucomm value 'TAB1',

end of g_tabstrp.

data: flag type c.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module status_0100 output.

set pf-status 'MAIN'.

set titlebar 'MAIN'.

case sy-ucomm.

when 'TAB1'.

if flag = '1'.

set titlebar 'TAB1'.

endif.

when 'TAB2'.

if flag = '1'.

set titlebar 'TAB2'.

endif.

endcase.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module user_command_0100 input.

if sy-ucomm = 'EXT'.

leave program.

endif.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Module TABSTRP_ACTIVE_TAB_SET OUTPUT

&----


  • text

----


module tabstrp_active_tab_set output.

tabstrp-activetab = g_tabstrp-pressed_tab.

case g_tabstrp-pressed_tab.

when 'TAB1'.

if rd1 = 'X'.

g_tabstrp-subscreen = '0102'.

elseif rd2 = 'X'.

g_tabstrp-subscreen = '0103'.

endif.

when 'TAB2'.

g_tabstrp-subscreen = '0101'.

endcase.

endmodule. " TABSTRP_ACTIVE_TAB_SET OUTPUT

&----


*& Module TABSTRP_ACTIVE_TAB_GET INPUT

&----


  • text

----


module tabstrp_active_tab_get input.

ok_code = sy-ucomm.

case ok_code.

when 'G1'.

if rd1 = 'X'.

elseif rd2 = 'X'.

endif.

when 'TAB1'.

g_tabstrp-pressed_tab = 'TAB1'.

when 'TAB2'.

g_tabstrp-pressed_tab = 'TAB2'.

endcase.

endmodule. " TABSTRP_ACTIVE_TAB_GET INPUT

&----


*& Module STATUS_0101 OUTPUT

&----


  • text

----


module status_0101 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

flag = '1'.

endmodule. " STATUS_0101 OUTPUT

&----


*& Module USER_COMMAND_0101 INPUT

&----


  • text

----


module user_command_0101 input.

endmodule. " USER_COMMAND_0101 INPUT

Now what I am asking you to do is that make a module in PBO of main screen which contains tab strip.

mark flag if any field is initial...

Check this flag in PBO of SUB screen create of different tab..

pbo is comman to all subscreen...

if marked Exit.

Reward if helpful..

Gaurav J.

Edited by: Gaurav Juneja on Feb 5, 2008 9:02 AM

Read only

Former Member
0 Likes
853

Hi,

The basic concept here is that whenever a user clicks the tab for navigating to the tab strip - it triggers the corresponding okcode attached to the tab strip in propoerties.

Hence what you can do is, in the PAI of the main screen create a module and code as below:


CASE OK_CODE.
*Assuming OK_CODE is the user command defined
WHEN 'TAB2' OR 'TAB3'
*OKCODES for tab 2 and 3 respectively have been clicked
IF IO_NAME IS INITIAL.
*No name entered on tab 1
MESSAGE E002(SY) WITH 'Please enter name before navigating'.
ENDIF.
ENDCASE.

Hence by raising an error message as shown above, you prevent the user from navigating when no name is entered.

Cheers,

Aditya

Read only

0 Likes
853

I created a module at PAI of my screen of my tabstrip with the codes given:


CASE OK_CODE.
*Assuming OK_CODE is the user command defined
WHEN 'TAB2' OR 'TAB3'
*OKCODES for tab 2 and 3 respectively have been clicked
IF IO_NAME IS INITIAL.
*No name entered on tab 1
MESSAGE E002(SY) WITH 'Please enter name before navigating'.
ENDIF.
ENDCASE.

However, this does not seems to work. What should I do?

Read only

0 Likes
853

Hi,

What's the problem? Is there a syntax error ? if not , whats the reaction?

/Aditya

Read only

0 Likes
853

Hello

There is no error but it did not disable the other 2 tabs when my textbox at first tabs in empty.

Read only

0 Likes
853

Hi,

This then sounds like the same query you posted in UI Programming and was resolved.

/Aditya