cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Error when using SAPRFC against a Unicode System

Former Member
0 Kudos

Hi Everybody,

I try to use the PHP SAPRFC extension against a Unicode System. When I call the client.php which comes with the source package from http://saprfc.sourceforge.net/ where I added:

			"CODEPAGE"=>"4103",                  // codepage Unicode
			"UNICODE"=>"1",                      // Unicode

to the $LOGIN array I get this error:


Warning: RFC Error Info : Group : 103 Key : RFC_ERROR_LOGON_FAILURE Message : D 
in /var/www/saprfc/client.php on line 48
RFC connection failed with error:RFC Error Info : Key : C 
Status : EXCEPTION SYSTEM_FAILURE RAISED Message : D Internal:

there are two trace files after the call. One called dev_rfc.trc with this content:

**** ERROR file opened at 20060605 050220 CEST, SAP-REL 640,0,119 RFC-VER 3 818129 MT-SL
T:1079532480 Error in program 'apache2': ======> D
T:1079532480 Error in program 'apache2': 
<* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION

and a file called rfc27443_1079532480.trc:


**** Trace file opened at 20060605 050500 CEST, SAP-REL 640,0,119 RFC-VER 3 818129 MT-SL
<<< RfcOpenEx failed 

>TS> Mon Jun  5 05:05:06 2006
resize I/O buffer to 16000 bytes
>>>> [7] <unknown>    : EXT  <ac: 74> L sapserver.test.com >>> OPEN   
UUID: ab_drvstate create uuid {44839DD5-9DCE-6B32-E200-12FDBA107532}
>>>> [7] <unknown>    : EXT  <ac: 75> L sapserver.test.com >>> 45573492 (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}


>>> RfcOpenEx ...
 Got following connect_param string: 
   ASHOST=sapserver.test.com SYSNR=00 CLIENT=002 USER=developer PASSWD=******* 
LANG=EN CODEPAGE=4103 UNICODE=1 TRACE=1 
Send RFCHEADER: 01/LIT/IEEE/SPACE/4103
Send UNICODE-RFCHEADER: cp:4103/ce:IGNORE/te:REJECT/cs:1/rc:0x00000023
UUID: send_rfcuuid {44839DD5-9DCE-6B32-E200-12FDBA107532}

 >>> Logon check: calling RFCPING 

>>> RfcCall [7] ...
*> RfcCall
  FUNCTION RFCPING
        handle = 7
        parameter   = <NULL>
        tables      = <NULL>
UUID:  RfcCallNew send the uuid to the partner {44839DD5-9DCE-6B32-E200-12FDBA107532}
>>>> [7] <unknown>    : EXT  <ac: 76> L sapserver.test.com >>> WRITE (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}
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 04363430 20001200 13000436 |.....640 ......6|
000060 | 34302000 13000800 20736172 67652D77 |40 ..... 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 10D59D83 44CE9D32 6BE20012 |........D..2k...|
000120 | FDBA1075 32051401 30000761 70616368 |...u2...0..apach|
000130 | 65320130 01110009 44455645 4C4F5045 |e2.0....DEVELOPE|
000140 | 52011101 17000D56 F94AFD31 E72211B4 |R......V.J.1."..|
000150 | 1DCED7F3 01170114 00033030 32011401 |..........002...|
000160 | 15000145 01150501 00010105 01050200 |...E............|
000170 | 00050200 0B000336 3430000B 01020007 |.......640......|
000180 | 52464350 494E4701 02051400 10D59D83 |RFCPING.........|
000190 | 44CE9D32 6BE20012 FDBA1075 320514FF |D..2k......u2...|
0001a0 | FF0000FF FF000000 00000000 00000000 |................|
>>>> [7] <unknown>    : EXT  <ac: 77> L sapserver.test.com >>> FLUSH(WRITE) (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}
<* RfcCall [7] : returns 0:RFC_OK
>>>> [7] <unknown>    : EXT  <ac: 78> L sapserver.test.com >>> FLUSH(WRITE) (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}

>>>> Listen/WaitForRequest (counter = 4)
>>>> [7] <unknown>    : EXT  <ac: 79> L sapserver.test.com >>> LISTEN (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}
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 140010D5 |................|
0001d0 | 9D8344CE 9D326BE2 0012FDBA 10753205 |..D..2k......u2.|
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 [7] : returns 0:RFC_OK

>>> RfcReceive [7] ...
Received RFCHEADER [7]: 01/LIT/IEEE/SPACE/4103
Received UNICODE-RFCHEADER [7]: cp:4103/ce:IGNORE/te:REJECT/cs:2/rc:0x00000023
UUID: ab_rfccheck_uuid compare uuid's {44839DD5-9DCE-6B32-E200-12FDBA107532}
Error in program 'apache2': ======> F
>>>> [7] <unknown>    : EXT  <ac: 80> L sapserver.test.com >>> CLOSE abrfcrcv_mt.c 429 (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}
*> RfcReceive
        handle = 7
        parameter   = <NULL>
        tables      = <NULL>
         Data conversion On

Error in program 'apache2': <* RfcReceive [7] : returns 3:RFC_SYS_EXCEPTION
>>>> [7] <unknown>    : EXT  <ac: 81> L sapserver.test.com >>> FREE abrfcio_mt.c 3517 (45573492) 
  -{44839DD5-9DCE-6B32-E200-12FDBA107532}

**** Trace file opened at 20060605 050506 CEST, SAP-REL 640,0,119 RFC-VER 3 818129 MT-SL
<<< RfcOpenEx failed 

Our SAP Environment is:

- SAP Web AS 6.20 Unicode Kernel Patchlevel 1602

- Windows 2003 Server

- Oracle

On the PHP Side I use:

- Debian GNU/Linux 3.1 (Sarge)

- Apache 2 2.0.54-5

- PHP4 4.3.10-16

- SAPRFC 1.4.1

- SAP RFC SDK non Unicode 6.20 and 6.40 (The problem occurs in both versions)

Had anyone had sucess using SAPRFC against a Unicode System?

Regards

Gregor

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hello Everybody,

if you are calling ECC release from PHP and your ECC is Unicode system,

than the easiest way to read Unicode characters is to modify file:

saprfc.php

insert below code in line 88~89 as a part of the function login();

saprfc_set_code_page ($this->rfc_conn,"4110");

4110 is the GUI code page of you SAP system.

You can check it by running SAP report RSCP0018.

Kind regards

Michal Boguszewski

Former Member
0 Kudos

Hello Everybody,

if you are calling ECC release from PHP and your ECC is Unicode system,

than the easiest way to read Unicode characters is to modify file:

saprfc.php

insert below code in line 88~89 as a part of the function login();

saprfc_set_code_page ($this->rfc_conn,"4110");

4110 is the GUI code page of you SAP system.

You can check it by running SAP report RSCP0018.

Kind regrads

Michal Boguszewski

Former Member
0 Kudos

Hello Everybody,

if you are calling ECC release from PHP and your ECC is Unicode system,

than the easiest way to read Unicode characters is to modify file:

saprfc.php

insert below code in line 88~89 as a part of the function login();

saprfc_set_code_page ($this->rfc_conn,"4110");

4110 is the GUI code page of you SAP system.

You can check it by running SAP report RSCP0018.

Kind regrads

Michal Boguszewski

gregorw
Active Contributor
0 Kudos

Because the SAPRFC Connector for PHP does not support Unicode natively you can only connect with NON-Unicode Codepages like 1100 sucessfully to a Unicode system.

Former Member
0 Kudos

hi gregor,

just a thought (haven't tested it):

in rfccal.c you find

  /* if target SAP system is >= 6.10 and has default code page 4103 or 4102, 
      it's UNICODE system */
   if ( target_codepage[0] == '4' &&
        target_codepage[1] == '1' &&
        target_codepage[2] == '0' &&
        ( target_codepage[3] == '2' || target_codepage[3] == '3') &&
        FEATURE_UNICODE(sapversion)
      ) fce->unicode = 1;

this suggests to me that it is kind of auto-detecting unicode systems.

i'd try not to set those two parameters you used (codepage, unicode) but to use

bool saprfc_set_code_page (int rfc, string codepage)

to set the codepage for the client before calling the server.

regards,

anton

gregorw
Active Contributor
0 Kudos

Hi Anton,

I've just tried your suggestion. I've commented out the CODEPAGE and UNICODE values in my Array and placed:

[code]saprfc_set_code_page($rfc, "4103");[/code]

after the

[code]$rfc = saprfc_open ($LOGIN);[/code]

The error message I get now is:

[code]Warning: RFC Error Info : Key : Status : EXCEPTION FU_NOT_FOUND RAISED Message :

Internal: in /var/www/saprfc/client.php on line 58

Discovering interface of function module RFC_READ_REPORT failed[/code]

In the trace File I see:

[code]>>>> [3] <unknown> : EXT <ac: 40> L sapserver.test.com >>> WRITE (80999721)

-{44839E3E-9E3B-6B30-E200-0534B0CD3057}

000000 | 05020000 0502000B 00063600 34003000 |..........6.4.0.|

000010 | 000B0102 00385200 46004300 5F004700 |.....8R.F.C._.G.|

000020 | 45005400 5F004600 55004E00 43005400 |E.T._.F.U.N.C.T.|

000030 | 49004F00 4E005F00 49004E00 54004500 |I.O.N._.I.N.T.E.|

000040 | 52004600 41004300 45005F00 50000102 |R.F.A.C.E._.P...|

000050 | 05140010 3E9E8344 3B9E306B E2000534 |....>..D;.0k...4|

000060 | B0CD3057 05140201 00104600 55004E00 |..0W......F.U.N.|

000070 | 43004E00 41004D00 45000201 0203001E |C.N.A.M.E.......|

000080 | 5246435F 52454144 5F524550 4F525420 |RFC_READ_REPORT |

000090 | 20202020 20202020 20202020 20200203 | ..|

0000a0 | 03010010 50004100 52004100 4D005300 |....P.A.R.A.M.S.|

0000b0 | 5F005000 03010330 00040000 00010330 |_.P....0.......0|

0000c0 | 03020008 000000D8 00000000 0302FFFF |................|

0000d0 | 0000FFFF 00000000 00000000 00000000 |................|

>>>> [3] <unknown> : EXT <ac: 41> L sapserver.test.com >>> FLUSH(WRITE) (80999721)

-{44839E3E-9E3B-6B30-E200-0534B0CD3057}

<* RfcCall [3] : returns 0:RFC_OK

>>> RfcReceive [3] ...

>>>> [3] <unknown> : EXT <ac: 42> L sapserver.test.com >>> FLUSH(WRITE) (80999721)

-{44839E3E-9E3B-6B30-E200-0534B0CD3057}

>>>> [3] <unknown> : EXT <ac: 43> L sapserver.test.com >>> READ (80999721)

-{44839E3E-9E3B-6B30-E200-0534B0CD3057}

000000 | 05000000 05000415 00044600 4C000415 |..........F.L...|

000010 | 04160002 45000416 04170006 30003400 |....E.......0.4.|

000020 | 36000417 04010018 46005500 5F004E00 |6.......F.U._.N.|

000030 | 4F005400 5F004600 4F005500 4E004400 |O.T._.F.O.U.N.D.|

000040 | 0401FFFF 0000FFFF 00000000 00000000 |................|

>>>> [3] <unknown> : EXT <ac: 44> L sapserver.test.com >>> FLUSH (READ) (80999721)

-{44839E3E-9E3B-6B30-E200-0534B0CD3057}[/code]

Regards

Gregor

Former Member
0 Kudos

Hi Gregor

i think there is some problem while getting function instance from line

<b>$fce = saprfc_function_discover($rfc, "RFC_READ_REPORT");</b>

check $fce after this line if it returns false meance it has some problem while getting instance of the function RFC_READ_REPORT