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

# - Enter sign

Former Member
0 Likes
923

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
Read only

Former Member
0 Likes
762

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

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?

2 REPLIES 2
Read only

Former Member
0 Likes
762

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

Read only

Former Member
0 Likes
763

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