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

Dynamic table control in module pool screen

Former Member
0 Likes
2,398

Hi All

I have got a requirement that in the module pool program i need to create a table control which is going to be dynamic i.e number of columns to be displayed in the screen is going to vary based on the one of the table entries. for example the requirement is as follows.

I wanted to displaye list of bikes available in different states.

State Bike1 Bike2 Bike3

AP 2 3 1

MP 4 6 7

Currently i have only 3 three types of bike, this may increase to 7 by next year or decrease and this functionality I require dynamically, Can you help on the same?

Thanks

Giri

5 REPLIES 5
Read only

Former Member
0 Likes
1,169

Hi,

Please kindly refer to the WIKI: [http://wiki.sdn.sap.com/wiki/display/Snippets/Programfordynamictabledisplay|http://wiki.sdn.sap.com/wiki/display/Snippets/Programfordynamictabledisplay]

Cheers

Read only

tech_viren
Explorer
0 Likes
1,169

has your problem been resolved?

If yes please suggest how?

Regards,

VireN

Read only

0 Likes
1,169

Hi

Perhaps, you can do it with ALV... your field catalog is dynamic... and you can do user command too

Best regards

Read only

0 Likes
1,169

Hi,

In ALV it is possible it is sure but same we can achieve with table control also.

There is one standard tcode where we can take reference.

MD61 shows table control with dynamic labels and columns.

I am also checking for the same reference.

-Maharshi

Read only

surajarafath
Contributor
0 Likes
1,169

You can do it,

Just try the code,...

if you have requirement like to make changes in the same screen itself,

then follow the same thing in PAI Module

In PBO...

PROCESS BEFORE OUTPUT.
MODULE STATUS.
LOOP WITH CONTROL TABCTRL.
MODULE MODIFY_100.
ENDLOOP.

MODULE MODIFY_100 OUTPUT.
 
DATA wa_tabctrl TYPE cxtab_column .
 
LOOP AT TABCTRL-COLS INTO WA_TABCTRL.
      IF WA_TABCTRL-NAME =  'BIKE3'.                    
        WA_TABCTRL-SCREEN-INVISIBLE =  '1'. 
        MODIFY TABCTRL-COLS FROM WA_TABCTRL.
      ENDIF.
ENDLOOP.
 
ENDMODULE.