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 Control

Former Member
0 Likes
1,426

Hi All,

This is regarding Tabstrip Control.

I am using tabstrip control with 2 screens defined on it.There are some mandatory fields on tab1 and tab2.

So when I am entering for the first time into the Screen and entering data on tab1 and press enter,then the cusror is going to *Mandatory fields on second screen, *it is not stopping at the first tab screen.

Please advise me on how to stop the curson on the first screen after pressing anter.

Thanks in Advance.

Manasa.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,396

Hi Manasa,

Follow this process.

First maintain data type for both tabstrip names in top include.

Create same subarea for both tabs and name it as 'SUB'.

CONTROLS : TAB TYPE TABSTRIP..

Data tab1 type char10,

tab2 type char10,

dynnr type dynnr.

In PBO place the following code.

Place the below code in module tab.

Module tab.

If sy-ucomm = 'TAB1'.

active-tab = 'TAB1'. (tab1 is name of the tab name declared in the top include.

dynnr = '1001'.

elseif sy-ucomm = 'TAb2'.

active-tab = 'TAB2'. (tab2 is name of the tab name declared in the top include.

dynnr = '1002'.

endif.

endmodule.

call subscreen SUBAREA including sy-cprog 'dynnr'.

In PAI.

Call subscreen sub.

Hope this will be helpful.

Regards,

G.Aditya

Edited by: Aditya.G on Dec 26, 2011 6:18 PM

12 REPLIES 12
Read only

Former Member
0 Likes
1,397

Hi Manasa,

Follow this process.

First maintain data type for both tabstrip names in top include.

Create same subarea for both tabs and name it as 'SUB'.

CONTROLS : TAB TYPE TABSTRIP..

Data tab1 type char10,

tab2 type char10,

dynnr type dynnr.

In PBO place the following code.

Place the below code in module tab.

Module tab.

If sy-ucomm = 'TAB1'.

active-tab = 'TAB1'. (tab1 is name of the tab name declared in the top include.

dynnr = '1001'.

elseif sy-ucomm = 'TAb2'.

active-tab = 'TAB2'. (tab2 is name of the tab name declared in the top include.

dynnr = '1002'.

endif.

endmodule.

call subscreen SUBAREA including sy-cprog 'dynnr'.

In PAI.

Call subscreen sub.

Hope this will be helpful.

Regards,

G.Aditya

Edited by: Aditya.G on Dec 26, 2011 6:18 PM

Read only

0 Likes
1,396

Hi Aditya,

I have tried createing subareas and give the same name to both the subareas,bu tit is giving me an error,SUB exists.

Kindly advice me,how to proceed on this.

Read only

0 Likes
1,396

Hi Manasa,

First create a subarea in tab1 and select tab2 and create subarea with same name as you have given to tab1 subarea name and just activate it . If again same error raise, in subarea give the refernce field for both subareas as same and activate it and come back to logic and implement the code which i had given to you.

If again same issue raise means revert me back.

Regards,

G.Aditya

Read only

0 Likes
1,396

Hi Aditya,

I have tried the same,but got the same error.

Please advice me ,how to proceed with this.

Read only

0 Likes
1,396

Hi Manasa,

First create a subarea in tab1 and select on tab2 dont create a subarea there just double click on tab2 you will get tab attributes in that if you find reference field just give the tab1 subarea name in reference field and activate.

Regards,

G.Aditya

Read only

0 Likes
1,396

Hi Aditya,

I din't get the error now.

As the screen area names are same,I am getting the same fields on both the tabs(same layouts).

Regards,

Manasa.

Read only

0 Likes
1,393

Hi Manasa,

Know it won't happen same input fields .Did you create two subscreens with different input fields. Based on the condition it will dispaly that screen .

In PBO.

if sy-ucomm = 'TAB1'.

active-tab = 'TAB1'.

dynnr = '1001'.

elseif sy-ucomm = 'TAB2'.

active-tab = 'TAB2'.

dynnr ='1001'.

endif.

Based on tab selected that subscreen will be activate and call that related subscreen.

Call subscreen sub including sy-cprog dynnr.

In PAI.

call subscreen : sub.

Note : SUB is the subarea name.

Hope with this you can do better.

Read only

0 Likes
1,393

HI Aditya,

I have implemented the same what you have suggested,but there is one problem.

When I was trying to execute the program :

In PBO.

if sy-ucomm = 'TAB1'.

active-tab = 'TAB1'.

dynnr = '1001'.

elseif sy-ucomm = 'TAB2'.

active-tab = 'TAB2'.

dynnr ='1001'.

endif.

There is no sy-ucomm value correspondingly no dynnr value is getting filled and it is going to dump.

Please advice me how to proceed with this.

Regards,

Manasa.

Read only

0 Likes
1,396

Thnaks Aditya..it's working now.....

Read only

0 Likes
1,396

Have you assigned the value to ok code in main screen Element list tab lets name GV_OK_CODE.

If you will click on TAB1.

GV_OK_CODE or SY_UCOMM will have value as TAB1

Set accordingly

Nabheet

Read only

Former Member
0 Likes
1,396

Hai Manasa,

Try this code , you use the wrong syntax in previous code

IF SY-UCOMM = 'FTAB1'. // give fct code of tab1 here

TAB-activetab = 'FTAB1' . // here TAB is the name of the tabstrip

dynnr = '0002'.

ELSEIF SY-UCOMM = 'FTAB2' .

TAB-activetab = 'FTAB2' .

dynnr = '0003'.

ELSE.

TAB-activetab = 'FTAB1'.

dynnr = '0002'.

ENDIF.

Read only

0 Likes
1,396

Hi Ravi..

Everything is working fine.But there is one problem:

IF SY-UCOMM = 'FTAB1'. // give fct code of tab1 here

TAB-activetab = 'FTAB1' . // here TAB is the name of the tabstrip

dynnr = '0002'.

ELSEIF SY-UCOMM = 'FTAB2' .

TAB-activetab = 'FTAB2' .

dynnr = '0003'.

ELSE.

TAB-activetab = 'FTAB1'.

dynnr = '0002'.

ENDIF.

Based on tab selected that subscreen will be activate and call that related subscreen.

Call subscreen sub including sy-cprog dynnr.

In PAI.

*call subscreen : sub.

*Since only one screen area is called for both the tabs, I am missing the code that is there in another screen(0003) at both PBO and PAI screens.Only 002 screen data is called.

Kindly suggest me on how to proceed with this.