cancel
Showing results for 
Search instead for 
Did you mean: 

How to Convert Hexadecimal

former_member203627
Participant
0 Kudos

Hi

Can anyone suggest me how to convert a charater to hexadecimal.

I want to send some sort of character to empty fields some default value but target system is epoecteing hexadecimal

Can anyone suggest how to convert a ~ or + to hexadecimal in XI.

Regards

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member203627
Participant
0 Kudos

Hi

Can anyone help me with following code for syntax error.

char c = '+';

String s = Integer.toHexString( c );

Error is

Source code has syntax error: /usr/sap/DAX/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map1facfd90587d11dd83d6001a645059de/source/com/sap/xi/tf/_I805_CustOutlet_MM_.java:3: '.' expected import com.sap.aii.mappingtool.tf3.;import com.sap.aii.mappingtool.tf3.rt.;import java.util.;import java.io.; import java.lang.reflect.*;import s;

Please don't send me links

Former Member
0 Kudos

Hello ria,

Create a User Defined function and pass Input String to the Function.

String ToHex(String input,Container container)

String s = Integer.toHexString( input.charAt(0) );

return s;

Map the Output of the User Defined Function to the Target Field.Without any import statements this works fine.

Regards

Prasad

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

If the conversion has to be done only for 3 of these values you can go for FixValues Conversions function.

Specify the following

Key     Value
a          61
~          7E
+          2B

Thanks

SaNv...

Former Member
0 Kudos

Hello Ria,

Try this in the mapping creating a user defined function :

char c = '+';

String s = Integer.toHexString( c );

Regards

Prasad

former_member203627
Participant
0 Kudos

Hi Prsad,

I don't know Java, if you can plz test this code...I tried it it is giving following error in mapping

Source code has syntax error: /usr/sap/DAX/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map0da56360587a11ddba02001a645059de/source/com/sap/xi/tf/_I805_CustOutlet_MM_.java:3: '.' expected import com.sap.aii.mappingtool.tf3.;import com.sap.aii.mappingtool.tf3.rt.;import java.util.;import java.io.; import java.lang.reflect.*;import s; ^

Former Member
0 Kudos

hi,

you need to import the import java.util. for UDF s

<removed by moderator>

regard

kummari

Edited by: Mike Pokraka on Jul 24, 2008 12:42 PM

Former Member
Former Member
0 Kudos

Hi Ria,

As it seems to me u can do it by the help of value mapping.U can maintain the value of 'a' or '' may be it seems to me the ansii code in the value mapping table.So if the data comes as '' in the i/p then the corresponding o/p get mapped into the target field by value mapping.

Thnks

Arijit

<removed by moderator>

Edited by: Mike Pokraka on Jul 24, 2008 1:04 PM

Former Member
0 Kudos

hi,

which encoding scheme you are using.

regards

kummari

former_member203627
Participant
0 Kudos

I have no idea which encoding scheme i need to use...I am pretty new so if you can guid me for the same.

Regards

Former Member
0 Kudos

hi riya

did you try this FM

SCP_REPLACE_STRANGE_CHARS .

also check this thread for getting an idea to solve

<removed by moderator>

regards

kummari

Edited by: kummari on Jul 23, 2008 7:00 AM

Edited by: Mike Pokraka on Jul 24, 2008 1:03 PM