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: 

Problems with unicode in RFC

former_member308319
Participant
0 Kudos

Hello, actually, I have a function with the functionality of SAP RFC, this function send a itab where there a field type string that contains characters specials, on SAP, the data if be see good, but in PHP only I can see this #.

Note: my sap has in no unicode (SM59).

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

3. About the code page, in the RFC destination, you should have a field "explicit code page" in the tab "unicode". Could you change it to one of the frequent values like 1100, 4110, 4102, 4103, 0120, and test.

5. Could you tell us which default code page is used by click the menu Extras -> system information -> target system -> field "character set" ?

6. But anyway, I'm surprised that all your characters are #. Could you get the hex value of values received in PHP, and the characters(hex value not needed) sent from ABAP?

11 REPLIES 11

Sandra_Rossi
Active Contributor
0 Kudos

It looks like a character encoding issue.

Does it happen for all characters?

Did you play with SM59 customizing, in "Unicode" tab? You may for instance change the # character to another one (choose "ignore conversion errors", and set % as replacement character), to see whether you then see % in your PHP. If yes, it means you may try to change the code page to something like 1100, etc.

0 Kudos

Thanks Sandra, Yes I did, I played with the characters in SM35  in "Unicode" tab, but follow showing a # for all characters I tryed with %

0 Kudos

Does it happen for all characters?

You used % and you got # , really?

Did you try with other code page?

Sorry for repeating my questions.

0 Kudos

1. Yes, it does for all characters.

2. Yes, I used both options % and #, but all time I obtain only a #, changed or not the value # in SM35.

3. I don't understand well your question, sorry.

4. Don't worry, to contrary, thanks for your help!

Sandra_Rossi
Active Contributor
0 Kudos

3. About the code page, in the RFC destination, you should have a field "explicit code page" in the tab "unicode". Could you change it to one of the frequent values like 1100, 4110, 4102, 4103, 0120, and test.

5. Could you tell us which default code page is used by click the menu Extras -> system information -> target system -> field "character set" ?

6. But anyway, I'm surprised that all your characters are #. Could you get the hex value of values received in PHP, and the characters(hex value not needed) sent from ABAP?

0 Kudos

3. Sorry but I don't find "explicit code page",  is the option where says u+0022?

4. I can't to see this, appear me a error that said "Error when opening an RFC connection "

5. If my character is like a "á,é,í,ó,ú", I get a "0"

0 Kudos

3. Yes, same screen as U+0022. Weird. Could you send a screenshot? Do you have a Unicode SAP system? What is your SAP release?

4. Weird. If you ping it, does it work? What kind of RFC destination is it? TCPIP? Could you confirm that you have an ABAP code which calls a PHP function, or is it a PHP function which calls an RFC function module?

6. Your answer is different from your first one. So, you get a "0" for these accentuated letters, and # for all other characters? Can't you get the hexadecimal values of what you receive? (something like var_dump(bin2hex($variable))

0 Kudos

3.Ok, with all codes I get the next message "cannot identify unicode

characters". I am working in SAP ECC 6.0.

4. Is an ABAP fuction that is invoked of PHP. The conection is trough IP adress.

6. I only receive a 0 if the character is accentuated, else contrary I receive a number like 123432 etc..

0 Kudos

OK sorry, I had understood the opposite.

Then I'm afraid I don't understand why you need an RFC destination.

I think the code page is maintained in your SAPRFC PHP configuration, cf this thread () :

  • 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.

0 Kudos

You are amazing, this solved my problem. Thank you so much Sandra!

0 Kudos

Good to know! And thanks to Michal 😉