Application Development 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: 

# - Enter sign

Former Member
0 Kudos
374

Hello,

I've written a BSP application with an input field of type string. (textbox).

In the OnInputProcessing, I update a db table with the string value. The field on the db is also of type string.

Problem : every enter the user has done on the textbox, comes through as a # sign and is also stored like that on the db table.

When rendering the text again in the BSP, the # signs actually show as a character. How do I (1) read the # (you cant search for '#' - it does'nt recognize it), and (2) replace is with a space?

Note : this is not related to BSP's, but to any 'string' field. I've come across this in ABAP & Java also.

What ABAP statement would recognise the # or enter sign?

Does anyone know?

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
213

The # is actually a newline or a line feed character.

try to replace it by a space using replace command.

replace all occurances of CL_ABAP_CHAR_UTILITIES=>NEWLINE with space in v_msg.

or

replace all occurances of CL_ABAP_CHAR_UTILITIES=>CR_LF with space in v_msg.

Regards,

Ravi

2 REPLIES 2

Former Member
0 Kudos
213

Hi Charamine,

The replacement of # with space can be done in ABAP with the statement REPLACE.

<b>REPLACE '#' WITH SPACE IN DBFIELD.</b>

But I recommend you not to have # at the end of the field when it goes into database rather than changing this # into space at all times in your program.

After getting the value from text box, Use the REPLACE statement before you enter the value into DATABASE.

Thanks,

Vinay

former_member181962
Active Contributor
0 Kudos
214

The # is actually a newline or a line feed character.

try to replace it by a space using replace command.

replace all occurances of CL_ABAP_CHAR_UTILITIES=>NEWLINE with space in v_msg.

or

replace all occurances of CL_ABAP_CHAR_UTILITIES=>CR_LF with space in v_msg.

Regards,

Ravi