Author Topic: Using toMultiByte Command  (Read 1898 times)

Sabir Mohammad

  • Administrator
  • Newbie
  • *****
  • Posts: 52
    • View Profile
Using toMultiByte Command
« on: August 17, 2017, 11:09:28 AM »
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);