2008 Jun 18 8:32 PM
This is for loading data into ODS.
I have a flat file with footer and want to Delete/ Remove it before loading data in ODS writing code in Transfer Routine. Footer looks like:
********END OF FILE****************
How to remove this footer in the routine? Because of this I am getting error saying last record has bad data. Also how can I delete empty line?
Thanks.
2008 Jun 18 8:37 PM
hi,
if you are loading the data on to any internal table ... then do this way ..
data : v_lines type i.
describe table it_upload lines v_lines.
loop at it_upload.
if sy-tabix = v_lines.
delete it_upload index sy-tabix.
endif.
endloop.
Regards,
Santosh
2008 Jun 18 8:37 PM
hi,
if you are loading the data on to any internal table ... then do this way ..
data : v_lines type i.
describe table it_upload lines v_lines.
loop at it_upload.
if sy-tabix = v_lines.
delete it_upload index sy-tabix.
endif.
endloop.
Regards,
Santosh
2008 Jun 18 8:38 PM
HI Mau,
Assume that the data is uploaded into your internal table ITAB.
describe table itab lines count.
delete itab index count.
Regards,
Ravi Kanth
2008 Jun 18 9:03 PM
My code is like:
DATA: l_datapak like line of datapak.
Loop at datapak into l_datapak.
Condense l_datapak-Field1.
Modify datapak from l_datapak.
Endloop.
After Condense statement I want to delete the end of line which is footer (************END OF FILE************).
What should I write in the above code?
Thanks.
2008 Jun 18 9:07 PM
Just delete the last line in the LOOP.
(The CONDENSE won't help much without a MODIFY.)
Rob
2008 Jun 18 9:07 PM
try to do that:
data : lines type i.
describe table datapak lines lines.
Loop at datapak into l_datapak.
Condense l_datapak-Field1.
IF sy-tabix EQ lines.
DELETE l_datapak FROM datapak.
ENDIF.
Endloop.