Skip to Content
0
Former Member
Jun 06, 2006 at 11:00 PM

Ruby and Unicode

98 Views

Hi Piers, Hi Everybody,

because of the better performance we continue the discussion startet in the comments to the Weblog: <a href="/people/piers.harding/blog/2006/05/18/ruby-on-rails-with-ajax">Ruby on Rails with AJAX</a> here.

To reduce possible influences I now use the test.rb script coming with the Ruby SAPRFC Lib avaliable at http://www.piersharding.com/download/ruby/. I've used the latest version saprfc-0.19.tar.gz. I added the Lines

                   :codepage => "4103",
                   :unicode => 1,

to the call of SAP::Rfc.new. The result when I call the script with "ruby test.rb" is:

GROUP    104     KEY     C       MESSAGE         F
RFC Call/Exception: Connection Failed   Error group: 104        Key: C  Message: F

the file dev_rfc.trc contains:

**** ERROR file opened at 20060605 212258 CEST, SAP-REL 620,0,1909 RFC-VER 3 748231 MT-SL
T:1076356192 ======> F
T:1076356192 <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION

in rfc31072_1076356192.trc i see:

**** ERROR file opened at 20060605 212258 CEST, SAP-REL 620,0,1909 RFC-VER 3 748231 MT-SL
T:1076356192 ======> F
T:1076356192 <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
sarge-www:/usr/local/src/saprfc-0.19/test# more rfc31072_1076356192.trc

**** Trace file opened at 20060605 212258 CEST, SAP-REL 620,0,1909 RFC-VER 3 748231 MT-SL
resize I/O buffer to 16000 bytes
>>>> [1] <unknown>    : EXT  <ac: 1> sapserver.test.com >>> OPEN
Instrument: ab_drvstate create uuid {44848493-8492-7960-E200-81FB7B3B1509}
>>>> [1] <unknown>    : EXT  <ac: 2> sapserver.test.com >>> 39277992 (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}


>>> RfcOpenEx ...
 Got following connect_param string:
   ASHOST=sapserver.test.com SYSNR=00 LANG=EN CLIENT=002 
	USER=developer PASSWD=******* TRACE=1 CODEPAGE=4103
Send RFCHEADER: 01/LIT/IEEE/SPACE/4103
Send UNICODE-RFCHEADER: cp:4103/ce:IGNORE/te:REJECT/cs:1/rc:0x00000023
Instrument: send_rfcuuid {44848493-8492-7960-E200-81FB7B3B1509}

 >>> Logon check: calling RFCPING

>>> RfcCall [1] ...
*> RfcCall
  FUNCTION RFCPING
        handle = 1
        parameter   = <NULL>
        tables      = <NULL>
Instrument:  RfcCallNew send the uuid to the partner 
{44848493-8492-7960-E200-81FB7B3B1509}
>>>> [1] <unknown>    : EXT  <ac: 3> sapserver.test.com >>> WRITE (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}
000000 | D9C6C3F0 F0F0F0F0 F0F0F0E3 01010008 |................|
000010 | 01010101 04010003 01010103 00040000 |................|
000020 | 020B0103 0106000B 04010003 01000100 |................|
000030 | 00002301 06000700 0F313237 2E302E30 |..#......127.0.0|
000040 | 2E312020 20202020 00070011 00014500 |.1      ......E.|
000050 | 11001200 04363230 20001200 13000436 |.....620 ......6|
000060 | 32302000 13000800 20736172 67652D77 |20 ..... sarge-w|
000070 | 77772020 20202020 20202020 20202020 |ww              |
000080 | 20202020 20202020 20000800 0600803C |         ......<|
000090 | 756E6B6E 6F776E3E 00000000 00000000 |unknown>........|
0000a0 | 00000000 00000000 00000000 00000000 |................|
0000b0 | 00000000 00000000 00000000 00000000 |................|
0000c0 | 00000000 00000000 00000000 00000000 |................|
0000d0 | 00000000 00000000 00000000 00000000 |................|
0000e0 | 00000000 00000000 00000000 00000000 |................|
0000f0 | 00000000 00000000 00000000 00000000 |................|
000100 | 00000000 00000000 00000000 00000000 |................|
000110 | 06051400 10938484 44928460 79E20081 |........D..`y...|
000120 | FB7B3B15 09051401 30000472 75627901 |.{;.....0..ruby.|
000130 | 30011100 09444556 454C4F50 45520111 |0....DEVELOPER..|
000140 | 0117000C A1554E98 574715B2 D5179A0C |.....UN.WG......|
000150 | 01170114 00033030 32011401 15000145 |......002......E|
000160 | 01150501 00010105 01050200 00050200 |................|
000170 | 0B000336 3230000B 01020007 52464350 |...620......RFCP|
000180 | 494E4701 02051400 10938484 44928460 |ING.........D..`|
000190 | 79E20081 FB7B3B15 090514FF FF0000FF |y....{;.........|
0001a0 | FF000000 00000000 00000000 00000000 |................|
>>>> [1] <unknown>    : EXT  <ac: 4> sapserver.test.com >>> FLUSH(WRITE) (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}
<* RfcCall [1] : returns 0:RFC_OK
>>>> [1] <unknown>    : EXT  <ac: 5> sapserver.test.com >>> FLUSH(WRITE) (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}

>>>> Listen/WaitForRequest (counter = 5)
>>>> [1] <unknown>    : EXT  <ac: 6> sapserver.test.com >>> LISTEN (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}
000000 | 01010008 01010101 04010003 01010103 |................|
000010 | 00040000 020B0103 0106000B 04010003 |................|
000020 | 01000200 00002301 06001600 08310031 |......#......1.1|
000030 | 00300030 00001600 07001E31 0030002E |.0.0.......1.0..|
000040 | 00310032 0038002E 00330036 002E0031 |.1.2.8...3.6...1|
000050 | 00350020 00200020 00000700 11000233 |.5. . . .......3|
000060 | 00001100 12000836 00320030 00200000 |.......6.2.0. ..|
000070 | 12001300 08360032 00300020 00001300 |.....6.2.0. ....|
000080 | 08004064 00650063 00720030 0034005F |..@d.e.c.r.0.4._|
000090 | 00430052 0034005F 00300030 00200020 |.C.R.4._.0.0. . |
0000a0 | 00200020 00200020 00200020 00200020 |. . . . . . . . |
0000b0 | 00200020 00200020 00200020 00200020 |. . . . . . . . |
0000c0 | 00200000 08000601 003C756E 6B6E6F77 |. .......<unknow|
0000d0 | 6E3E0000 00000000 00000000 00000000 |n>..............|
0000e0 | 00000000 00000000 00000000 00000000 |................|
0000f0 | 00000000 00000000 00000000 00000000 |................|
000100 | 00000000 00000000 00000000 00000000 |................|
000110 | 00000000 00000000 00000000 00000000 |................|
000120 | 00000000 00000000 00000000 00000000 |................|
000130 | 00000000 00000000 00000000 00000000 |................|
000140 | 00000000 00000000 00000000 00000000 |................|
000150 | 00000000 00000000 00000000 00000000 |................|
000160 | 00000000 00000000 00000000 00000000 |................|
000170 | 00000000 00000000 00000000 00000000 |................|
000180 | 00000000 00000000 00000000 00000000 |................|
000190 | 00000000 00000000 00000000 00000000 |................|
0001a0 | 00000000 00000000 00000000 00000000 |................|
0001b0 | 00000000 00000000 00000000 00000000 |................|
0001c0 | 00000000 00000000 00000605 14001093 |................|
0001d0 | 84844492 846079E2 0081FB7B 3B150905 |..D..`y....{;...|
0001e0 | 14050000 00050004 03002E43 0041004C |...........C.A.L|
0001f0 | 004C005F 00460055 004E0043 00540049 |.L._.F.U.N.C.T.I|
000200 | 004F004E 005F004E 004F0054 005F0046 |.O.N._.N.O.T._.F|
000210 | 004F0055 004E0044 00040304 02004046 |.O.U.N.D......@F|
000220 | 0075006E 00630074 0069006F 006E0020 |.u.n.c.t.i.o.n. |
000230 | 006D006F 00640075 006C0065 00200022 |.m.o.d.u.l.e. ."|
000240 | 00524643 50494E22 0020006E 006F0074 |.RFCPIN". .n.o.t|
000250 | 00200066 006F0075 006E0064 002E0004 |. .f.o.u.n.d....|
000260 | 02FFFF00 00FFFF00 00000000 00000000 |................|
<* RfcListen [1] : returns 0:RFC_OK

>>> RfcReceive [1] ...
Received RFCHEADER: 01/LIT/IEEE/SPACE/4103
Received UNICODE-RFCHEADER: cp:4103/ce:IGNORE/te:REJECT/cs:2/rc:0x00000023
Instrument: ab_rfccheck_uuid compare uuid's {44848493-8492-7960-E200-81FB7B3B1509}
======> F
>>>> [1] <unknown>    : EXT  <ac: 7> sapserver.test.com >>> 
	CLOSE abrfcrcv_mt.c 400 (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}
*> RfcReceive
        handle = 1
        parameter   = <NULL>
        tables      = <NULL>
         Data conversion On

<* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
>>>> [1] <unknown>    : EXT  <ac: 8> sapserver.test.com >>> 
	FREE abrfcio_mt.c 3245 (39277992)
  -{44848493-8492-7960-E200-81FB7B3B1509}

**** Trace file opened at 20060605 212258 CEST, SAP-REL 620,0,1909 
	RFC-VER 3 748231 MT-SL
<<< RfcOpenEx failed

It looks exactly like the problem I've described in the Topic: RFC Error when using SAPRFC against a Unicode System Forum.

I have real doubts that it will work because there is a special Unicode RFC SDK avaliable. Why should it work to connect with the Non Unicode Version.

Regards

Gregor