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

table control issue

Former Member
0 Likes
687

HI,

How to hide the table control generated by wizard.

I have a requirment that in module pool two radio buttons eg: 1,2 if radio button 1 selected table control has to hide. if 2selected table control has to visible. Please gve the solution for that requirement.

Thanks in Advance.

Regards,

Vinay Kumar K

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
641

Hi,

In the PBO (in a module outside to the LOOP...ENDLOOP), use this


MODULE status_0100 OUTPUT.
 
 IF sy-ucomm EQ space.   "Give the function code on which you want to make your table control go invisible
                                          "Give a space if you want your table control to remail invisible on display of the screen
 
    CLEAR: t_header[].
 
    LOOP AT tabcontrol1-cols[] INTO wa_control1.
      wa_control1-invisible = '1'.
      MODIFY tabcontrol1-cols[] FROM wa_control1 INDEX sy-tabix.
 
    ENDLOOP.
ENDMODULE.  

4 REPLIES 4
Read only

Former Member
0 Likes
642

Hi,

In the PBO (in a module outside to the LOOP...ENDLOOP), use this


MODULE status_0100 OUTPUT.
 
 IF sy-ucomm EQ space.   "Give the function code on which you want to make your table control go invisible
                                          "Give a space if you want your table control to remail invisible on display of the screen
 
    CLEAR: t_header[].
 
    LOOP AT tabcontrol1-cols[] INTO wa_control1.
      wa_control1-invisible = '1'.
      MODIFY tabcontrol1-cols[] FROM wa_control1 INDEX sy-tabix.
 
    ENDLOOP.
ENDMODULE.  

Read only

0 Likes
641

what is the data type of wa_control1?

Read only

0 Likes
641

Hi

the data type of the Table control can be found in Type-pool CXTAB....Moreover the code suggested by Nitwick would actually make the columns of the table control invisible and not the whole table control...

Please try the following code:

1) Create 2 global variables for indicators of the table control diaplay:

- GV_DISPLAY_TC1 and GV_DISPLAY_TC2..

- Set these variable in the PAI based on the Radio Button selected

- In the PBO before looping at the table control set this line of code...<Table_control_name>-invisible = 'X'.

Hope this solves the issue for you...

Sitakant

Read only

samantak_chatterjee
Active Contributor
0 Likes
641

Hi,

The best approach here would be to use sub-screen concept. Design two different Sub-Screens for the screen. And then populate the first one with the normal screen UI elements. And then in the second sub-screen populate and generate the Table Control using the Wizard. So, now associate a Function Code for your Radio Buttons.

Based on you logic you can load or unload the Subs- Screens which contains the normal screen and the Table Control related functionality.

Have a look at the following links for sample codes on Subscreens-

http://help.sap.com/abapdocu_70/en/DYNPCALL.htm

http://www.sapdev.co.uk/dialog/subscreen.htm

http://www.erpgenie.com/sap-technical/ABAP/creating-a-subscreen-in-your-ABAP-program

You can also check in the system the following sample programs - using transaction - *SE38 - DEMODYNPRO**

Hope this helps.

Thanks,

Samantak.