12-18-2008 6:32 AM
hi ,
I have an internal Table with 53,890 vendors in first column.
the others columns contains vendor descirptions and their address.
for e,g say i have records in my internal table as follows.
LIFNR
1) 0000001109
2) 0000001111
3) 0000005581
4) E-115174
5) E-115175
6) E-115176
7) E-115177
😎 MR84
9) MR85
10) MR86
now i want to delete records starting from 1 to 3 as they are number format
but i don't want to delete records from 4 to 10 as they are character format.
i can do that deletion based on number and character formats
using the below code.
*Final Table for Diplsay of Vendors
LOOP AT t_lfa1 INTO wa_lfa1.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
string_in = wa_lfa1-lifnr
IMPORTING
htype = w_type.
IF w_type = 'NUMC'.
DELETE t_lfa1 WHERE lifnr = wa_lfa1-lifnr.
ENDIF.
ENDLOOP.
the above code fulfills my requirement but it takes lot of time when moved for testing since there are
53,890 records and DELETE will always increases the index cost and performance problem comes.
My requirement is there any condition we can put in my SELECT syntax where in i can select only
those records in character format
12-18-2008 7:39 AM
Hi Murali
I don't think that you can do anything in select query for this, instead enhance your current code.
1. For loop, use a field symbol, This will enhance your loop performance as the overhead to copy values into a work area is reduced.
2. Add another field of type CHAR 1 (let's say NUM_CHECK) to declaration of T_LFA1. If you find the vendor as numeric then set this field to X in loop. Do not delete anything in loop.
3) After loop, use DELETE T_LFA1 WHERE NUM_CHECK = 'X'.
This will take lesser time.
Thanks
Anuraag
12-18-2008 7:39 AM
Hi Murali
I don't think that you can do anything in select query for this, instead enhance your current code.
1. For loop, use a field symbol, This will enhance your loop performance as the overhead to copy values into a work area is reduced.
2. Add another field of type CHAR 1 (let's say NUM_CHECK) to declaration of T_LFA1. If you find the vendor as numeric then set this field to X in loop. Do not delete anything in loop.
3) After loop, use DELETE T_LFA1 WHERE NUM_CHECK = 'X'.
This will take lesser time.
Thanks
Anuraag
12-18-2008 7:54 AM
12-18-2008 7:54 AM