2016 Mar 29 6:04 AM
Hi Team,
My Requirement is as detailed below,
We need to add an custom additional Tab in standard transactions. We have done that coorrectly, now we have added a tab strip in the tab.
Our first tab is working fine, but when i try to reach out to my second tab i can see the screen in grayed out mode and i get an error stating "My Function Code is not available". If i come back to the first tab and then try the second tab i cant even see the screen.
I have done the following steps in my module pool programming,
1) Called both the subscreens respectively for each tab.
2) In my PAI event i have wriiten the below code,
CASE sy-ucomm.
WHEN 'NEXT'.
tabstrp-activetab = 'NEXT'.
ENDCASE.
Here NEXT is my function code.
Requesting your help on the same. Also help me in updateing the database fields for the same.
Regards,
Saranaya
2016 Apr 01 7:35 AM
Hi,
Please try the below logic.
Call your sub screen dynamically. Your code must be as below.
PBO
" fill a variable dynamically with screen number like below,
case ok_code.
when "Fcode of tab1".
tabstrip-activetab = "Fcode of tab1"
X = "Subscreen number".
when "Fcode of tab2".
tabstrip-activetab = "Fcode of tab2"
X = "Subscreen number".
when others.
tabstrip-activetab = "Fcode of tab1"
X = "Subscreen number".
end case.
" Now write the code below .
call subscreen "Sub screen name" including sy-repid 'Put a variable here say "X"'
All these logic mentioned above should be in the same order and only in PBO.
Hope this will sort your issue. Do let us know.
2016 Mar 29 6:15 AM
Have you checked whether the reference fields are assigned properly and you sub screen is called right.
2016 Mar 29 6:19 AM
Hi Satish,
yes its all done properly, infact i get to see the tab screen first time but it is grayed out thorwing an error as mentined above and when i come back to first tab and then go the same tab again i get the error.
2016 Mar 29 2:34 PM
Hello,
Follow my example and you will solve your issue. At first, you need to define the first active tab in PBO screen, which contains the tab strip. Then change this data in User-command block of this screen too(whenever user clicks in another tab ). Be careful about the OK_CODE field, I use OK_CODE not sy-ucommn.
PROCESS BEFORE OUTPUT.
MODULE STATUS_9500.
CALL SUBSCREEN SUB1 INCLUDING SY-REPID '9510'.
CALL SUBSCREEN SUB2 INCLUDING SY-REPID '9520'.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9500.
CALL SUBSCREEN SUB1.
CALL SUBSCREEN SUB2.
MODULE STATUS_9500 OUTPUT.
SET PF-STATUS 'STATUS_9500'.
* SET TITLEBAR 'xxx'.
IF TS_LIST-ACTIVETAB IS INITIAL .
TS_LIST-ACTIVETAB = 'TAB1'.
ENDIF.
ENDMODULE.
MODULE USER_COMMAND_9500 INPUT.
G_OKCODE = OK_CODE.
CASE G_OKCODE.
WHEN 'TAB1'. "When user clicks on TAB1 button
TS_LIST-ACTIVETAB = 'TAB1'.
WHEN 'TAB2'. "When user clicks on TAB2 button
TS_LIST-ACTIVETAB = 'TAB2'.
WHEN OTHERS.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " USER_COMMAND_9500 INPUT
Regards,
Than
2016 Mar 29 2:46 PM
If you set up a tabstrib correctly/completely with the screen painter, you don't need to check sy-ucomm. It suffices to set the user command of the tabstrip types as P (local GUI function) (that's the same spot where you can make an user command an exit-command)
Also, make sure you have entered the correct subscreen area and that it is filled with the correct subscreen.
And last, make sure the PAI of the subscreen that contains your tabstrib is called as well.
2016 Mar 29 3:23 PM
Hi,
when you hit TAB1 to tabstrip ie PAI of screen will trigger
which must have
CALL SUBSCREEN <area>. if you are using only one subscreen area
then PBO will trigger,
then maintain the screen no in the syntax dynamically as given below which is supposed to be call the particular screen when a particular tab gets active.
in PBO
CASE activetab.
when 'TAB1'.
<dynnr> = 9001
when 'TAB2'.
<dynnr> = 9002
ENDCASE.
then
CALL SUBSCREEN <area> INCLUDING <DYNNR> sy-repid. << this must called in PBO
thanks!!
2016 Mar 30 8:52 AM
Thanks for all your valuable sugesstions. Let me list down my observations below,
What happening here is i have two tabs say Tab1 and tab2 in the tabstrip.
Initially when i reach to the custome tab i find the tab1 of tabstrip is visible.
Now if i try to reach out to tab2 of tabstrip i can reach without any issue.
Now if i again try to reach to the tab1 of the tabstrip i get an error message stating that
"Function code of tab1 is not available".
When i put a breakpoint in the PBO and checked my breakpoint is not triggered when i try to reach from tab2 to tab1.
Please help me out on this.
2016 Mar 30 9:16 AM
Have you checked in the screen painter if the tabs have been declared correctly? (if not the tab will be shown in red I think). This sounds a lot like there is a missing user command on the first tab..
2016 Mar 30 12:40 PM
Hello,
Don't set the break-point. Please debug as soon as you click in the tab1 again to find where raises the error.
I can't understand why your break-point is not triggered. Because each PBO of tab1, tab2 and customer tab will be run.
Regards,
Thanh.
2016 Mar 30 2:00 PM
Hi try This,
CASE SY-UCOMM.
WHEN 'TAB1'.<function code of the Tab>
TABS-ACTIVETAB = 'TAB1'.<name of the Tab>
WHEN OTHERS.
TABS-ACTIVETAB = 'TAB2'.<Name of the Tab>.
ENDCASE.
and call the both subscreens in PBO
PROCESS BEFORE OUTPUT
MODULE STATUS_0100.
CALL SUBSCREEN SUBS1 INCLUDING SY-REPID '0101'.
CALL SUBSCREEN SUBS2 INCLUDING SY-REPID '0102'.
2016 Apr 01 7:35 AM
Hi,
Please try the below logic.
Call your sub screen dynamically. Your code must be as below.
PBO
" fill a variable dynamically with screen number like below,
case ok_code.
when "Fcode of tab1".
tabstrip-activetab = "Fcode of tab1"
X = "Subscreen number".
when "Fcode of tab2".
tabstrip-activetab = "Fcode of tab2"
X = "Subscreen number".
when others.
tabstrip-activetab = "Fcode of tab1"
X = "Subscreen number".
end case.
" Now write the code below .
call subscreen "Sub screen name" including sy-repid 'Put a variable here say "X"'
All these logic mentioned above should be in the same order and only in PBO.
Hope this will sort your issue. Do let us know.