Skip to Content
0
Former Member
Dec 21, 2006 at 09:54 AM

I have a problem in using for all entries

22 Views

Hi i have a problem in using <b>for all entries</b>

i have declared the two internal tables as below

  DATA: BEGIN OF ITAB OCCURS 10,
          EBELN LIKE EKKO-EBELN,
          LIFNR LIKE EKKO-LIFNR,
          EBELP LIKE EKBE-EBELP,
          BELNR LIKE EKBE-BELNR,
*          MATNR LIKE EKPO-MATNR,
*          TXZ01 LIKE EKPO-TXZ01,
          VGABE LIKE EKBE-VGABE,
          GJAHR LIKE EKBE-GJAHR,
          KNUMV LIKE EKKO-KNUMV,

     END OF ITAB.

DATA: BEGIN OF ITAB1 OCCURS 10,
          EBELN LIKE EKPO-EBELN,
          MATNR LIKE EKPO-MATNR,
          TXZ01 LIKE EKPO-TXZ01,
          WERKS LIKE EKPO-WERKS,
          NETWR LIKE EKPO-NETWR,
          MENGE LIKE EKPO-MENGE,
          MWSKZ LIKE EKPO-MWSKZ,
          LIFNR LIKE EKKO-LIFNR,
          EBELP LIKE EKBE-EBELP,
          BELNR LIKE EKBE-BELNR,


      END OF ITAB1.

<b>and now i have tried to move the values in those internal tables using these statements</b>

   SELECT  A~EBELN A~LIFNR A~KNUMV B~VGABE B~EBELP B~GJAHR B~BELNR

        FROM  EKKO AS A
        INNER JOIN EKBE  AS B ON  B~EBELN = A~EBELN
        INTO  CORRESPONDING
        FIELDS OF TABLE ITAB WHERE B~VGABE = '2'.



   SELECT EKPO~EBELN EKPO~MATNR EKPO~TXZ01 EKPO~WERKS EKPO~NETWR
          EKPO~MENGE EKPO~MWSKZ
      FROM EKPO
      INTO CORRESPONDING FIELDS OF TABLE ITAB1
      FOR ALL ENTRIES IN ITAB
      WHERE EBELN = ITAB-EBELN.
                 


      LOOP AT ITAB1.
       READ TABLE ITAB WITH KEY EBELN = ITAB-EBELN.

       ITAB-EBELN = ITAB1-EBELN.
       ITAB1-LIFNR = ITAB-LIFNR.
       ITAB1-EBELP = ITAB-EBELP.
       ITAB1-BELNR = ITAB-BELNR.
       ITAB1-EBELP = ITAB-EBELP.

       APPEND ITAB1.



      ENDLOOP.

But when i was using loop then it was displaying values in debugging mode but while i was trying to execute it was taking a lot of time i thought that it was due to more information in the already declared internal table so i have tried to remove the previous entries but it was showing an error while i was removing the old entries

and when i remove the loop at itab1 then i'll get output directly but it was displaying the itab fields which is my 1st internal table but not the values of itab1 can u explain me what is the possible error for that

Regards ,

Pavan