2006 Jul 03 12:14 PM
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?
2006 Jul 03 12:27 PM
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
2006 Jul 03 12:18 PM
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
2006 Jul 03 12:27 PM
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