2008 Jul 15 9:10 PM
Hi Group,
I want to retrieve data from database table and display in Table control in a module pool program.
I don't want to use table control wizard. Any help is appreciated..
Thanks All.
2008 Jul 15 9:25 PM
Your best bet sounds like the table maintenance generator in SE11.
Rob
2008 Jul 15 9:42 PM
Table Control wizard is best way to create table control.
Otherwise there lotta stuff u need to add in PAI and PBO of the screen.
Otherwise
create screen : 100 and define table control with name TC.
then double click on screen 100 u will get PBO and PAI events.
Under the PBO:
LOOP AT I_ITAB1
INTO WA_ITAB1
WITH CONTROL TC
CURSOR TC-CURRENT_LINE.
MODULE TC_GET_LINES.
ENDLOOP.
*----In the main program
*&SPWIZARD: LINES OF TABLECONTROL 'TC'
DATA: G_TC_LINES LIKE SY-LOOPC.
MODULE TC_GET_LINES OUTPUT.
G_TC_LINES = SY-LOOPC.
ENDMODULE.
Under the PAI :
*--no need to write anything between loop and endloop.
LOOP AT I_ITAB1.
CHAIN.
FIELD WA_ITAB1-MATNR.
FIELD WA_ITAB1-MAKTX.
FIELD WA_ITAB1-WERKS.
ENDCHAIN.
ENDLOOP.
MODULE USER_COMMAND_0100.
In this MODULE USER_COMMAND_0100. you can write your own code.
Hope this will helpful to you .
2008 Jul 16 5:12 PM
2008 Jul 16 5:32 PM
Please check the demo program.
DEMO_DYNPRO_TABCONT_LOOP
Shreekant
2008 Jul 16 8:19 PM
Hi,
you first need to define input/out field into item level part of the table control and then define text field on header part of the table control.
that way you can manually assign columns to table control.