‎2010 Mar 12 8:25 AM
Hi All,
I am working on module pool. My requirement is
In the first screen i have plant as input , Below that i have a table control...
If the plant is valid then only i have to display the table control or else i have to make the table control as invisible...I am trying this using loop at screen method..but it is not working..could u please help me...
example code:
LOOP AT SCREEN.
IF SCREEN-NAME = 'TC1'.
SCREEN-INVISIBLE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
‎2010 Mar 12 8:34 AM
Hi,
Is your scenario something like this?
When your screen is displayed, you dont want your table control to be displayed, but just the input for plant.
Now if your entered plant is valid, an event (say a button click or a Enter) is going to make your table control visible.
If so, then you can use this
"Write this in your PBO which will make your table control invisible on your first screen display
LOOP AT tabcontrol1-cols[] INTO wa_control1.
wa_control1-invisible = '1'.
MODIFY tabcontrol1-cols[] FROM wa_control1 INDEX sy-tabix.
ENDLOOP.
Similarly code appropriately to make the table control visible on the occurrence of some event by changing the wa_control1-invisible parameter.
‎2010 Mar 12 8:36 AM
‎2010 Mar 12 8:44 AM
Hi,
Small change to your code.
IF Plant check fails.
LOOP AT SCREEN.
IF SCREEN-NAME CS 'TC1'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-NAME CS 'TC1'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
I am assuming TC1 is the table control name.
Thanks,
Vinod.
‎2010 Mar 12 9:07 AM
thanks for your reply,
I have tried as you said...but no use...while debugging screen-name i am able to see all the screen elements except table control...
..is there any alternate?
‎2010 Mar 12 9:17 AM
Hi,
Is your table control and plant field both are in same screen or different screens? If it is in same screen it should work fine.
If different screen then, call table control screen based on plany check if passed or not.
Thanks,
Vinod.
‎2010 Mar 12 9:23 AM
Both are in same screen...even i am able to find the table columns in the debugging as screen elements but table control is not...
‎2010 Mar 12 9:25 AM
Hi,
You gotto use the code that I gave you
Only then, the table control disappears.
Use it outside the LOOP...ENDLOOP in the PBO.
‎2010 Mar 12 9:37 AM
Hi,
Can you try with below sample code.
CONTROLS tc1 TYPE TABLEVIEW USING SCREEN 0100.
LOOP WITH CONTROL tc1.
LOOP AT SCREEN.
IF screen-name CS 'TC1-'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDLOOP.Thanks,
Vinod.
‎2010 Mar 12 9:38 AM
Hi Buddula,
in TOP include
data : repid type sy-repid value sy-repid,
dynnr type sy-dynnr value '200'. " This is a dummy subscreen.
in PBO of main Screen.
call subscreen sub including repid dynnr.
in PAI.
module validate_plant
in Program.
module u validate_plant
" validate plant here and pass X to a Flag as below.
if valid_plant = 'X'
dynnr = '101' " This must be subscreen which contains your Table control.
else.
dynnr = '100' " Dummy Subscreen.
endmoduleCheerz
Ram
‎2010 Mar 12 10:41 AM
In this scenario i should not use sub screens .... is there any alternate
‎2010 Mar 12 10:56 AM