Convertion from Decimal to Hexadecimal

Hi,
Can you please tell me the way to covert a given decimal number into hexadecimal (for example 4 -> 04, 20 -> 14 etc) and also the vice versa.
thank you.

Hi
Try this function module:
" CRM_EI_KB_CONV_DEC_TO_HEX "
This fm converts any decimal to hexadecimal, but not vice-versa.........
Hope it helps....

Similar Messages

  • I want to convert from decimal (5, 2) to decimal (3,0) in data services

    Hi All,
    I want to convert from decimal (5, 2) to decimal (3,0) in data services.
    if anybody knows please let me know with syntax.

    https://scn.sap.com/community/data-services/blog/2013/06/12/conversion-functions-in-bods-with-examplespart3
    https://scn.sap.com/community/data-services/blog/2013/06/12/conversion-function-in-bods-with-examplespart3

  • Converting from decimal to binary to hexadecimal to octal

    hello everyone,
    my question is, Is there a way to get decimal input from user and print the binary, hexadecimal and octal value of that decimal? just like C does in printf command

    http://java.sun.com/j2se/1.3/docs/api/java/lang/Integer.html

  • Decimal to Hexadecimal convertion

    Hi, how can I converte decimal(NUMBER) to Hexadecimal in PL/SQL ?
    I need to translate the NUMBER: 50545326 to haxadecimal: 030342AE
    But my SQL return C43337361B, see below:
    SELECT RAWTOHEX( utl_raw.cast_from_number( 50545326 ) )  --> I wish 030342AE value
      FROM DUAL;

    Luciana T. Angeli wrote:
    One more question, I see that negative numbers can't be converted to Hexadecimal this way.
    It is possible to convert negetive decimal numbers to hexadecimal format ?Negative numbers need to be displayed as 2's complement to be shown in hexadecimal, so you would have to specify (in effect) how many bytes you are dealing with.
    e.g. if you know your are dealing with 4 byte numbers...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select &num as num from dual)
      2* select to_char(case when num<0 then 65536+num else num end, 'fmXXXX') as hx from t
    SQL> /
    Enter value for num: 123
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select 123 as num from dual)
    HX
    7B
    SQL> /
    Enter value for num: -1
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select -1 as num from dual)
    HX
    FFFF
    SQL> /
    Enter value for num: 32767
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select 32767 as num from dual)
    HX
    7FFF
    SQL> /
    Enter value for num: -32768
    old   1: with t as (select &num as num from dual)
    new   1: with t as (select -32768 as num from dual)
    HX
    8000
    SQL>If your numbers are larger you need to increase your format mask and increase the value (65536) appropriately.

  • Convert from Comma notation to Decimal Notation, Any FM ?

    Hi Experts,
    I am looking to convert from Europe format to US format for Quantity & amount fields, I mean
    e.g. Europe:  12.3456,78 -> US: 12,3456.78
    pls. i can not use offsetting, replace, pattern, overlay, concatenate etc.
    So, pls. let me know that, Is there any SAP FM for this purpose of DECIMAL NOTATION conversion?
    thanq
    Edited by: Srinivas on Feb 22, 2008 10:48 PM

    use.
    Replace all occurances of ',' in w_value with '.'.
    Check this thread.
    REgarding converting  ','  TO  '.'

  • Converting from binary to decimal

    i writ this program to let the user input his number and then it will be converted to decimal,but how can i limited the rang of my digit,or if i want him to enter 4 digits only what can i do,,,and if i dont limit a range how can i make it?

    this is my code
    import javax.swing.JOptionPane;
    public class Ch4_25
    public static void main(String[]arg)
         int F,d1,d2,d3,d4,num=1;
         String N = JOptionPane.showInputDialog("Enter the number");
         num=Integer.parseInt(N);
         d1=num/10000;
         num=num%10000;
         d2=num/1000;
         num=num%1000;
         d3=num/100;
         num=num%100;
         d4=num/10;
         F= d4*1+d3*2+d3*4+d2*8+d1*16;
         JOptionPane.showMessageDialog(null,"the number is"+F);
         System.exit(0);
    }     

  • Conversion of book dimension from decimal to fraction

    Hi,
    I am a crystal report developer and new to SAP R3 environment.  I am creating reports with SAP BW queries as source.  I am working for a publishing client.  They are storing the material (Book) details in the SAP system (Material table).   SAP has a provision to capture physical properties of the book like width, height and thickness.  They are entering details upto 3 decimal places precision in inches or in specified unit of measure. 
    When some extracts are generated from SAP System the values like 10.380 is converted as 10-3/8.  But the actual 10-3/8 value is 10.375.  The rounding is not uniform when I checked with few other values.  I came to know from SAP experts these conversion are happened in an IDOC.  I don't know much about this.
    Can anyone help me in this conversion logic.  Since I have to implement the same in my Crystal report.  My BW query is just giving it in the decimals, my users are interested in seeing it as fraction since the other exports from SAP is showing it in fraction.
    Thanks and Regards,
    Subbu S.

    In the user exit of Outbound Idoc, they might have used some custom logic to implement the given logic.
    It may vary on other factors as well. In your case, that should be verified or cross checked in your system only.
    For converting the decimal to fraction in SAP, you can refer the below function module.
    'CONVERT_TO_FRACTION'

  • Convert from USD to EUR

    I have an invoice and i want to convert the net value of the invoice (in this case KOMK-FKWRT) from usd to eur using the conversion factor from the invoice (in this case VBDKR-KURRF).
    If i trie:
       price_eur = KOMK-FKWRT * VBDKR-KURRF
    doesn't work (i see a strange number; something like this 123123213.23 and correct is 123123,21323) because KOMK-FKWRT is currency type and VBDKR-KURRF is decimal.
    I tried to convert the VBDKR-KURRF from decimal to currency but doesn't work.
    I tried write price_eur to price_eur_char currency 'EUR' but doesn't work.
    Any ideea how to make the conversions?
    Thnx.

    There are many FMs to convert function module.....It will make your code error less.
    Ex:CONVERT_CURRENCY_BY_RATE
    Please check in se37 with the help of F4.
    Regards

  • Convert from String to Int

    Hi,
    I have a question.
    How do I convert from String to Integer?
    Here is my code:
    try{
    String s="000111010101001101101010";
    int q=Integer.parseInt(s);
    answerStr = String.valueOf(q);
    catch (NumberFormatException e)
    answerStr="Error";
    but, everytime when i run the code, i always get the ERROR.
    is the value that i got, cannot be converted to int?
    i've done the same thing in c, and its working fine.
    thanks..

    6kyAngel wrote:
    actually it convert the string value into decimal value.In fact what it does is convert the (binary) string into an integer value. It's the String representation of integer quantities that have a base (two, ten, hex etc): the quantities themselves don't have a base.
    To take an integer quantity (in the form of an int) and convert it to a binary String, use the handy toString() method in the Integer class - like your other conversion, use the one that takes a radix argument.

  • Numeric differences when converting from 5.1.5 to XI

    Several reports which were converted from v5.1.5 to XI Webi have numeric differences.  When comparing v5.1.5 to XI, the sums on the columns don't exactly match.   The cell format on these numbers is set to eight decimal points.  When we converted, I noticed the cell format changed from number 0.00000000 in 5.1.5  to custom 0.00000000 in XI.  I don't know if this is the reason the sums don't match or if it's something else.
    Has anyone seen this issue and know how to fix it?

    There were some bugs, and some formula changes in the 3-4 version changes between 5.x and XI (R2, 3.x)
    I'd recommend opening a message with support(deployment team) to find our if it's a known issue.
    Regards,
    Tim

  • C++, issues with converting a decimal to fraction

    Hi all,
    I am working on a C++ program that converts a decimal to a fraction, finds the lowest common multiple, multiplies the numerator by the denominator, then reduces the fraction again so the fraction will be 'numerator/1'. 
    I am using this code in a larger program to change a floating point slope value to a whole value for slope-intercept equations and standard form equations.
    The program will run but I tested almost 500 numbers and 20 numbers made the program crash (it stalled and did not finish the equation, I had to close the terminal and open it up again... )
    These 20 numbers I had problems with:
    2.36,  7.36,  1.11,  1.001,  1.66,  1.88,  2.22,  2.13,  3.24,  3,26,  3.32,  3.43,  3.49,  3.51,  3.57,  3.68,  3.74,  3.76,  3.82 
    (I am sure there are more...)
    I have tried c-style casting and dynamic and static casting to try to resolve this issue. Can someone help me out and point out why these certain numbers make the program crash and offer a possible sloution?
    I tried debugging this program on gdb and keep on getting this frustrating message..
    (gdb) break 16
    No line 16 in file "init.c".
    (gdb)
    Here is the program's code:
    //example.cc
    #include <iostream>
    #include "reduce.h"
    #include "decimal-to-fraction.h"
    using namespace std;
    int main()
    double deci;
    double n, d;
    while(1) {
    cout << "Enter a decimal to convert to a fraction ('0' to quit): ";
    cin >> deci;
    cin.ignore(INT_MAX, '\n');
    if(!deci) exit(0);
    dec_to_frac(deci, n, d);
    if (n * d != n){
    cout << '\n' << deci << " = " << n << '/' << d << "\n\n";
    cout<<'\n' << d << " x " << n;
    n = d * n;
    cout<< " = " << n << "\n\n";
    cout<<'\n' << n << '/' << d;
    reduce(n, d);
    cout << " = " << n << '/' << d << "\n\n";
    cout<<'\n' << n << "\n\n";
    else
    cout<<'\n' << deci<< "\n\n";
    return 0;
    #ifndef _REDUCE_H_
    #error You must include "reduce.h" before this file
    #endif /* def _REDUCE_H_ */
    #ifndef _DECIMAL_TO_FRACTION_H_
    #define _DECIMAL_TO_FRACTION_H_
    void dec_to_frac(double decimal, double &numerator, double &denominator)
    //numerator = static_cast<int >(decimal);
    //numerator = (int )decimal;
    numerator = decimal;
    denominator = 1;
    while(numerator != (int)numerator) {
    numerator *= 10;
    denominator *= 10;
    reduce(numerator, denominator);
    #endif /* def _DECIMAL_TO_FRACTION_H_ */
    #ifndef _REDUCE_H_
    #define _REDUCE_H_
    void reduce(double &numer, double &denom)
    int i;
    for(i=2; i<=numer; ++i) {
    if( ((numer/i) == ((int )(numer/i))) && ((denom/i) == ((int)(denom/i))) ) {
    numer /= i;
    denom /= i;
    --i;
    #endif /* def _REDUCE_H_ */

    Okay, a few things ('cause I'm picky too):  LCM == "least common multiple" or "lowest common multiple", it's really interchangable.  LCD == lowest common denominator, which is when you're adding two fractions and want to find the lowest denom.  Now that we have that out of the way...
    Using ++i or i++ as the third expression in your for loop will make zero difference. 
    for (int i=2; i<=numer; ++i)
    will have exactly the same effect as
    for (int i=2; i<=numer; i++)
    , though they may have slightly different performances.  The reason for this is that the third expression (i++ or ++i) is evaluated after every iteration of the loop, meaning it doesn't happen until the end of the loop body is reached, and then it's evaluated independently, meaning all you end up with is 'i' incrementing.
    As for this:
    if( ((numer/i) == ((int )(numer/i))) && ((denom/i) == ((int)(denom/i))) ) {
    becomes
    if (numer % i == denom % i == 0) {
    That's about right, it would look more like
    if (numer %i == 0 && denom % i == 0)
    - the other way would probably not behave the way you expect.
    Some other tips:
    numer and denom should be 'int' or 'long' - not double.  You don't expect your numerator and denominator to have decimal points, so use integral types - using floating point 'double's is likely what's getting you into this trouble -- floating point arithmetic is inherently imprecise.  You might have better luck parsing the input yourself and constructing the numerator from that instead of reading directly into a floating-point number.
    I'm hacking around with your code right now for fun; I'll let you know if I find anything.
    ==edit==
    Oh, something else I wanted to mention; to break on a line in gdb you type:
    break filename:linenumber
    ie.
    break example.cc:16
    Last edited by Cerebral (2007-06-03 02:43:42)

  • Conversión decimal a hexadecimal

    ¡Hola!
          Quiero convertir un número decimal en hexadecimal. A medida que varíe un "pointer slide" con valores decimales, un indicador númerico me vaya mostrando dicho numero pero en formato hexadecimal.
    ¿Se puede, alguien sabe cómo hacerlo?
    Adjunto una imagen de la idea para que sea más clara la pregunta.
    Saludos.
    Adjuntos:
    Ejemplo.png ‏7 KB

    Estoy controlando un variador de velocidad por medio de Modbus (empleo una conexión RS485). Dicho variador se programa con formato HEXADECIMAL.
    Para lograr esto estoy utilizando la libreria Modbus, en la cual sus entrada acepta un valor U16 (unsigned 16 bits).
    La pregunta es:
    ¿Cómo hago o existe algun bloque para convertir un número decimal (el cual lo voy variando con una perilla desde el panel frontal) en U16 hexadecimal? Usé un conversor decimal/hexadecimal pero la salida del mismo es un string y esto no me sirve.
    Adjunto una imagen para que sea más claro.
    Adjuntos:
    Esquema.JPG ‏45 KB

  • How to convert from value to word ?

    Hi all,
    I intend to convert from value into words such as 234.50 will be two hundred and thirty four and cents fifty. How should I code or any function will able to produce this ?
    Please advise.
    Rgds
    Lim

    Lim
    The SP format modifier spells out part of a date - so does YEAR:
    SQL> select to_char(sysdate,'YEAR') from dual
      2  /
    TO_CHAR(SYSDATE,'YEAR')
    TWO THOUSAND EIGHT
    SQL> To spell out a money amount, you have to take a decimal number and break it into dollars and cents (both integers):
    SQL> r
      1  declare
      2    amount number(10,2) := 12345.67;
      3    dollars integer;
      4    cents integer;
      5  begin
      6    dollars := floor(amount);
      7    cents := (amount - dollars) * 100;
      8    dbms_output.put_line(to_char(to_date(dollars,'J'), 'JSP') ||  ' dollars a
    nd ' ||
      9        to_char(to_date(cents,'J'),'JSP') || ' cents');
    10* end;
    TWELVE THOUSAND THREE HUNDRED FORTY-FIVE dollars and SIXTY-SEVEN cents
    PL/SQL procedure successfully completed.
    SQL>Note that the spelling out is rather american (in UK we wouldn't add the hyphen and we would say twelve thousand three hundred AND forty five).
    Using JSP means we are spelling out a Julian date (ie a number of days, which is allowed to get pretty large. But watch out - there is a limit (somwhere between 1 and 10 million) - ie the number of days between minimum date (4172 BC) and max date (around 31/12/9999).
    HTH
    Regards Nigel

  • ABAP code needed to convert from 0calmonth2 & 0calyear to 0calmonth

    Hi SAP GURUS,
    Can anybody give me the ABAP code to convert from 0calmonth2 and 0calyear to 0calmonth.and please suggest me whether i have to write start routine or end routine in transformations.
    Thanks ALL.

    hi,
    in the transformation map 0calmonth2 and 0calyear to the 0calmonth field, and from drop down choose routine.
    there will be an area where it will be mentioned write your piece of code below this line.
    paste the below code:
    Concatenate source_fields-0calmonth2 source_fields-0calyear into result.
    also delete the line result = .
    save the routine and execute the package.
    regards,
    Arvind.

  • The bullet list, numbered list and the normal text is not converting when I am converting from RH 9 to MS Word 2010

    Hi all,
    Greetings for the day
    I am created a new CSS in Robohelp 9. I have also created a new template in Word 2010. The style sets for different information elements like (Heading, bullets, body text, ) are more or less same between the CSS and the new templates. I am also able to map the .css styles to Word template when I am converting from RH to Word as I am getting the necessary option in the drop-down list.
    However, when the output is generated, the bullet, the numbered list and the body text is not converting at all. The body text works sometimes. However, the numbered list and bullet list is coming out as images.
    If anybody knows the solution, I can share the .css and Word template.
    Thanks in advance.
    Regards,
    Parag Deb

    Create a new project with two or three topics containing lists of both types. Generate a printed output that shows the problem. Then zip it up and send it to me. See the Contact page on my site for instructions.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

Maybe you are looking for