‎2008 Dec 08 8:53 AM
Hi,
I am selecting the data from my database table and want to disply it in my table control.
can anyone help me out
thanks in advance.
‎2008 Dec 08 8:56 AM
Hi,
declare a controls variable in Top include
controls tc type tableview using screen 100.
then design a screen with number 100.
give the table control name tc
and add fields from the itab (from program which you had declared in Top Include)
In PBO
module status_100
loop at itab with control tc.
endloop
in the module status_100.
moduel status_100
select * from dbtab into table itab
endmodule
declare the corresponding variables in TOP include
make sure the Table control contains the same names as the itab
regards
Ramchander Rao.K
Edited by: ramchander krishnamraju on Dec 8, 2008 10:02 AM
‎2008 Dec 08 9:01 AM
‎2008 Dec 08 9:03 AM
Hi,
Make modules in PBO
*---data declarations for table control
CONTROLS: tab_cnt1 TYPE TABLEVIEW USING SCREEN '0310'.
DATA: w_ln TYPE i.
MODULE get_t_ctrl_lines OUTPUT.
DESCRIBE TABLE it_mast LINES w_ln.
*TO MAKE VERTICAL SCROLL BAR TO COME ON RUN TIME
tab_cnt1-lines = w_ln + c_100.
ENDMODULE. " get_t_ctrl_lines OUTPUT
MODULE it_mast_to OUTPUT.
READ TABLE it_mast INDEX tab_cnt1-current_line.
IF sy-subrc <> c_0.
EXIT FROM STEP-LOOP.
ELSE.
ENDIF.
ENDMODULE. " it_mast_to OUTPUT
Thanks & Regards,
Krishna...
‎2008 Dec 08 9:05 AM
data : yyyy type standard table of xxxx with header line,
wa type xxxx.
controls: tc type tableview using screen '....'. "tc is table control name
data : ln type i, "NUMBER OF RECORDS
t_lfa1_initial.
module get_tc_lines output.
if t_lfa1_initial is initial.
select field1,field2
from xxxx
into corresponding fields of table yyyy .
t_lfa1_initial = 'X'.
refresh control 'TC' from screen '....'.
describe table yyyy lines ln.
tc-lines = ln + 100000 . "VERTICAL SCROLL BAR TO COME ON RUNTIME
endif.
endmodule.
‎2008 Dec 08 9:08 AM
hi,
open ABAPDOCU>user dialogs> complex screens--> see the table contrl examples
‎2008 Dec 08 9:14 AM
Hi,
On the screen logic, use code:-
PROCESS BEFORE OUTPUT.
MODULE STATUS_8001.
LOOP WITH CONTROL MOVIE. "MOVIE is name of table control on screen
MODULE PASS_DATA.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_8001.
LOOP WITH CONTROL MOVIE.
MODULE DISPLAY_DATA.
ENDLOOP.
Code for PBO screen 8001
******SCREEN 8001***READING DATA FROM MOVIE_TAB TO TABLE CONTROL********
MODULE PASS_DATA OUTPUT.
SORT MOVIE_TAB. "MOVIE_TAB is internal table(holds the records)
READ TABLE MOVIE_TAB INDEX MOVIE-CURRENT_LINE.
ENDMODULE. " PASS DATA OUTPUT
************************PBO OF SCREEN 8001******************************
MODULE STATUS_8001 OUTPUT.
SET PF-STATUS 'Z_TABCT'.
DATA : LINE_COUNT TYPE I.
DESCRIBE TABLE MOVIE_TAB
LINES LINE_COUNT.
MOVIE-LINES = LINE_COUNT + 3.
"increases the lines of table control MOVIE (makes the table control scrollable)
CLEAR COUNT.
ENDMODULE. " STATUS_8001 OUTPUT
Code for PAI screen 8001
*&---------------------------------------------------------------------*
*& Module DISPLAY_DATA INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
******SCREEN 8001****MODIFYING INTERNAL TABLE FROM TABLE CONTROL********
MODULE DISPLAY_DATA INPUT.
MODIFY MOVIE_TAB INDEX MOVIE-CURRENT_LINE.
ENDMODULE. " DISPLAY_DATA INPUT
Hope this solves your problem.
Thanks & Regards.
Tarun Gambhir.