cancel
Showing results for 
Search instead for 
Did you mean: 

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

vinayad
Participant
0 Kudos

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 ' '.
jmodaal
Active Contributor
0 Kudos

Hello,

'#' in the printout can be any character that does not fit into the used codepage. I guess that's why your replace does not work. It's not a #, it's some 'non printable' character. Try to find out what exactly it is in a debug session.

vinayad
Participant
0 Kudos

jmodaal

Thanks for your response !

that character is cr_lf.

jmodaal
Active Contributor
0 Kudos

Hello,

ah, ok. A print out of a string does not consider cr_lf. I think for printing it with cr_lf you have to split the string.

REPORT z_test_crlf.
data: teststr type string,
testTable type standard table of string.
concatenate 'Line 1' cl_abap_char_utilities=>cr_lf 'Line 2'
cl_abap_char_utilities=>cr_lf 'Line 3' into teststr.
write:/ 'Despite of cr_lf, the printout is in one line:', teststr.
split teststr at cl_abap_char_utilities=>cr_lf into table testTable.
write:/ 'This works:'.
loop at testTable assigning field-symbol(<line>).
write:/ <line>.
endloop.
raymond_giuseppi
Active Contributor
0 Kudos

So you didn't use anu of the solutions proposed in your previous question?

Which tool do you use to print the long text?

vinayad
Participant
0 Kudos

Raymond Giuseppi

Thanks for your response.

I have modified the code, it was working fine

CONCATENATE wa_text-text v_crlf INTO i_order_text-text_line.

but now in the print output it is displaying # (i.e., cr_lf)

In SAPScript

Accepted Solutions (0)

Answers (2)

Answers (2)

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