2009 Jun 09 5:26 PM
Hi,
I have a screen with a tabcontrol. I want make this tabcontrol invisible while some condition are met.
I tried this code in PBO and in module tabcontrol_change_field_attr. But it didn't work :
if my condition.
loop at screen.
screen-invisible = '1'.
endloop.
endif.
Can you make tabcontrol invisible?
Thanks,
Widad
2009 Jun 09 5:30 PM
You have to mention other condition too in Loop.
loop at screen.
if screen-name = some name'
screen-invisible = '1'.
modify screen.
endif.
endloop.
Thank you
Seshu
2009 Jun 09 5:33 PM
Hi,
see the sample code to tabcontrol invisible .
PROCESS BEFORE OUTPUT.
* Module screen GUI-Screen&Status and Screen Logic
MODULE status_1020.
* Table control for OUTPUT
LOOP AT t_zcxref_classes INTO wa_zcxref_classes
WITH CONTROL tc_batch .
MODULE charac_classname_out.
ENDLOOP.
MODULE status_1020 OUTPUT.
DESCRIBE TABLE t_zcxref_classes LINES w_fill. "t_zcxref_classes is table used in table control
tc_batch-lines = w_fill. "scrool bar for table control
tc_batch-invisible = ' '. "table control Visible..
" tc_batch is table control name
CASE ok_code.
WHEN 'ENTER'.
IF t_zcxref_classes [] IS INITIAL.
tc_batch-invisible = 'X'. "make table control invisible
ENDIF.
ENDCASE.
ENDMODULE. " STATUS_1020 OUTPUT
Prabhudas
2009 Jun 09 6:08 PM
You need to set the active component of the screen to '0'.
loop at screen.
if screen-name = tab_control_name.
screen-active = '0'.
modify screen.
endif.
endloop.
Hope this helps.
regards,
Advait
2009 Jun 09 6:16 PM
"Declaration of Table Control...
CONTROLS : tc_batch TYPE TABLEVIEW USING SCREEN '1020'.
Press f1 on Controls and double click on.. CONTROLS - TYPE TABLEVIEW ..
and see the table control structure and view clearly mentioned that ..
INVISIBLE Flag ("X" or " ") whether or not the table control is visible in the window or not.
Sample code need to write in PBO..
TC_BATCH is Table control Name..
tc_batch-invisible = ' '. "table control Visible..
tc_batch-invisible = 'X'. "table control INVisible
Regards,
Prabhudas
2009 Jun 09 6:27 PM
Thanks,
I used tabcontrol-invisible = 'X' and it work.
regards,
Widad.
2009 Jun 09 6:33 PM
hi
try this
in se51
PBO
Module_status_0800.
LOOP WITH CONTROL TCONTROL.
Module_screen_modif.
ENDLOOP.
PAI
LOOP WITH CONTROL TCONTROL.
Module_user_command_0800.
ENDLOOP.
in se38
controls : TCONTROL TYPE TABLEVIEW USING SCREEN '0800'.
data : rb1,rb2.
Module_screen_modif_o/p.
if RB1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'TCONTROL'.
SCREEN-INPUT = '1'.
SCREEN-INVISIBLE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
if RB2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'TCONTROL'.
SCREEN-INPUT = '0'.
SCREEN-INVISIBLE = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endmodule.
Module_user_command_0800.
case sy-ucomm.
when 'EXIT' or 'BACK' or 'CANCEL'.
LEAVE PROGRAM.
endcase.
Endmodule
Regards