Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hide the columns in table-control.

Former Member
0 Likes
4,087

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,839

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

Read only

Former Member
0 Likes
1,839

hi Rekha,

welcome in SDN.

did you check this thread?

hope it helps you.

thanks

Sachin

Read only

Former Member
0 Likes
1,839

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

Read only

Former Member
0 Likes
1,839

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

Read only

0 Likes
1,839

awesome, this worked for me .

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,839

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

Read only

Former Member
0 Likes
1,839

Hi

try this....

In PBO module

loop at screen.

if screen-name eq 'SCREEN_NO'.

screen-invisible eq '1'.

endif.

endloop.

Read only

0 Likes
1,839

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

Read only

0 Likes
1,839

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