10-13-2007 9:23 PM
Hi gurus,
I have a condition where I need to delete the first row of my input file, the only problem is thta I have to take care if there is heading column in the input file then only it should be deleted, otherwise if there is data and no column heading then the row should not be deleted. Can you please suggest me how to proceed. my input file's name is itab.
Thanks
Rajeev Gupta
10-13-2007 10:57 PM
You can write simple logic :
When you get the data from File to internal table
Loop at itab.
if sy-tabix = 1. " This check is First record of internal table
if itab-field+0(3) = ' '. " Enter file header data like first 3 charcters
delete itab
clear itab.
endif.
else.
exit.
endif.
endloop.
Thanks
Seshu
10-14-2007 6:06 AM
hi,
Try this..
LOOP AT ITAB.
Check if it is the first row.
IF sy-tabix = 1.
Check if the heading is populated, then delete that row..
IF NOT ITAB IS INITIAL.
DELETE ITAB INDEX sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
Thanks
Naren
10-15-2007 5:58 AM
DELETE itab INDEX 1.
LOOP AT itab.
IF NOT itab-header IS INITIAL.
DELETE itab.
ENDIF.
ENDLOOP.