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

Former Member
0 Likes
612

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.

6 REPLIES 6
Read only

Former Member
0 Likes
581

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

Read only

Former Member
0 Likes
581

use WIZARD table control

Read only

Former Member
0 Likes
581

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...

Read only

Former Member
0 Likes
581

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.

Read only

Former Member
0 Likes
581

hi,

open ABAPDOCU>user dialogs> complex screens--> see the table contrl examples

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
581

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.