2008 Jun 21 8:44 AM
Hi guys,
I have an internal table with unique key...
But Im getting a dump when using it... If the key has 2 same values, it gives a dump... is it normal? what should be done to curb this?
thanks a lot!
2008 Jun 21 8:47 AM
Hi,
Are you using a sorted table with unique key or hashed key with unique key ?
If yes, then it will give a dump.
SO to avoid this, first do a
read table itab with key x = f1.
if sy-subrc = 0.
delete itab where x = f1.
insert wa into itab.
endif.
Note: for sorted, hashed tables you have to use INSERT and not APPEND.
Does this help?
Regards,
Subramanian
Hi guys,
I have an internal table with unique key...
But Im getting a dump when using it... If the key has 2 same values, it gives a dump... is it normal? what should be done to curb this?
thanks a lot!
2008 Jun 21 8:47 AM
Hi,
Are you using a sorted table with unique key or hashed key with unique key ?
If yes, then it will give a dump.
SO to avoid this, first do a
read table itab with key x = f1.
if sy-subrc = 0.
delete itab where x = f1.
insert wa into itab.
endif.
Note: for sorted, hashed tables you have to use INSERT and not APPEND.
Does this help?
Regards,
Subramanian
2008 Jun 21 8:51 AM
yes it is completely normal behavior.
If you pass duplicate values for the key, it defies the definition of the KEY field and hence the dump.
Regards,
ravi
2008 Jun 21 8:52 AM
Hi,
Unique key define the column uniqully throughout the table. If you try to append the duplicate value in the column, it will raise the error.
Krishan
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |