2005 Apr 26 8:06 PM
Hey,
I need to load in 400 character string of data into text using the FM SAVE_TEXT in chucks of 60 characters. If the user logs in Japanese, they could be loading in a mix of single byte and double characters. I need to be able to check if I break my string of data at the 60th character, will I be corrupting a double character.
Does anyone know how to perform this test in ABAP?
Thanks for the feedback! Bill
2005 Apr 26 8:20 PM
Hi Bill,
If you are on version 6.2+ you could try using the NUMOFCHAR( ) command.
I guess you could do something like:
* First determine the number of actual
* characters in 60th and 61st bytes.
w_num_of_chars = NUMOFCHAR( w_text+60(2) ).
* If there is only 1, then split on 59.
IF w_num_of_chars = 1.
.
.
.
* Otherwise, we have two characters so we can split at 60.
ELSE.
.
.
.
ENDIF.
I must admit I'm a complete novice when it comes to double byte languages and their handling, so that may just be complete gobbledegook.
Hope that helps.
Cheers,
Brad
2005 Apr 26 8:20 PM
Hi Bill,
If you are on version 6.2+ you could try using the NUMOFCHAR( ) command.
I guess you could do something like:
* First determine the number of actual
* characters in 60th and 61st bytes.
w_num_of_chars = NUMOFCHAR( w_text+60(2) ).
* If there is only 1, then split on 59.
IF w_num_of_chars = 1.
.
.
.
* Otherwise, we have two characters so we can split at 60.
ELSE.
.
.
.
ENDIF.
I must admit I'm a complete novice when it comes to double byte languages and their handling, so that may just be complete gobbledegook.
Hope that helps.
Cheers,
Brad