Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

String variable print in smartform

Former Member
0 Likes
523

Hi,

We have created a Z field with variable type as String. while saving, after 255 characters, it adds a hesh sign # itself and if user presses enter while typing text in this variable, it saves it with two hesh sign. we have used customized control text area to let user put unlimited length of text in this variable.

The issue is, when we print this variable in smartform, this hesh is printed. Replace function also does not replace it. How do we remove this? is there any FM to print string variable as user saved it?

Thanks,

Binita Joshi

1 REPLY 1
Read only

anup_deshmukh4
Active Contributor
0 Likes
356

Hello Binita,

You will have to remove the Formatting Characters for example TAB , enter and Carriage Return,

They are saved as a  Code and are denoted by # in  string

You can do it by replacing such thing by using 'REPlACE ALL OCCURANCES OF cl_abap_char_utilities=>horizontal_tab  <string>'  .

You can try replacing all Atrributs of class cl_abap_char_utilities CR_LF , NEW_LINE ...and no on

Hope this helps,

anup Deshmukh