7 Replies Latest reply: Oct 25, 2009 12:49 AM by SAP Konsulent RSS

how to populate an internal table from three different tables

sudha rani
Currently Being Moderated

My requirement is to populate an itab by retrieving data from three diff db tables,

ekko,ekpo and Ekbe.

below is the code for data retrieval .

 

SELECT EBELN INTO TABLE IT_EKKO FROM EKKO WHERE EBELN IN S_EBELN.

  IF NOT IT_EKKO[] IS INITIAL.

    SELECT  EBELP TXZ01 NETWR BUKRS INTO CORRESPONDING FIELDS OF TABLE IT_EKPO FROM EKPO FOR ALL ENTRIES IN IT_EKKO

      WHERE EBELN EQ IT_EKKO-EBELN.

IF NOT IT_EKPO[] IS INITIAL.

      SELECT  EMATN WAERS WERKS GJAHR BEWTP INTO CORRESPONDING FIELDS OF TABLE IT_EKBE FROM EKBE FOR ALL ENTRIES IN IT_EKPO

        WHERE EBELN EQ IT_EKPO-EBELN

         AND  EBELP EQ IT_EKPO-EBELP

         AND  BEWTP EQ 'E' OR BEWTP EQ 'Q'.

        ENDIF.

        ENDIF.

please tell me how to populate data from it_ekko,it_ekpo and it_ekbe into an internal table ITAB.

Actions