Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect with a japanese username to a unicode SAP system via RFC

Former Member
0 Kudos

Hello everybody,

I try to connect with a japanese username to a unicode SAP system. I tried it with different codepages and PCS settings (1/2) too but i always get the error:

"Name or password is incorrect (repeat logon)"

I use VC++ and make the call like this:

BYTE utf8_byteArray10 = {0xE3, 0x81, 0x8A, 0xE3, 0x81, 0x99, 0xE3, 0x81, 0x99, 0x00 };

CString sJapUser(utf8_byteArray);

sConnectParam.Format( cU("CLIENT=%s USER=%s PASSWD=%s LANG=%s SYSNR=%d ASHOST=%s PCS=2"),

"800",

sJapUser,

"password",

"EN",

1,

"9.22.104.145");

hRfc = ::RfcOpenEx( (char*)(LPCTSTR)sConnectParam, &error_info);

When I connect to a non unicode japanese system in locale encoding it works.

Another thing i saw is that the utf8 string is truncated after 12 bytes (12 character/bytes is the limit of user name length). When I use a japanese username with 6 japanese symbols (18 bytes in utf8) I see the following in the RFC trace:

rfcOpenHooked

destination <unknown>

mode 3

conopt 3 hostname 9.22.104.145

conopt 3 sysnr 1

conopt 3 use_l_bal 0

conopt 3 use_sapgui 0

client 800

user おすすめ (here the username misses 2 japanese characters)

language E

trace 0

L-GetCodePage (DEFAULT-CP) rc = 0: 1100

...

...

...

Here the username is correct:

RfcOpenEx ...

Got following connect_param string:

CLIENT=800 USER=おすすめダウ PASSWD=******* LANG=EN SYSNR=1 ASHOST=9.22.104.145 CODEPAGE=4110 PCS=2

Send RFCHEADER: 01/LIT/IEEE/SPACE/4110

Send UNICODE-RFCHEADER: cp:4110/ce:IGNORE/et:5/cs:1/rc:0x00000023

...

...

...

In the RFC trace the username is truncated (only 12 bytes(4 characters) instead of 18 bytes (6 characters))

000160 | 44657369 676E0130 0111000C E3818AE3 |Design.0........|

000170 | 8199E381 99E38281 01110117 000C905F |..............._|

000180 | E417BBAC 1DDD543E CE540117 01140003 |......T>.T......|

To connect with japanese usernames using the SAP-GUI works fine but the rfc traces show that the connection is established in another way.

Can anyone help me with this or is it just impossible to use japanese usernames for logon with RFC.

Thank you in advance.

1 REPLY 1

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Verena,

I think you already know, but maybe it is also interesting for other readers: Please have a look at SAP note 1236565.

In general my recommendation would be to use US7ASCII based user names whenever possible (regardless of Unicode or Non-Unicode systems).

Best regards,

Nils Buerckel

SAP AG