‎2010 Mar 08 11:11 AM
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
‎2010 Mar 08 1:02 PM
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
‎2010 May 28 3:35 PM
has your problem been resolved?
If yes please suggest how?
Regards,
VireN
‎2010 May 28 4:02 PM
Hi
Perhaps, you can do it with ALV... your field catalog is dynamic... and you can do user command too
Best regards
‎2011 Nov 02 11:30 AM
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
‎2011 Nov 02 12:05 PM
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.