2008 Jun 27 3:59 PM
Hi everybody
I tried to create a message for an internal abap ticket system.
The message is entered by an user on a bsp site. The Function module i have to use only takes the message as a table of char200 lines. So i have to put every 200 chars in another line of the table.
The problem is: I can't recognize the line breaks of the HTML. They are in the String from the site as ##. I tried the following: The split statement does not recognize the ## and does not split properly. can anyone please help? help will be rewarded!
while split_while = 'X'.
clear lwa_text2.
lwa_text = lv_html.
replace all occurrences of lwa_text in lv_html with ''.
"add new lines on '##'
split lwa_text at '##' into table lt_split in character mode.
if lt_split is initial.
loop at lt_split into lwa_text.
append lwa_text to lt_text.
endloop.
else.
append lwa_text to lt_text.
endif.
if lv_html is initial.
clear split_while.
endif.
endwhile.THANKS a lot !
Best Regards
2008 Jun 27 4:09 PM
Try to use the CL_ABAP_CHAR_UTILITIES=>CR_LF instead of ##.
use:
split lwa_text at CL_ABAP_CHAR_UTILITIES=>CR_LF into table lt_split in character mode.
instead:
split lwa_text at '##' into table lt_split in character mode.
Regards,
Joy.
Hi everybody
I tried to create a message for an internal abap ticket system.
The message is entered by an user on a bsp site. The Function module i have to use only takes the message as a table of char200 lines. So i have to put every 200 chars in another line of the table.
The problem is: I can't recognize the line breaks of the HTML. They are in the String from the site as ##. I tried the following: The split statement does not recognize the ## and does not split properly. can anyone please help? help will be rewarded!
while split_while = 'X'.
clear lwa_text2.
lwa_text = lv_html.
replace all occurrences of lwa_text in lv_html with ''.
"add new lines on '##'
split lwa_text at '##' into table lt_split in character mode.
if lt_split is initial.
loop at lt_split into lwa_text.
append lwa_text to lt_text.
endloop.
else.
append lwa_text to lt_text.
endif.
if lv_html is initial.
clear split_while.
endif.
endwhile.THANKS a lot !
Best Regards
2008 Jun 27 4:09 PM
Try to use the CL_ABAP_CHAR_UTILITIES=>CR_LF instead of ##.
use:
split lwa_text at CL_ABAP_CHAR_UTILITIES=>CR_LF into table lt_split in character mode.
instead:
split lwa_text at '##' into table lt_split in character mode.
Regards,
Joy.
2008 Jun 27 4:10 PM
SAP usually uses the # symbol for special characters that it can't interpret. Try having a look in class CL_ABAP_CHAR_UTILITIES at the attributes. A common one is the Carriage Return / Line Feed characters.
2008 Jun 27 4:13 PM
You can use FM "RKD_WORD_WRAP" to split the text
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = wa_final-ldesc
outputlen = 72
TABLES
out_lines = i_outlen
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
2008 Jun 27 4:15 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |