cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to remove '#' (hash) from text line in print output ?

vinayad
Participant
0 Kudos
1,677

Hi all,

Any help would be appreciated !

When I tried to print the order, I am getting # (hashes) at last in the text line.

Please help me, how to remove this.

I tried this code, but did not work.

REPLACE ALL OCCURRENCES OF '#' in wa_text_line WITH ' '.

Accepted Solutions (0)

Answers (3)

Answers (3)

Akshay_Anil
Explorer
0 Kudos

Hi All,

While working in ABAP, especially when preparing data for file downloads or exporting internal tables, you might notice that some lines seem to end with a " # " symbol. But here's the catch  that " # " is not always a real hash symbol. Naturally, you might think it’s a hashtag — but often, it’s not. These characters don’t display visually, but depending on how the file is opened or downloaded, they may appear as strange or misleading symbols.

Check out my post for a detailed explanation of How to Remove Hashtag (#) Using ABAP – It’s Not Always a Hashtag! 

I hope this helps! Let me know your thoughts or if you have any questions.
Thanks,

Akshay Anil   Linkedin Profile
Technical Consultant, SAP ABAP | BTP | Fiori | Ui5

vinayad
Participant
0 Kudos

Use this FM - 'CONVERT_STREAM_TO_ITF_TEXT', it eliminates the unwanted special character if it is present especially when you have used cl_abap_char_utilities=>cr_lf in your program.

Thank you Sandra Rossi

FredericGirod
Active Contributor
0 Kudos

Would be nice to know how you read the text

the end of line char should be CL_ABAP_CHAR_UTILITIES=>CR_LF

vinayad
Participant
0 Kudos
frdric.girod Thanks for you response.

Yes, I have concatenated CL_ABAP_CHAR_UTILITIES=>CR_LF to the text