The priority of different data type conversion

Hi All,
I want to know the priority of data type conversion rule. if in an expression, I have several kind of data type( I, P, F,N..).
Then finaly, all the data object will convert to which data type?
I don't know the priority of data conversion.
E.g.   data a type i. data b type p. data c type f.
         a = b + c.
or    data d type p, data e type f.
      if ( d > f ).
Then who will convert to who's type?
Thanks and Regards.
Aaron

For expressions, the right term in SAP is "calculation type", it's explained here : [abap help - determining the calculation type|http://help.sap.com/abapdocu_70/en/ABENARITH_TYPE.htm]. SAP takes the "biggest" type of all variables in the expression. It can be I, P or F (smallest is I, biggest is F).
Conditions are handled differently, just using data type conversion (see link given above by Abhishek), SAP converts from smallest to biggest type (in your case, it converts P to F and compares the two F variables).

Similar Messages

  • Moving Values to fields of different data types- Conversion

    I'm having trouble figuring out how to move a value from a field of a <b>char type</b> to a field of <b>structure RSDSSELOPT</b> type in a different itab.
    I'll show you what I have so far.
    DATA: BEGIN OF ITABAPI OCCURS 0,
          SEARCHFLD LIKE ZDOLTARC03-SEARCHFLD,
          VALUE LIKE ZDOLTARC03-VALUE,
          END OF ITABAPI.
    DATA: BEGIN OF ITAB_GO occurs 0,
             FIELDNAME LIKE RSDSTABS-PRIM_FNAME,
             SELOPT_T TYPE RSDS_SELOPT_T,
          END OF ITAB_GO.
      LOOP AT ITABAPI.
         MOVE: ITABAPI-SEARCHFLD TO ITAB_GO-FIELDNAME,
               <b>ITABAPI-VALUE TO ITAB_GO-SELOPT_T.</b>
         APPEND ITAB_GO.
      ENDLOOP.
    As an alternative I tried feeding the value into ITAB_GO-selopt_t-low, but breaking down the structure that far may be beyond the capabilities of the processor.
    If anyone knows a way to feed a char value into the structure field please help.
    N L

    Hi Natasha,
    my advice is: don't try to do it in just step. Instead,
    DATA: LT_RANGE TYPE TABLE OF RSDSSELOPT WITH HEADER LINE.
    LOOP AT ITABAPI.
       MOVE: ITABAPI-SEARCHFLD TO ITAB_GO-FIELDNAME.
       CLEAR: LT_RANGE.
       REFRESH: LT_RANGE.
       LT_RANGE-SIGN = 'I'.
       LT_RANGE-OPTION = 'EQ'.
       LT_RANGE-LOW = ITABAPI-VALUE.
       APPEND LT_RANGE.
       ITAB_GO-SELOPT_T[] = LT_RANGE[].  
       APPEND ITAB_GO.
    ENDLOOP.
    Pls let us know if it helped. BR,
    Alvaro

  • Same Input name with different data type cause the reflection exception

    I have a proxy contains couple RFCs. Two RFCs contain an argument named IN_COMPANY_CODE with data type of ZTRE_FX_BUKRSTable. Another RFC contains the same argument name of IN_COMPANY_CODE but hold different data type (String). All RFCs are in the same proxy. Complie and build the application with no issue.
    But when I ran the RFC, it generates the reflection exception below:
    Method SAPProxy1.Z_F_Tre_R_Pre_Trade_Fx can not be reflected. --> There was an error reflecting 'In_Company_Code'. > The XML element named 'IN_5fCOMPANY_--5fCODE' from namespace '' references distinct types System.String and MSTRFOREX.ZTRE_FX_BUKRSTable. Use XML attributes to specify another XML name or namespace for the element or types.
    I realize the conflict introduced by the same name with difference data type. But I would like to know if this is fixable as a bug or if there is any best practice and/or some manual intervention to make it work.

    Please install fix from OSS note 506603. After this, right-click .sapwsdl file and select "Run custom tool".

  • Data type conversion JCO To ABAP( Double to DEC)

    Hi,
      I want to update a field having data type as DEC with length 11 in APO system using JCO.Whatever i give as input is not getting reflected in APO system. Instead i get some different value.
    It seems that there is some data type conversion for that field..
    Thanks
    Archana

    if(tableName.equals("BAPI10001LOCPRDVERS2"))
                                                           table.appendRow();
                                                           //System.out.println("getting inside table "+tableName);
                                                           table.setValue("SOP112","PRODUCT");
                                                           table.setValue("SCMTEST111","LOCATION");
                                                           table.setValue("1001","LOCTYPE");
                                                           table.setValue("SCMTEST111","LOCATION_INT");
                                                           table.setValue("000","PLANNING_VERSION");
                                                           table.setValue("5000","SAFETY_DAYS_SUPPLY");//this is the field having problem
                                                           table.setValue("5","SAFETY_STOCK");
                                                           table.setValue(" ","SAFTY_STOCK_CALC_METHOD");
                                                           table.setValue("5.00","OPENING_PERIOD");
                                                           table.setValue("15","FORECAST_HORIZON");
                                                           table.setValue(("20000"),"VMI_PROM_LEAD_TIME");
                                                           table.setValue("0","MINIMUM_LOT_SIZE");
                                                           table.setValue(bd1,"TARGET_DAYS_SUPPLY");

  • Join columns of different data types

    Can i join two columns of different data types in a single statement. Is there any cast or convert statement
    SELECT B~PARTNER AS RESP_GROUP
    FROM BUT000 AS B
    INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO.
    Here PARTNER_GUID is Raw 16 and PARTNER_NO is Char 32, the query is not returning any rows.
    Thanks
    Akila.R

    Hi!
    Basically we can say, you can't join them, but you might try this way:
    SELECT B~PARTNER AS RESP_GROUP
    FROM BUT000 AS B
    INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO(16).   "add
    (16)
    Or an other version
    C~PARTNER_NO+16(16)   "depends on, where is the real number stored
    Regards
    Tamá

  • Saving cluster of different data types to a file

    Hi,
    I use LV 8.6 SDK. I need to save clusters of different data types to a file on a disk, row by row.
    To be specific: I have a program that performs various investigations on a signal collected by DAQmx. Each time the quality of the signal is not in a specified boundaries, i get an indication. It is a cluster of time stamp, string, dbl, and Boolean. The program is supposed to run for few weeks in a row so there can be a lot of these indications. I expect to have around 200 000 rows a week (Altogether, divided into several groups).  
    I thought about TDMS but I am not able to save such a cluster. And I would like to save it as tdms cause i could divide the data to different groups. I also thought about data base but that would be the first time i use db and I really do not  have time to learn that now.
    I know it is possible to change some of the data types to others, ex Boolean to 0-1, but i need a string and a time stamp there. 
    Can someone advise me which data format should I use? Which one is the best one in this situation?
    Thanks in advance
    handre

    If you do not need to access data from another application (other than Labview) you can just save it as a binary file.
    It is the best choice (for me).
    I made an example with one cluster. You can replace that with an array of clusters, of that data type.
    Attachments:
    Example_VI_BD.png ‏2 KB

  • Store values of different data types into single database field

    Hi Friends,
      I  have to store values of different data types(character, numeric, date, time,  text, etc) into a single database field(Char 80). Then read the same values and display it into ABAP Webdynpro report. 
    Appreciate any ideas, examples, suggestions.
    Thanks
    JB

    Hi,
    Try like this:
    data: txt1 type string,
          var1(1) type c,
          var2(1) type n,
          var3 like sy-datum,
          var4 like sy-uzeit.
    parameters: a type c,
                b type n,
                c like sy-datum,
                d like sy-uzeit.
    concatenate a b c d into txt1.
    write txt1.
    var1 = txt1+0(1).
    var2 = txt1+1(1).
    var3 = txt1+2(8).
    var4 = txt1+8(8).
    write: / var1,
           / var2,
           / var3,
           / var4.
    Regards,
    Bhaskar

  • Need Help with data type conversion

    Hello People,
    I am new to java, i need some help with data type conversion:
    I have variable(string) storing IP Address
    IPAddr="10.10.103.10"
    I have to call a library function which passes IP Address and does something and returns me a value.
    The problem I have is that external function call in this library excepts IP Address in form of a byte array.
    Here is the syntax for the function I am calling through my program
    int createDevice (byte[] ipAddress).
    now my problem is I don't know how to convert the string  IPAddr variable into a byte[] ipAddress to pass it through method.

    Class InetAddress has a method
    byte[]      getAddress() You can create an instance using the static method getByName() providing the IP address string as argument.

  • How to add different data types in Linked list?

    The basic idea is that I want to implement a linked list like the one which we generally implement in C. I need to store different data types in a single node. Is it possible to implement like this or I have to implement a linked list for each different data type?

    I have an application program in which there is a form. In this form there are different text fields in which data is to be inserted by the user. These data's will be inserted into the database. I want to hit the database only once. So I need to store these data in a data structure before I insert into the database. I think it will be easy for me to handle the data in a linked list if I can have different data types in a single node.
    Moreover, I think u're not getting my question. This pic will help u.
    http://img522.imageshack.us/img522/4500/sampler.jpg
    I'm not sure about that the code which u have written will have different data types in single node. I have to try that.
    And of course if anyone has any better idea than me, it will be very helpful.

  • What is the table to config Data Types in BI modeling

    Hi Friends
    I got a problem while assigning data types to info objects, It has't got all data types in their fields, i have to assign NUMC data type  to assign EE ID
    and assign different Data Types to different IO, will you please explain me how to config data types?
    Thanks & Regards
    Srinivas

    Hi,
    If the data types provide by SAP doesn't meet your requirement then you need to create a custom domain by copying the existing one and assign it to the key figure.
    Go through the below document for step by step procedure:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/209b2916-1cca-2d10-b39e-90df259764ef?QuickLink=index&overridelayout=true
    Regards,
    Vijay

  • Invalid data type conversions

    what are the invalid data type conversions in ABAP ???
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Mar 10, 2012 6:01 PM

    No Amanda,
    The values that I see in message monitor are also those that comes to XSLT programs as input.
    I investigated our problem a little further myself:
    1) XI always converts messages into XML format - this everybody knows.
    2) In XI documentation it is declared that XI uses ISO 8601 for DATE type formatting. That's why you see dates in format YYYY-MM-DD in XML data in message monitoring.
    3) The appearance of those decimal values are not that obvious for me. If XI uses ABAP transformation for message content then applies the rules for converting ABAP data types into XML. For this there is a SAP document 'ABAP - XML mapping' from TechEd2004. This document seems to describe how ABAP data types are handled by XML transformation.
    Anyway, we currently need to play with decimal values in XSLT mapping programs inside XI:
    a) add leading 0 integer if source value < 1
    RFC returns 0.123 -> XI converts to XML '.123' -> XSLT mapper should return '0.123' ->SOAP response returns '0.123'
    b) add decimal point and trailing zeros
    RFC returns 0.000 -> XI converts to XML '0' -> XSLT mapper should return '0.000' ->SOAP response return '0.000'
    With dates, the problem is actually on documenting mapping rules when writing interface specifications. If you would write an EAI-solution-independent conversion rule (RFC/date->SOAP/char) for date field it could sound like: YYYYMMDD -> dd.mm.yyyy. This works semantically between these systems but would not work for XI-developer, because he get YYYY-MM-DD from the RFC.
    Additionally the decimal type conversion requirements in XSLT mapping programs probably only applies XI and are therefore not reusable in other EAI environments.
    I would be glad if somebody would still have further comments for this data type conversion issue.
    br: Kimmo

  • Data type conversion from packed to numeric

    Hi Experts,
    i have a question on data type conversion. My requirement is:
    i have fields of type packed decimal in my internal table itab. I need to convert the values of packed decimal fields in itab to numeric type.
    Example:
    Data: begin of itab occurs 0,
                ebeln like ekko-ebeln,
                ebelp like ekpo-ebelp,
                menge(15) type p decimals 2,
                netpr(15) type p decimals 2,
              end of itab. 
    if itab-menge has a value of 2.00, i need to convert that value to '         200'.  Right justified.
    if itab-netpr has a value of 1,234.56, i need to convert that to '         123456'.
    The above internal table itab is passed to the Function module GUI_DOWNLOAD and the itab data is downloaded to a text file.
    Please let me know how to acheive this objective.

    Hi ,
    You can use
    SPLIT at '.' into v1 v2
    concatenate v1 v2 into vv1.
    REPORT ZDN_TEST_001 .
    data: lv_var1(15) type p decimals 2 value '123.00'.
    data: lv_var2(15) type p decimals 5 value '123.12121'.
    data: lv_varc1(15) type c.
    data: lv_varc2(15) type c.
    data: lv_varc1d(2) type c.
    data: lv_varc2d(5) type c.
    data: lv_varc11(15) type c.
    data: lv_varc21(15) type c.
    write:/ lv_var1.
    write:/ lv_var2.
    *1)write & REPLACE.
    write lv_var1 to lv_varc1.
    write lv_var2 to lv_varc2.
    REPLACE '.' WITH SPACE INTO lv_varc1.
                 CONDENSE lv_varc1 NO-GAPS.
    REPLACE '.' WITH SPACE INTO lv_varc2.
                 CONDENSE lv_varc2 NO-GAPS.
    write:/ lv_varc1.
    write:/ lv_varc2.
    *2)split & concatinate
    write lv_var1 to lv_varc1.
    write lv_var2 to lv_varc2.
    split lv_varc1 at '.' into lv_varc1 lv_varc1d.
    concatenate lv_varc1 lv_varc1d into lv_varc11.
    split lv_varc2 at '.' into lv_varc2 lv_varc2d.
    concatenate lv_varc2 lv_varc2d into lv_varc21.
    write:/ lv_varc11.
    write:/ lv_varc21.

  • What is the size of number data type.

    what is the size of number data type (in term of memory storage ;byte ).
    Does it make different in size if mention number(38,0)?
    Thanks all in advance...:)
    Edited by: user10648897 on Jan 7, 2009 6:43 AM

    NUMBER (p,s)
    Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127.number(38,0) = number(38)
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14196/schema002.htm#sthref472

  • As to the data type of the data type of the difference between two date type of datas

    Hi,
    I have a question about the data type of the difference between two date type of datas.
    There are two date type of datas as:
    SSHIPMENTS.RECEIVEDATETIME
    SSHIPMENTS.PROMISEDATETIME
    I try to use the following SQL Script in Oracle SQL*Plus as:
    SELECT CASE
    WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:00:00.000' THEN 'OnTime'
    WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:30:00.000' THEN '60-89 Minutes'
    ELSE '3+ Hours'
    END
    FROM SSHIPMENTS;
    The error message of "Invalid Number" for the '000 01:30:00.000' happens.
    I don't know if the data type of the interval is wrong.
    Many Thanks,
    Cathy

    SELECT CASE
    WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss')) < '010000' THEN 'OnTime'
    WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss'))< '000 01:30:00.000' THEN '60-89 Minutes'
    ELSE '3+ Hours'
    END
    FROM SSHIPMENTS;
    just try it out..

  • LIKE Operator to ignore the time part of DATE type?

    Hi,
    is it allowed to use the LIKE operator on DATE Type to ignore the time-part in the DATE?
    Nothing found in the manual, but seems to me that it works.
    1. SELECT * FROM test_date WHERE tst_date LIKE to_date('01.01.2003 13:33:33','DD.MM.YYYY HH24:MI:SS') ;
    2. SELECT * FROM test_date WHERE tst_date LIKE to_date('01.01.2003','DD.MM.YYYY') ;
    3. SELECT * FROM test_date WHERE tst_date LIKE trunc(to_date('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS'));
    4. SELECT * FROM test_date WHERE to_date('01.01.2003 13:33:33','DD.MM.YYYY HH24:MI:SS') LIKE tst_date;
    5. SELECT * FROM test_date WHERE tst_date BETWEEN to_date('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS') AND to_date('01.01.2003 23:23:59','DD.MM.YYYY HH24:MI:SS');
    6. SELECT * FROM test_date WHERE tst_date >= TO_DATE('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS') AND tst_date < TO_DATE('01.01.2003')+1;
    7. SELECT * FROM test_date WHERE TRUNC(tst_date) = TRUNC(TO_DATE('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS'));
    Result for 1-7 is the same.
    What is the preferred Solution?
    Solution 5 is bad, because index on TST_DATE column could not be used.
    Solution 1 - 3 is the same using the LIKE operator.
    Any comments?
    Thanks, Markus
    GEMS IT

    Oh, sorry, LIKE-Operator solutions do also not use an Index :-(. Only 5. and 6.
    Sample-Script:
    CREATE TABLE TEST_DATE
    TST_DATE DATE
    CREATE INDEX MEDVIEW.TEST_DATE_IDX
    ON MEDVIEW.TEST_DATE(TST_DATE);
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:45:13 PM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 08:11:55 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 09:33:16 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/02/2003 07:45:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/02/2003 07:33:00 PM', 'MM/DD/YYYY HH:MI:SS AM'));
    COMMIT;

Maybe you are looking for