<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hashed table give ITAB_DUPLICATE_ERROR dump in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776078#M1307446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The only place where i feel you can have duplicate entries in from MSEG since you have not included ZEILE. Try including ZEILE in the key for the hashed table ht_mseg and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Jun 2009 05:09:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-19T05:09:59Z</dc:date>
    <item>
      <title>Hashed table give ITAB_DUPLICATE_ERROR dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776074#M1307442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this error on mentioned line.Here i have some doubts also.How can i expedite retrieval by which unique key combinations.&lt;/P&gt;&lt;P&gt;Further why i am getting this error ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of ty_mkpf,
       mblnr type mkpf-mblnr,
       mjahr type mkpf-mjahr,
       budat type mkpf-budat,
       end of ty_mkpf.

data: begin of ty_mseg,
       mblnr type mseg-mblnr,
       matnr type mseg-matnr,
       menge type mseg-menge,
       shkzg type mseg-shkzg,
       bwart type mseg-bwart,
       lgort type mseg-lgort,
       dmbtr type mseg-dmbtr,
       meins type mseg-meins,
       lifnr type mseg-lifnr,
       end of ty_mseg.

data: begin of ty_mbew,
       matnr type mara-matnr,
       bklas type mbew-bklas,
       end of ty_mbew.

data:begin of ty_t025t,
      bklas type t025t-bklas,
      bkbez type t025t-bkbez,
      end of ty_t025t.

data:begin of ty_maktg,
      matnr type makt-matnr,
      maktg type makt-maktg,
      end of ty_maktg.



data: ht_mkpf like hashed table of ty_mkpf
      with unique key mblnr mjahr
      with header line.

data: ht_mseg like hashed table of ty_mseg
      with unique key mblnr matnr lifnr bwart lgort
      with header line.

data: ht_t025t like hashed table of ty_t025t
      with unique key bklas
      with header line.

data: ht_maktg like hashed table of ty_maktg
      with unique key matnr
      with header line.

data: ht_mbew like hashed table of ty_mbew
      with unique key matnr
      with header line.

data: t_mkpf like ty_mkpf occurs 0 with header line.
data: t_mseg like ty_mseg occurs 0 with header line.
data: t_t025t like ty_t025t occurs 0 with header line.
data: t_maktg like ty_maktg occurs 0 with header line.
data: t_mbew like ty_mbew occurs 0 with header line.


select mblnr mjahr budat from mkpf into table ht_mkpf
where budat in s_budat.

select mblnr matnr menge shkzg bwart lgort dmbtr meins lifnr from mseg into table ht_mseg for
all entries in ht_mkpf where mblnr = ht_mkpf-mblnr and
mjahr = ht_mkpf-mjahr and werks = p_werks and matnr in s_matnr         &amp;lt;----- *getting error here*
and lifnr in s_lifnr and bwart in s_bwart and lgort in s_lgort.

select bklas bkbez from t025t into table ht_t025t where spras eq 'EN'
and bklas in s_bklas.

select matnr bklas from mbew into table ht_mbew for all entries in ht_mseg
where matnr = ht_mseg-matnr.

select matnr maktg from makt into table ht_maktg  for all entries in ht_mseg
where matnr = ht_mseg-matnr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2009 04:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776074#M1307442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-19T04:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Hashed table give ITAB_DUPLICATE_ERROR dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776075#M1307443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this a website or junkyard .................&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2009 04:23:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776075#M1307443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-19T04:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hashed table give ITAB_DUPLICATE_ERROR dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776076#M1307444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : begin of ty_mkpf,&lt;/P&gt;&lt;P&gt;       mblnr type mkpf-mblnr,&lt;/P&gt;&lt;P&gt;       mjahr type mkpf-mjahr,&lt;/P&gt;&lt;P&gt;       budat type mkpf-budat,&lt;/P&gt;&lt;P&gt;       end of ty_mkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of ty_mseg,&lt;/P&gt;&lt;P&gt;       mblnr type mseg-mblnr,&lt;/P&gt;&lt;P&gt;       matnr type mseg-matnr,&lt;/P&gt;&lt;P&gt;       menge type mseg-menge,&lt;/P&gt;&lt;P&gt;       shkzg type mseg-shkzg,&lt;/P&gt;&lt;P&gt;       bwart type mseg-bwart,&lt;/P&gt;&lt;P&gt;       lgort type mseg-lgort,&lt;/P&gt;&lt;P&gt;       dmbtr type mseg-dmbtr,&lt;/P&gt;&lt;P&gt;       meins type mseg-meins,&lt;/P&gt;&lt;P&gt;       lifnr type mseg-lifnr,&lt;/P&gt;&lt;P&gt;       end of ty_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of ty_mbew,&lt;/P&gt;&lt;P&gt;       matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;       bklas type mbew-bklas,&lt;/P&gt;&lt;P&gt;       end of ty_mbew.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of ty_t025t,&lt;/P&gt;&lt;P&gt;      bklas type t025t-bklas,&lt;/P&gt;&lt;P&gt;      bkbez type t025t-bkbez,&lt;/P&gt;&lt;P&gt;      end of ty_t025t.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of ty_maktg,&lt;/P&gt;&lt;P&gt;      matnr type makt-matnr,&lt;/P&gt;&lt;P&gt;      maktg type makt-maktg,&lt;/P&gt;&lt;P&gt;      end of ty_maktg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ht_mkpf like hashed table of ty_mkpf&lt;/P&gt;&lt;P&gt;      with unique key mblnr mjahr&lt;/P&gt;&lt;P&gt;      with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ht_mseg like hashed table of ty_mseg&lt;/P&gt;&lt;P&gt;      with unique key mblnr matnr lifnr bwart lgort&lt;/P&gt;&lt;P&gt;      with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ht_t025t like hashed table of ty_t025t&lt;/P&gt;&lt;P&gt;      with unique key bklas&lt;/P&gt;&lt;P&gt;      with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ht_maktg like hashed table of ty_maktg&lt;/P&gt;&lt;P&gt;      with unique key matnr&lt;/P&gt;&lt;P&gt;      with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ht_mbew like hashed table of ty_mbew&lt;/P&gt;&lt;P&gt;      with unique key matnr&lt;/P&gt;&lt;P&gt;      with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_mkpf like ty_mkpf occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data: t_mseg like ty_mseg occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data: t_t025t like ty_t025t occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data: t_maktg like ty_maktg occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data: t_mbew like ty_mbew occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr mjahr budat from mkpf into table ht_mkpf&lt;/P&gt;&lt;P&gt;where budat in s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr matnr menge shkzg bwart lgort dmbtr meins lifnr from mseg into table ht_mseg for&lt;/P&gt;&lt;P&gt;all entries in ht_mkpf where mblnr = ht_mkpf-mblnr and&lt;/P&gt;&lt;P&gt;mjahr = ht_mkpf-mjahr and werks = p_werks and matnr in s_matnr&lt;/P&gt;&lt;P&gt;and lifnr in s_lifnr and bwart in s_bwart and lgort in s_lgort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bklas bkbez from t025t into table ht_t025t where spras eq 'EN'&lt;/P&gt;&lt;P&gt;and bklas in s_bklas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr bklas from mbew into table ht_mbew for all entries in ht_mseg&lt;/P&gt;&lt;P&gt;where matnr = ht_mseg-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr maktg from makt into table ht_maktg  for all entries in ht_mseg&lt;/P&gt;&lt;P&gt;where matnr = ht_mseg-matnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2009 04:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776076#M1307444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-19T04:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hashed table give ITAB_DUPLICATE_ERROR dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776077#M1307445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you be more clear in your requirement...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2009 04:48:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776077#M1307445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-19T04:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hashed table give ITAB_DUPLICATE_ERROR dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776078#M1307446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The only place where i feel you can have duplicate entries in from MSEG since you have not included ZEILE. Try including ZEILE in the key for the hashed table ht_mseg and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2009 05:09:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776078#M1307446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-19T05:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Hashed table give ITAB_DUPLICATE_ERROR dump</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776079#M1307447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aditya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems as the data that is populating your hash table contains duplicate entries in the key fields that you have selected. You can try to change the composition of the key fields in the table where you are getting the dump. As you are using hash table to insert data into you will get a dump if two set of recrds with the key fields defined in the inetrnal table are same. If can change the table type from hashed to standard so that duplicate entries do not throw dump.&lt;/P&gt;&lt;P&gt;As per your code you say that the error you are getting is when you populate the internal table ht_mkpf from the database table MKPF, it means a set of records with same key fields are being inserted into the internal table. The possible solution could be to change the key fields in the definition of the internal table ht_mkpf or change the internal table type to standard.&lt;/P&gt;&lt;P&gt;If this error occurs on any select statement, check the table type and the combination of keys fields and take appropriate action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps in solving your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2009 05:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hashed-table-give-itab-duplicate-error-dump/m-p/5776079#M1307447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-19T05:12:29Z</dc:date>
    </item>
  </channel>
</rss>

