2008 Dec 11 12:00 PM
Hi all,
How to hide the columns in table-control in dialog-promming.can any one help me.
Regards,
singh.
Hi all,
How to hide the columns in table-control in dialog-promming.can any one help me.
Regards,
singh.
2008 Dec 11 12:06 PM
Hello Rekha,
-
Please take the help of program RSDEMO02 for your ready reference.
-
In the screen painter the fields of table control which you want to hie/disable assign a group to them.
in PBO
loop at itab with control tc.
endloop.
here declare a module
module modify_fields.
in program
module modify_fields.
if some_condition
loop at screen.
if screen-group1 = 'GRP'.
screen-active = 0.
screen-invisible = 1.
screen-input = 0.
modify screen.
endif.
endloop.
endmodule.
Best Regards
Ramchander Rao.K
Edited by: ramchander krishnamraju on Dec 12, 2008 6:21 AM
2008 Dec 12 4:38 AM
2008 Dec 12 5:27 AM
Hi Rekha,
I also had same kind of requirement.
Try this it will surely help you.
if sy-tcode = 'ZAMITTRANS_AMIT'.
DATA: waa LIKE LINE OF TABCON-cols.
CLEAR waa.
LOOP AT TABCON-cols INTO waa.
IF waa-index = 3.
waa-invisible = 'X'.
MODIFY TABCON-cols FROM waa.
ENDIF.
ENDLOOP.
ENDIF.
The column you want to hide give it in waa-index.
Regards,
Amit.
Edited by: AMIT BISHT on Dec 12, 2008 6:27 AM
2008 Dec 16 6:54 AM
Hi Rekha,
In the PBO of the screen, write the code as below
loop at i_final into wa_final with control table_control
cursor table_control-current_line.
endloop.
Module to hide the columns of table control
module hide_columns_dynamically.
module hide_columns_dynamically output.
if <condition_required>.
data:cols type cxtab_column.
loop at table_control-cols into cols.
if cols-index = 3 or
cols-index = 4 or
cols-index = 5 or
cols-index = 6 and
cols-screen-input = '0'.
This will hide the 5th, 6th, 7th and 8th columns
cols-invisible = 'X'.
modify table_control-cols from cols.
endif.
endloop.
endif.
endmodule. " hide_columns_dynamically OUTPUT
With Best Regards,
Deepa Kulkarni
2016 Jan 28 9:04 AM
2008 Dec 16 10:46 AM
Hi Rekha,
To hide a column in a table control on screen.
In the PBO of the screen, inside
loop with control <tab_ctrl_name>.
module modify_tab.
endloop.
Say for a column, you take group1 as 'ABC'.
In this module you can use the group for the input/output fields and the display/hide them as per your requirements.
if <condition>.
loop at screen.
if screen-group1 = 'ABC'. "say textbox (column for a table) has group1 as ABC
screen-invisible = 'X'. "hide a column
screen-active = ' '.
endif.
modify screen.
elseif <condition>.
loop at screen.
if screen-group1 = 'ABC'. "say textbox (column for a table) has group1 as ABC
screen-invisible = 'X'. "display a column
screen-active = 'X'.
endif.
modify screen.
endif.
Similarly, you can use this code for other columsn also.
Hope this solves your prolem.
Thanks & Regards
Tarun Gambhir
2008 Dec 24 7:45 AM
Hi
try this....
In PBO module
loop at screen.
if screen-name eq 'SCREEN_NO'.
screen-invisible eq '1'.
endif.
endloop.
2008 Dec 24 9:34 AM
Hi rekha,
declare the table control as TC_NUTRI_CAL and also declare the workarea as cols.
now in the PBO call the table control in the following way and check for the field name .
This is code will work, the same code i used for my current report.
DATA: cols LIKE LINE OF tc_nutri_cal-cols.
LOOP AT tc_nutri_cal-cols INTO cols.
cols-screen-input = '0'.
IF cols-screen-name = 'WA_NUTRI_CAL-NUTRIMENT_ID'.
cols-invisible = '1'.
ENDIF.
MODIFY tc_nutri_cal-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Regards,
Madhavi
2008 Dec 24 9:35 AM
Hi rekha,
declare the table control as TC_NUTRI_CAL and also declare the workarea as cols.
now in the PBO call the table control in the following way and check for the field name .
This is code will work, the same code i used for my current report.
DATA: cols LIKE LINE OF tc_nutri_cal-cols.
LOOP AT tc_nutri_cal-cols INTO cols.
cols-screen-input = '0'.
IF cols-screen-name = 'WA_NUTRI_CAL-NUTRIMENT_ID'.
cols-invisible = '1'.
ENDIF.
MODIFY tc_nutri_cal-cols FROM cols INDEX sy-tabix.
ENDLOOP.
Regards,
Madhavi
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |