Skip to Content
author's profile photo Former Member
Former Member

Delete footer / last record from CSV file

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.