cancel
Showing results for 
Search instead for 
Did you mean: 

Special character issue in MDM to JMS scenario

Muniyappan
Active Contributor
0 Kudos

HI All,

My scenario is MDM to JMS in PI7.1 EHP 1. Users create and access the mdm data using webdynpro java screens. when creating data some special characters also comes to MDM.

Any create or update happens in MDM record will get sysdicated to PI.

we have received the xml file which contains special character. but is not failing in PI. it is successfully getting processed from PI.

when i viewed the xml file in message mapping and internet explorer the special character is not visible. but when i opened it in wordpad i can be able to see the special character.

For example : “ is appears same if i open the payload in internet explorer and message mapping.

if the open same payload in wordpad it appears like this “.

JMS team does not want to receive the special character.

MDM team has suggested to implement the sap note 800354 to overcome this issue.

can anyone suggest me how to overcome this issue?

why does that special character is not appearing correct in message mapping?

Regards,

Muniyappan.

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi ,

PI handles nearly 60 special charaters, if you dont want special characters then ask sender system team to correct it and ask them to send correct data.

If you want to do it in PI then try below aproach.

1)Create JAVA mapping and convert pay load to one string.

2)use regular expresions to replace special characters with required value.

Search in scn/google you will find sample code.

Regards,

Raj

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

What is the sender adapter used ?

Thanks,

Sudhansu

anupam_ghosh2
Active Contributor
0 Kudos
Hi Muniyappan Marasamy,

                                           First of all install a HEX editor in your system from this link. http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

Now find out the exact ascii value of the character causing trouble.

If you are not getting ASCII HEX value of 22 for the character  " then replace the occurence of strange  charcaters with proper character in mapping using UDF as shown.

filed---->UDF----->field

Lets say for example you wanna replace all charcaters '1' from a string with character ".

First find out what is the ASCII value of 1 which is 0X31.

Thus I would write  a code like this

public static String replaceASCII(String s)

{

  String a="";

  int b=0X31;// ascii value for "1"

  int l=s.length();

  for(int i=0;i<l;++i)

  {

   if((int)s.charAt(i)==b)

   {

    a=a+'"';

   }

   else

   {

    a=a+s.charAt(i);

   }

  }

  return a;

}

Thus for input

"2134512"

I will get oputput as

"2"345"2"

You can remove the chars(instead of replace) in similar way:- just delete the line of code under "if" clause. Hope this resolves the issue.

Regards

Anupam

Muniyappan
Active Contributor
0 Kudos

Hi Anupam,

Payload has nearly 800 fields in which 200 fields are having this issue. To overcome this issue do i have to do mapping for 200 fields. is it good to do that?

Regards,

Muniyappan.

Former Member
0 Kudos

Hi Muniyappan Marasamy,

If you are having only one type of sequence of Special characters in multiple fields, then write one Java Mapping; where you convert all the occurances of special character sequences to blank. And use this java mapping in operation mapping before message mapping.

Regards,

Arindam

Former Member
0 Kudos

Hi Muniyappan,

You need to write one Java map and use function ReplaceAll to convert all the special characters of your input payload. use this java map before the existing map.

Regards,

Arpan

Muniyappan
Active Contributor
0 Kudos

Hi Arpan,

if i need to overcome this issue using java code i don't have to write it in PI.

we have java webdynpro team they can take care at screen level. i was just looking some adapter parameter settings or notes which will solve this issue. thanks for you reply.

Regards,

Muniyappan.

Harish
Active Contributor
0 Kudos

Hi,

you can set the parameter srcEncoding and dstEncoding at adapter level (JMS receiver adater for dstEncoding).

Regards,

Harish

anupam_ghosh2
Active Contributor
0 Kudos

Hi Muniyappan Marasamy,

                        If you want to avoid java mapping and you want to do correction within SAP-PI server then you need UDF for all the fields. In any case you are having a messsage mapping, now you need to put an extra UDF in field mapping.

Regards

Anupam 

Harish
Active Contributor
0 Kudos

Hi,

I believe you are using either MDM or file adapter to pick the file from MDM. Please set the parameter srcEncoding.

Regards

Harish

Muniyappan
Active Contributor
0 Kudos

Hi Haris,

i am using PI MDM Adapter. is srcEncoding adapter module? i don't find any parameter called srcEncoding in MDM communication channel. please let me know where i can find this.

Regards,

Muniyappan.