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

How to get rid of '#' in ABAP program ?

Hi, Gurus:

Our ABAP report reads flat file, the file is created by a legacy system.

Previously, it works fine.

Recently, the each line of file ended with symbol '#'.

We want to get rid of it, but not lucky:

We have tried using replace it with '', and tried using SHIFT by one space, all does not work.

Any one have good suggestion ?

Thanks in advance.

Liang

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Dec 23, 2008 at 04:11 AM

    Hi,

    Get the length of the record for each line & reduce the length by 1.

    loop at gt_tab into watab.
    delete trailing spaces of wa_tab-data.........
    lv_len = strlen(wa_tab-data),
    lv_len = lv_len - 1.
    lv_data = wa_tab-data+0(lv_len).  " lv_data will have the data without #
    ..........
    .............
    .............
    endloop.

    Best regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 23, 2008 at 12:08 AM

    Yes, try to replace the CR_LF character.

    For example.....

    replace CL_ABAP_CHAR_UTILITIES=>CR_LF  with space in v_string.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Create a file on your own... Don't try to copy the values from the existiung file. You key in the values on your own... SAVE it and upload it using the same program.

      This is to check whether "content of the file" coming from Legacy file is Compatible with SAP or not.

      May be this would help you to find the root cause...

      Regards

      Mohan.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 02:45 AM

    when you read line , you can use subtr to remove the last chacterif it is '#'.

    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.