2005 Feb 25 6:58 PM
Hi,
My requirement is that I have to delete the duplicate values before doing any manupilation of data.. so for this I have written the code...
*Deleting all the duplicate entries comparing group code, GL *& GL Suffix
IT_INPUT_TEMP[] = IT_INPUT[].
SORT IT_INPUT_TEMP BY GRCODE GL GLSUF.
DELETE ADJACENT DUPLICATES
FROM IT_INPUT_TEMP COMPARING GRCODE GL GLSUF.
Now with the remaining values in the internal table I have to check the 3rd field i.e. GLSUF & if it = '00000' (5 zeros)... i have to delete those entries...
For this I have written...
Deleting enteries where the GL Suffix is zero.
IF IT_INPUT_TEMP-GLSUF = 00000.
DELETE IT_INPUT_TEMP.
ENDIF.
It gives me a dump saying "Invalid_Table_Index"...
Prior to this I have also checked up by using Index function.
Deleting enteries where the GL Suffix is zero.
IF IT_INPUT_TEMP-GLSUF = 00000.
DELETE IT_INPUT_TEMP index l_tabix.
ENDIF.
Can anyone tell me where I am wrong??..
Thank You & Regards,
-S.
2005 Feb 25 7:24 PM
Hi S,
Your code extract
* Deleting enteries where the GL Suffix is zero.
IF IT_INPUT_TEMP-GLSUF = 00000.
DELETE IT_INPUT_TEMP.
ENDIF.Either this should be in a loop(which is unnecessary if all you are trying to achieve is deleting records), or you can try the option with 'WHERE' clause as mentioned in the above post.
DELETE FROM IT_INPUT_TEMP WHERE GLSUF = '00000'.
Regards,
Srinivas
Hi,
My requirement is that I have to delete the duplicate values before doing any manupilation of data.. so for this I have written the code...
*Deleting all the duplicate entries comparing group code, GL *& GL Suffix
IT_INPUT_TEMP[] = IT_INPUT[].
SORT IT_INPUT_TEMP BY GRCODE GL GLSUF.
DELETE ADJACENT DUPLICATES
FROM IT_INPUT_TEMP COMPARING GRCODE GL GLSUF.
Now with the remaining values in the internal table I have to check the 3rd field i.e. GLSUF & if it = '00000' (5 zeros)... i have to delete those entries...
For this I have written...
Deleting enteries where the GL Suffix is zero.
IF IT_INPUT_TEMP-GLSUF = 00000.
DELETE IT_INPUT_TEMP.
ENDIF.
It gives me a dump saying "Invalid_Table_Index"...
Prior to this I have also checked up by using Index function.
Deleting enteries where the GL Suffix is zero.
IF IT_INPUT_TEMP-GLSUF = 00000.
DELETE IT_INPUT_TEMP index l_tabix.
ENDIF.
Can anyone tell me where I am wrong??..
Thank You & Regards,
-S.
2005 Feb 25 7:03 PM
Hello SAP,
you have two possibilities here. Either you use a delete command from all the entries that meet the criteria (e.g. Delete from itab where field = 00000) or you have to make sure your index field has a value (it might be initial)
Please let me know if this helps you.
2005 Feb 25 7:24 PM
Hi S,
Your code extract
* Deleting enteries where the GL Suffix is zero.
IF IT_INPUT_TEMP-GLSUF = 00000.
DELETE IT_INPUT_TEMP.
ENDIF.Either this should be in a loop(which is unnecessary if all you are trying to achieve is deleting records), or you can try the option with 'WHERE' clause as mentioned in the above post.
DELETE FROM IT_INPUT_TEMP WHERE GLSUF = '00000'.
Regards,
Srinivas
2005 Feb 25 7:26 PM
Hi,
The deletion is happeninn correctly now... I deleted the previous code & wrote..
DELETE IT_INPUT_TEMP WHERE GLSUF = 00000.
It's working fine now ... I hope it works the same way in production server...
Thank You,
-S.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |