cancel
Showing results for 
Search instead for 
Did you mean: 

unicode issue jdbc receiver adapter

Former Member
0 Kudos

Hi guys,

I'm facing an unicode issue while trying to put some data into a MS database.

The sender system is a SAP ERP 6.0 system.

When we are trying to transfer some text in polish or korean or something else, this textes are not transferred correctly.

I already checked the SAP Note 831162 FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter

and used the url parameter sendStringParametersAsUnicode=true

Furthermore I changed my mapping to get the sql statements, so that I add the attribute hasQuot="no"

and a leading N in front of the data string as described in the Note and in some threads in SDN

but nothing solved my problem.

any ideas?

Do all the languages have to be installed on the XI system?

Kind regards

Jochen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In R3, check the RFC pointing to XI is unicode enabled or not, make it unicode and then try. I have assumed that you are sending the IDOC from ECC.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi guys,

thanks for your tips.

I asked an colleague for changing the rfc destination enabling unicode)

unfortunately this parameters are deactivated, he tried to change the existing,

copy it to a new one and creating a new one from the scratch

nothing worked.

I don´t know if our XI system can handle unicode correctly. How to check this?

I tested following.

I have an idoc with different texts of different languages in ECC 6.0.

depending on the log on language the texts are displayed correctly in the we05.

If I log on in german or english (this are the two languages installed on xi system)

the texts looked the same, they do in XI system.

I took a deeper dive to the payload using ultra edit and have a look at the bytes of the text.

the byte seemed to be encoded using the codepage ISO8859-2

I also tried to get the wright encoding in mapping with a UDF

result =  new String(text.getBytes(), codepage);

are there more possibilities to get the strings wright to the database?

kind regards

Jochen

Former Member
0 Kudos

Hi,

I was facing the same problem with japnise and chinese characters in few IDOC segments element, I have changed the unicode in R3 and it worked for me.

I suggest ask ur basis person to change the same and then try again.

chirag

Former Member
0 Kudos

Hi chirag,

thanks for your help.

could you please tell me, what exactly we have to change in R/3??

Kind regards

Jochen

Former Member
0 Kudos

You can also try with creating external definiton of IDOC. Before creating the external definiton change the encoding (ISO-8859-2) in your text file which contains the IDOC xsd on you local machine and then create the external definition.

Former Member
0 Kudos

Hi,

In r3 SM59- change the encoding to unicode for the RFC destination pointing to XI.

chirag

Former Member
0 Kudos

>I asked an colleague for changing the rfc destination enabling unicode)

>unfortunately this parameters are deactivated, he tried to change the existing,

>copy it to a new one and creating a new one from the scratch

>nothing worked.

>

Hi chirag,

I already asked my colleague to change the rfc connection and enable unicode.

unfortunately he told me that this is not possible.

the option is deactivated, so he can´t change it.

how could I change this parameter in sm59?

kind reagards

Jochen

prateek
Active Contributor
0 Kudos

Sm59 in R3 -> Goto the ABAP type RFC destination pointing to XI -> under MDMDP & Unicode tab -> Change the Communication type from Non-unicode to Unicode.

Regards,

Prateek

Former Member
0 Kudos

I think u dont have authorization to change the same, thats why i have mentioned that ask basis people to make the necessary changes.

chirag

Former Member
0 Kudos

Hi,

I think the system from which you are sending the IDOC is installed as a non-unicode system and this is the reason you do not have the option the chose unicode in your RFC. There are two kind of installations, one is unicode (for all language) and other is non-unicode. Please check with your basis team to confirm this.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

you are wright. The system is admittedly a unicode system, but unique is not used (active) yet. The system has been migrated to ECC this year, migration

to unicode is planned for next year.

Therefore I need a solution or work around for this scenario.

I get the text from ECC in special codepage. For poland I found out that it see to be ISO-8859-2 (checked with ultra edit)

In message mapping I wrote UDF that converts the incoming (variable text string to my local codepage during map (it should be UTF-8 isn´t it???)

I tested my this functionallity in eclipse.

String text = "D³ugo¶æ ca³kowita Tl; L:";  //payload from incoming message from ECC 6.0
String t1 = new String(text.getBytes(), "ISO8859_2");

I checked the value 0f t1 during debugging in eclipse and it contains the correct text.

but when I try it in message mapping the result is D?ugo?? ca?kowita Tl; L: instead of Długość całkowita Tl; L:

whats wrong with the UDF??

kind regards

Jochen

Edited by: Jochen Gugel on Oct 13, 2008 4:07 PM

Former Member
0 Kudos

Take the message mapping result into some text editor and there change the encoding and see if the data looks as you want, then in that case the result in mapping is ok.

Former Member
0 Kudos

Hi Sarvesh,

thanks for helping.

Unfortunately I´m not sure what I should exactly do.

If I get you wright I have to test the mapping using the test functionality in message mapping (test tab).

I did this already

The result message looks like this

<?xml version="1.0" encoding="UTF-8"?>
<ns0:IDOC_CDB_IMPORT_insert xmlns:ns0="http://endress.com/xi/sbo/cdb">
   <ns0:StatementName1>
      <ns0:dbTableName action="insert">
         <ns0:table>CFG.DBO.IDOC_CDB_IMPORT</ns0:table>
         <ns0:access>
            <ns0:IDOC>CHRMAS</ns0:IDOC>
            <ns0:SEGMENT>E1CABTM</ns0:SEGMENT>
            <ns0:ATNAM></ns0:ATNAM>
            <ns0:SPRAS>PL</ns0:SPRAS>
            <ns0:ATBEZ hasQuot="no">N&apos;D?ugo?? ca?kowita Tl; L:&apos;</ns0:ATBEZ>
         </ns0:access>
      </ns0:dbTableName>
   </ns0:StatementName1>
</ns0:IDOC_CDB_IMPORT_insert>

How to proceed?

copy this message to notepad or ultra edit and then doing what?

please specify clearly.

this message will be send to the jbdc adapter and this will insert it to database.

<ns0:ATBEZ hasQuot="no">N&apos;D?ugo?? ca?kowita Tl; L:&apos;</ns0:ATBEZ>

will end up in a table entry like D?ugo?? ca?kowita Tl; L:

has anybody an idea how I will get the wright characters in database, when I test my UDF in eclipse, the variable during debugging has the correct text.

When output this variable via system.ou.print(text); the same issue occurs, the special characters are shown as ?.

I appreciate for your help, unfortunately my polish colleagues hustle a little bit.

kind regards

Jochen

Former Member
0 Kudos

Hi @ll,

some more infos to my scenario.

several textes in different languages are tranfered in one idoc. Obviously this texts are encoded in different codepages e.g.

for polish IS0-8859-2

and I have to tranfer this texts with as unicode in a MS database.

I tested a message transfer without mapping, just throuput the jdbc xml to PI and to the database.

In that case the textes are tranferred successfully to the database.

here is my sample input message

<?xml version="1.0" encoding="UTF-8"?>
<ns0:IDOC_CDB_IMPORT_insert xmlns:ns0="http://endress.com/xi/sbo/cdb">
   <ns0:StatementName1>
      <ns0:dbTableName action="insert">
         <ns0:table>CFG.DBO.IDOC_CDB_IMPORT</ns0:table>
         <ns0:access>
            <ns0:IDOC>CHRMAS</ns0:IDOC>
            <ns0:SEGMENT>E1CABTM</ns0:SEGMENT>
            <ns0:ATNAM/>
            <ns0:SPRAS>PL</ns0:SPRAS>
            <ns0:ATBEZ hasQuot="no">N&apos;Du0142ugou015Bu0107 cau0142kowita Tl; L:&apos;</ns0:ATBEZ>
         </ns0:access>
      </ns0:dbTableName>
   </ns0:StatementName1>
</ns0:IDOC_CDB_IMPORT_insert>

any ideas?

kind regards

Jochen

Former Member
0 Kudos

Hi guys,

it seems that the issue is solved now.

We changed the UDF for converting the incoming texts to unicode.

Obviously the texts of different languages are encoded in different languages. On top of that the whole message (idoc)

is also encode using the codepage ISO-8859-1 while sending it to XI.

So the texts have to be decoded twice, first from ISO-8859-1 to the special codepage for the language and then

to UTF-8.

Thanks for helping.

Kind regards

Jochen

Former Member
0 Kudos

Could you please assign point to those ans which helped you to solve your problem.

Regards,

Sarvesh

former_member183906
Active Contributor
0 Kudos

XI should be in encoding ISO-8859-1. Or try with UTF-16

Also, please check if your SAP XI is configured for unicodes.

RFC destination (SM59), check for unicode test after Unicode enable.

In RFC destination,User Id in XI with password in CAPS and try with this user Id. Also take care of the length of the user Id, since there is a restriction in lower version.Make sure to assign the necessary roles to the user Id.

Former Member
0 Kudos

hi,

maintain ur RFC destination pointing to Xi in R3 system to unicode.

and then check.

can u tell me in ur moni payload, does this language changes to hash characters.

chirag

Edited by: Chirag Gohil on Oct 13, 2008 5:25 PM