cancel
Showing results for 
Search instead for 
Did you mean: 

Hexadecimal format

Former Member
0 Kudos

Hi...

Can you please tell how to convert the input file to the hexadecimal format?

Thanks

Leela

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Leela

What exactly is the requirement you have

If you are trying to get file in XI as hexadecimal then you need to do it outside XI. Either use an adapter module and use code like this

char[] chars = foo.toCharArray();
StringBuffer output = new StringBuffer();
for(int i = 0; i < chars.length; i++){
  output.append(Integer.toHexString((int)chars<i>));
}

You can use Unix script as OS command as well to do this for you.

Another way can be if your requirement is with SAP ABAP system then you can let the file pass to R/3 and in ABAP use the CL_ABAP_FILE_UTILITIES to achieve this

Thanks

Gaurav

Former Member
0 Kudos

Hi... Gaurav,

I need to convert the input payload into Hexa decimal format. I need the conversion should be done inside xi. Can you tell me how to achive that?

Regards,

Leela

Former Member
0 Kudos

Hi

Then you can do a Java mapping as i said above. You can implement the code snippet as well.

Moreover if it is requirement for a field or so use UDF.

Thanks

Gaurav

Former Member
0 Kudos

Gaurav is right,

If you wan to change individual field, you can use given UDF.

If thats not the case,can you post us Sample input and Sample out file to give you valuable inputs.

Thanks

Prabhakar

GabrielSagaya
Active Contributor
0 Kudos

please check the URL for converting text file to Hexa decimal format file

http://www.freedownloadscenter.com/Best/text-hex-file.html

Former Member
0 Kudos

Hi Leela,

Do you want to view the hex values for an input file to help you debug parsing issues (like line feeds,

carriage returns, encodings etc.), or are you looking to actually convert the payload to hex for some

reason as part of a map in XI? If you just want to see the hex valuesu2026

If you have access to Unix, you may have the od command:

od u2013xc payload.file

On windows I typically use a text editor capable of displaying the text in hex. Many to choose fromu2026

Thanks,

-Russ