Skip to Content
0
May 09, 2011 at 09:59 AM

Table control in ABAP - beginner

25 Views

I am not able to fill data from database in TABLE CONTROL.The table is displayed with columns(which i added in layout using dict option) but on runtime there is no data in it.I am trying this for the first time so kindly guide me.

Here is PBO and PAI code.

PROCESS BEFORE OUTPUT.
 LOOP AT ITAB WITH CONTROL EMPTABLE CURSOR EMPTABLE-CURRENT_LINE.
  
 ENDLOOP.
 MODULE STATUS_0001.
*
PROCESS AFTER INPUT.
 LOOP AT ITAB.
 ENDLOOP.
 MODULE USER_COMMAND_0001.

And here is Main Code.

REPORT  ZDATA_FORM1.

TABLES: ZEMPLOYEE_MASTER.

CONTROLS EMPTABLE TYPE TABLEVIEW USING SCREEN 0001.

data: begin of itab occurs 0,
       emp_no like zemployee_master-emp_no,
       name like zemployee_master-name,
       city like zemployee_master-city,
      end of itab.

select emp_no name city from zemployee_master into table itab.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0001  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_0001 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_0001  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0001 INPUT.
 CASE SY-UCOMM.
   WHEN 'EXIT'.
     LEAVE PROGRAM.
 ENDCASE.
ENDMODULE.                 " USER_COMMAND_0001  INPUT