Purpose:
The 'toMultiByte' command is used to encode text returned by a call command into multibyte characters so that a non-Unicode R/3 system can process the data.
Syntax:
var z_DesiredText = "original_string";
var z_ToSendToRFCCall = "IPC"+toMultiByte(z_DesiredText);
Note: The 'z_DesiredText' value contains the characters that will be changed to multibyte. The 'z_ToSendToRFCCall' variable contains the value after it has been changed into multibyte characters.
Options:
The toMultiByte() command does not take any options.
Example:
The following example demonstrates the command usage:
Open the script file for the SAP Easy Access screen and enter the following code.
for(a=firstChild; a!=null; a=a.nextSibling)
a.del( );
var z_abc = "*お化け屋敷*";
To correct this problem, you will use the toMultiByte() command in your script. The non-unicode characters in the string would be converted to multibyte character representation, for a non-unicode R/3 server to interpret the data correctly. The revised code is:
for(a=firstChild; a!=null; a=a.nextSibling)
a.del( );
var z_abc = "*お化け屋敷*";
var z_ToSendToRFCCall = "IPC"+toMultiByte(z_abc);