‎2006 Jun 12 9:34 AM
Hi,
I've a select query which is selecting data in a hashed internal table ( gt_but100 ).
The table key is defined as 'Partner'.
SELECT * FROM but100 INTO TABLE gt_but100
FOR ALL ENTRIES IN gt_blocked_bp
WHERE partner EQ gt_blocked_bp-partner
AND rltyp IN s_parro.
The query works fine is there is only entry in s_parro.
But gives a ITAB_DUPLICATE_KEY short dump when it has more then 1 value.
How could i avoid that?
Regards,
Rohit.
‎2006 Jun 12 9:41 AM
Hi rohit,
1. Duplicate key
2. define your internal table gt_but100
like this
(and then u won't get any error)
3.
*----
<b>data : gt_but100 like hashed table of but100
with unique key <b>MANDT PARTNER RLTYP DFVAL</b>
with header line.</b>
4. Hashed tables don't take any duplicate record,
hence,
we have to specify all the KEY FIELDS,
when declaring the table.
regards,
amit m.
‎2006 Jun 12 9:41 AM
thats the way hashed tables work.
you can go for normal itab where duplicates are not checked
or change the hashed table definition to extend the key definition
Regards
Raja
‎2006 Jun 12 9:41 AM
Hi rohit,
1. Duplicate key
2. define your internal table gt_but100
like this
(and then u won't get any error)
3.
*----
<b>data : gt_but100 like hashed table of but100
with unique key <b>MANDT PARTNER RLTYP DFVAL</b>
with header line.</b>
4. Hashed tables don't take any duplicate record,
hence,
we have to specify all the KEY FIELDS,
when declaring the table.
regards,
amit m.