on 10-11-2011 8:50 AM
Hi Experts,
I have a comment box on the UI where the user can type a longtext. This is saved as a string. Later, this string is used to create a text with SAVE_TEXT. My problem is that the formatting information is lost somehow, especially the carriage return (newline) information.
Example:
longtext:
This is text
Text on second line
Text on third line
after using SAVE_TEXT:
This is textText on second lineText on third line
So I need to preserve the newline. I have tried
split lv_string at cl_abap_char_utilities=>cr_lf
that does not work.
Similarly, function module CONV_TEXTSTRING_TO_ITF does not work either.
Any suggestions?
Thanks, Ira
Hi ira ,
When you use dialog for multiple line text . There it mogth not be storing Line feed character . so you have to Divide Those String by maintaining certain standard of Special Character while Breaking the line .
Can you tell me What you are using as Dialog for entering data .
Hope we all can come up with good Solution .
regards
Deepak.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use CL_ABAP_CHAR_UTILITY with CR_LF and split the string...
Hope this might help..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Check spliting the string with NEWLINE .
i.e
CONSTANTS :c_tab type ABAP_CHAR1 value CL_ABAP_CHAR_UTILITIES=>NEWLINE .
split t_text at c_tab into t_text1 t_text2 in CHARACTER MODE.
regards
Deepak.
Edited by: Deepak Dhamat on Oct 11, 2011 11:50 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello experts,
I have tried all your suggestions but nothing works.
Splitting at cl_abap_char_utilities=>cr_lf does not work. Same for cl_abap_char_utilities=>newline.
Trying an own "cr_lf" based on what I see in the debugger in the hex representation also does not work. That is because my string is in character mode, and if I try to convert to Xstring then my "own_crlf" also gets converted and has some different value. And in one split statement I cannot mix variables in char and byte mode.
Any other ideas?
Thanks, Ira
Hi,
are u using string table to collect the contents? try to use as below,
DATA : it_string TYPE string_table.
CONSTANTS: crlf TYPE string VALUE cl_abap_char_utilities=>cr_lf.
SPLIT lv_content AT crlf INTO TABLE it_string.
Thanks,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ira ,
DO you find any special Character in string .
regards
Deepak.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt,
The example was created by me. So yes, I'm sure that newline was pressed. The text can also wrap sometime, but for sure I need to detect when the newline has been pressed.
This comes from Adobe Interactive form. The comment box on the form is then evaluated by looking at the XML representation. This then gives me the text in string form.
I have not analyzed the binary representation because I did not know how or what to look for.
Any suggestions?
Ira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If lv_string is receiving the value from the xml without the CR, then the solution probably doesn't exist within the ABAP environent. Maybe there's something in the way you've defined the text box that is stripping these characters out.
If you like, I'll move the thread to the Adobe Interactive Forms forum, where you might get more specialist help, then people repeatedly suggesting that you use split...
Are you sure newline is pressed, and the text isn't wrapping? What UI are you using - Dynpro, Web Dynpro, BSP? Have you debugged the source and checked the hex representation of lv_string?
matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.