Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

ITAB_DUPLICATE_KEY

$
0
0

We are getting a "ITAB duplicate key" error in a DataSource enhancement for BW that selects data from table MBEW into a hash table.  The internal table has the same fields as the key of the table.  I don't understand how we could be getting ITAB_DUPLICATE_KEY error when the where clause on the select statement has the key of the table.  Is this a buffering issue?  Here's a subset of the important code:

 

    TYPES:
   
BEGIN OF TY_MBEW,          "Material Valuation
      MATNR
TYPE MBEW-MATNR,   "Material Number
      BWKEY
TYPE MBEW-BWKEY,   "Valuation Area
      BWTAR 
TYPE MBEW-BWTAR,   "Valuation Type
      STPRS
TYPE MBEW-STPRS,   "Standard Price
      PEINH
TYPE MBEW-PEINH,   "Price Unit
      VERPR
TYPE MBEW-VERPR,   "Moving Average Price/Periodic Unit Price
      VPRSV
TYPE MBEW-VPRSV,   "Price Control Indicator
   
END OF TY_MBEW.

 

  DATA:

        IT_MBEW_HSH TYPE HASHED TABLE OF TY_MBEW
       
WITH UNIQUE KEY MATNR BWKEY BWTAR,

 

  SELECT MATNR
         BWKEY
         BWTAR
         STPRS
         PEINH
         VERPR  
"Moving Average Price/Periodic Unit Price
         VPRSV  
"Price Control Indicator
   
FROM MBEW
   
INTO CORRESPONDING FIELDS OF TABLE it_mbew_hsh
   
FOR ALL ENTRIES IN LI_DATA
   
WHERE MATNR = LI_DATA-MATNR AND
          BWKEY
= LI_DATA-WERKS AND
          BWTAR
= ''.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>