2009 Mar 09 9:07 AM
Hi Experts,
I have requirement to hide certain columns in table control. I have tried my best to use SCREEN structure with ACTIVE, INVISIBLE, INPUT, OUTPUT options, but not working properly.
The table control has nearly 10 columns with DATE as the first one. Once the screen appears after executing program, the second and third columns should be hidden and when double clicked on any date value from the basic list, the hidden columns should be visible with its values in the next level.
I am not able to hide columns in table control. By the way, suggest me options for double clicking in table control too.
Thanks.
2009 Mar 09 9:14 AM
Hi Experts,
I have requirement to hide certain columns in table control. I have tried my best to use SCREEN structure with ACTIVE, INVISIBLE, INPUT, OUTPUT options, but not working properly.
The table control has nearly 10 columns with DATE as the first one. Once the screen appears after executing program, the second and third columns should be hidden and when double clicked on any date value from the basic list, the hidden columns should be visible with its values in the next level.
I am not able to hide columns in table control. By the way, suggest me options for double clicking in table control too.
Thanks.
2009 Mar 09 9:11 AM
Hi,
Take the group1 for all the i/o fields in table control as ABC which you want to hide initially.
Now use code in PBO:-
MODULE status_8001.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-invisible = 1. "hide control
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
This code will hide the columns in table control.
Hope this helps you.
Regards,
Tarun
2009 Mar 09 9:15 AM
Hi Tarun,
I tried it already, its not working. BTW, what is the purpose of NAME component in SCREEN structure ?
Thankz,
Karthik
2009 Mar 09 9:19 AM
Hi,
In my case it is working. Can you please paste your code..!!
In screen NAME refers to the name of the current screen control. For Example : you give a name to textbox as ABCD, so you can also write:
screen-name = 'ABCD'.
"instead of
screen-group1 = 'ABC'. "as used in previous reply
Regards,
Tarun
2009 Mar 09 9:29 AM
Hi Tarun,
Will test with the latest one and reply you back with points. What can we do for Double click functionality in table control. I tried the following :
GET CURSOR LINE <CNT>
READ TABLE <itab> INDEX <CNT>
How can I use the double-clicked value for further validations ? Pls suggest me on this too. I am out of office now and on my laptop, couldn't paste the code.
Regards,
Karthik
2009 Mar 09 9:48 AM
Hi,
The value of sy-ucomm when user double clicks is /CS
To get the details of field name and value use:-
GET CURSOR FIELD g_cs_field VALUE g_cs_value.
Now you can code in PAI to display those two columns initially hidden by the user:-
CASE sy-ucomm.
WHEN '/CS'.
IF g_cs_field = '<field1_name>'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-invisible = 0. "display control
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDCASE.
Remember that in PBO of screen you have written a code to hide these same columns initially, so make sure that the code is not executed when user double clicks to display those columns.
Try this code for hidding the columns in table control initially.
MODULE status_8001.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-invisible = 1. "hide control
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
Hope this helps you.
Regards,
Tarun
2009 Mar 09 10:09 AM
Hi Tarun,
Thanks a lot . Have rewarded you points. Will get back to you if I have any issues. Bye until then.
Regards,
Karthik
2009 Mar 12 10:54 AM
2009 Mar 09 9:14 AM
2009 Mar 09 10:04 AM
Hi Karthikeyan,
pls see the code below..to hide the columns in table control,
TABCON is your table control.
In PBO
LOOP AT TABCON-COL .
if TABCON-COL-SCREEN-NAME = 'COLUMN_NAME'.
TABCON-COL-INVISIBLE = 'X'.
ENDIF.
ENDLOOP.
hope this will help u.
keerthi