‎2011 Dec 26 11:05 AM
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.
‎2011 Dec 26 12:45 PM
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
‎2011 Dec 26 12:45 PM
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
‎2011 Dec 26 1:56 PM
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.
‎2011 Dec 26 2:34 PM
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
‎2011 Dec 26 2:39 PM
Hi Aditya,
I have tried the same,but got the same error.
Please advice me ,how to proceed with this.
‎2011 Dec 26 2:48 PM
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
‎2011 Dec 26 3:05 PM
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.
‎2011 Dec 26 3:19 PM
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.
‎2011 Dec 27 9:21 AM
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.
‎2011 Dec 27 9:35 AM
‎2011 Dec 27 9:38 AM
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
‎2011 Dec 27 9:30 AM
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.
‎2011 Dec 27 12:36 PM
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.