Skip to Content

How to Convert Hexadecimal

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 04:48 AM

    hi,

    which encoding scheme you are using.

    regards

    kummari

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 05:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 05:27 AM

    Hello Ria,

    Try this in the mapping creating a user defined function :

    char c = '+';

    String s = Integer.toHexString( c );

    Regards

    Prasad

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2008 at 05:31 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2008 at 06:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.