Data types in ABAP

what is the significance of initial field and valid field in data type like float,numeric,int etc.

hi,
With data types p, n, c, and X you can enter a length in parentheses after the type name. If no length
is entered, the default length for this data type is used.
With data type P you can use the DECIMALS addition to determine the number of decimal places that
should be used (up to a maximum of 14). If this addition is missing, the number of decimal places is
set to zero.
If you do not specify a type, then the field is automatically type C.
All other literals (character, numbers with decimal places, floating point numbers) are stored as text
literals with data type C. If a literal is assigned to a variable that does not have type C, then a type
conversion is carried out.
The length specification after the type name for ABAP data types C, N, and X specifies the number of
characters in the type. For type P fields, you can also set the number of decimal places. If you omit
these specifications, the system uses the default values
Hope this helps, Do reward.
Edited by: Runal Singh on Feb 11, 2008 12:18 PM

Similar Messages

  • How to define MDM real data type in ABAP ?

    Hi,
    I want to fetch MDM Repository data using MDM API .
    I am strugling as one field in MDM is of real type .
    Please tell me how I could define Real data type field in ABAP ?
    Thanks.
    Sandesh

    I recently had a Real type added to a repository I'm working on and noticed a dump in the API itself when trying to fetch data from that field. I'm running 5.5 so you may be experiencing a different issue. I haven't resolved the issue yet as it isn't a priority but I will most likely move to a string field and just ensure that the field has its decimal rule respected logically.

  • Pack  and Floating Point Data Type in ABAP

    Dear All,
    I am new to ABAP. Started with data types. Came across pack and floating point.
    Please let me know what PACK  and Floating Point stands for with few examples and the main difference between them.
    Regards
    Arun V

    Hi,
    You'd better ask this question in ABAP forum http://forums.sdn.sap.com/forum.jspa?forumID=50 .
    Best Regards,
    Ada

  • Cannot Activate data type in ABAP Database Inconsistent

    Hi,
    can you please help me on this? We could not activate the data type abap proxy in SPROXY.
    Here is the error:
    Database inconsistent: TABL XYZ not found.
    The object is inactive. Is there a way to delete the object in the backend?
    Or do you know other way to solve this?

    I already recreated the object in ESR, but we are still getting the error in SPROXY whether you regenerate, delete or activate proxy. If I checked the proxy name, it is in a form of a structure and is  activated but the data type in SPROXY is still in inactive mode.
    I could not remember how this error came up but it seems dependent objects for the data type are not generated properly that's why the error is TABL object is not found.
    Do you have other way on how to delete the inactive proxy in ABAP?

  • DATA TYPE IN ABAP CORRESPONDING TO TYPE REAL IN MDM

    Hi all,
    I am working on a code to fetch data from MDM, using the  *MDM ABAP APIs*_._ I could retrieve almost all the Fields except for one, which has data type REAL in MDM. I need to find the type in ABAP, corresponding to the type REAL in MDM. I need to define this field in the structure but I am not sure as to which data type to put against it. I have already tried float, decimal, string, char... nothing works!!
    Kindly let me know if anybody has come across the same issue and resolved it.
    Thanks and regards,
    Aastha

    Hello,
    We're getting the same problem too.
    Have you deleted your Real fields and u've created them as a measurement field?
    Is it really necessary to create the fields with type 'measurement'?
    Or do you maintain in MDM your field with type Real and you treat it as type 'mesurement' into your ABAP API with measure 'none', while in SAP ECC it's created as a numeric with decimals.
    Thanks for your feedback!
    Carlos Santamaría.

  • XSD Data Type to ABAP Proxy Tech. Type

    I am working with an ABAP development team who is creating PROXYs from the Service Interfaces I have setup in the ESR (PI 7.11). I have been asked to set the type of a numeric field by the ABAP developer as this:
    "Yeah we can convert from string to currency but sap internally stores currency with 3 decimals so we may got to do some multiplications and divisions based on how many decimals sender passes. If you could create a numeric with 3 decimals that is ideal."
    The XSD type as xsd:decimal, but in the proxy it seems to create Tech. Type = STRING.
    I can apply formatting rules in the message mapping, but developer is convinced that the Service Interface can have the correct ABAP Tech. Type. I do not find any messages in this forum, so not sure what to do.
    Thank you for your time.

    Internal ABAP types like packed or float cannot be created by ABAP proxy.
    I recommend to use String for any type. Inside XML you will have a String representation anyway, but you will encounter less issues in converting from XML to ABAP internal types.
    I work a lot with currency fields, it is no problem at all. Inside ABAP you mave currency field to string field, the decimals are correct.
    If course, in mapping you have to create a decimal field, but this would not be any change, if you had a decimal type in ABAP.

  • How to convert Oracle data types to ABAP types.

    Hi,
    I have this oracle table table:
    Type of col.
    Char(6)
    Number
    Number
    Number
    Number
    Date
    I dont know how to convert column of number to abap types. I use exec sgl syntax and I try to insert value to abap structure. But structure <dyn_wa> is wrong.
      EXEC SQL PERFORMING loop_output.
        SELECT *
            INTO   :<dyn_wa>
            FROM   BIND_VAT_CB_SUM_VIEW@DTRTST1
      ENDEXEC.
    ENDFORM.                    "get_data
    Thanks

    HI,
    REPORT demo_native_sql.
    DATA: BEGIN OF wa,
            connid   TYPE spfli-connid,
            cityfrom TYPE spfli-cityfrom,
            cityto   TYPE spfli-cityto,
          END OF wa.
    DATA c1 TYPE spfli-carrid VALUE 'LH'.
    EXEC SQL PERFORMING loop_output.
      SELECT connid, cityfrom, cityto
      INTO   :wa
      FROM   spfli
      WHERE  carrid = :c1
    ENDEXEC.
    FORM loop_output.
      WRITE: / wa-connid, wa-cityfrom, wa-cityto.
    ENDFORM.
    See the below SAP link for more info
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm
    Thanks
    Sudheer

  • What is the match of float or double data type in abap?

    I have tried p, but I could not handle decimal numbers such as 10.6 or 10,6(no matter which one is preferred, the question is the same...).
    How can I handle these numbers?
    Thanks.

    Hi
    Hope you know about FLOAT and Double.But you can use the same P for handling decimal places...
    Use like this.
    Data :Deci type P DECIMALS 2.
    Get bckif you are getting error still...
    Reward All Helpfull answers..........

  • How to give decimal data type in abap

    hi
    i m getting all the data from table
    and doing calculation
    i m using field TOTAL field for doing total
    total = neter + kbetr
    total = 150.50 + 120.20
    here in my out put answer is coming like below
    total = 270
    but i want
    total = 270.70
    THANKS IN ADVANCE.

    hi,
    declare the field in this way ..
    data : total type p decimals 2.

  • Abap 4 data type

    Hye Friends,
    Can u tell me when to use C data type and when to use N datatype??
    apart from character and numeric character what are the more differences between these two??
    Thnks in advance.
    Sunny

    Data consists of strings of bytes in the memory area of the program. A string of related bytes is called a field. Each field has an identity (a name) and a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
    In the ABAP type concept, fields are called data objects. Each data object is an instance of an abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their own right. There are separate name spaces for data objects and data types. This means that a name can at the same time be the name of a data object as well as the name of a data type.
    Data Types:
    As well as occurring as attributes of a data object, data types can also be defined independently. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program (using the TYPES statement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
    Data types can be divided into elementary, reference, and complex types
    Kishi.

  • Difference b/w DATA TYPE and DATA OBJECT & differences b/w TYPE and LIKE

    hai
    can any one say the differences between Data type and Data Object.
    And also differences between TYPE and LIKE
    thanks
    Gani

    hi,
    _Data Types and Data Objects_
          Programs work with local program data – that is, with byte sequences in the working memory. Byte sequences that belong together are called fields and are characterized by a length, an identity (name), and – as a further attribute – by a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
          In the ABAP type concept, fields are called data objects. Each data object is thus an instance of an abstract data type. There are separate name spaces for data objects and data types. This means that a name can be the name of a data object as well as the name of a data type simultaneously.
    Data Types
       As well as occurring as attributes of a data object, data types can also be defined independently. You can then use them later on in conjunction with a data object. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program using the TYPESstatement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
         All programming languages distinguish between various types of data with various uses, such as ….. type data for storing or displaying values and numerical data for calculations. The attributes in question are described using data types. You can define, for example, how data is stored in the repository, and how the ABAP statements work with the data.
    Data types can be divided into elementary, reference, and complex types.
    a. Elementary Types
    These are data types of fixed or variable length that are not made up of other types.
    The difference between variable length data types and fixed length data types is that the length and the memory space required by data objects of variable length data types can change dynamically during runtime, and that these data types cannot be defined irreversibly while the data object is being declared.
    Predefined and User-Defined Elementary Data Types
    You can also define your own elementary data types in ABAP using the TYPES statement. You base these on the predefined data types. This determines all of the technical attributes of the new data type. For example, you could define a data type P_2 with two decimal places, based on the predefined data type P. You could then use this new type in your data declarations.
    b.  Reference Types
    Reference types are deep data types that describe reference variables, that is, data objects that contain references. A reference variable can be defined as a component of a complex data object such as a structure or internal table as well as a single field.
    c. Complex Data Types
    Complex data types are made up of other data types. A distinction is made here between structured types and table types.
    Data Objects
          Data objects are the physical units with which ABAP statements work at runtime. The contents of a data object occupy memory space in the program. ABAP statements access these contents by addressing the name of the data object and interpret them according to the data type.. For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.
           Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type). You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
            A data object is a part of the repository whose content can be addressed and interpreted by the program. All data objects must be declared in the ABAP program and are not persistent, meaning that they only exist while the program is being executed. Before you can process persistent data (such as data from a database table or from a sequential file), you must read it into data objects first. Conversely, if you want to retain the contents of a data object beyond the end of the program, you must save it in a persistent form.
    Declaring Data Objects
          Apart from the interface parameters of procedures, you declare all of the data objects in an ABAP program or procedure in its declaration part. These declarative statements establish the data type of the object, along with any missing technical attributes. This takes place before the program is actually executed. The technical attributes can then be queried while the program is running.
         The interface parameters of procedures are generated as local data objects, but only when the procedure is actually called. You can define the technical attributes of the interface parameters in the procedure itself. If you do not, they adopt the attributes of the parameters from which they receive their values.
    ABAP contains the following kinds of data objects:
    a.  Literals
    Literals are not created by declarative statements. Instead, they exist in the program source code. Like all data objects, they have fixed technical attributes (field length, number of decimal places, data type), but no name. They are therefore referred to as unnamed data objects.
    b.  Named Data Objects
    Data objects that have a name that you can use to address the ABAP program are known as named objects. These can be objects of various types, including text symbols, variables and constants.
    Text symbols are pointers to texts in the text pool of the ABAP program. When the program starts, the corresponding data objects are generated from the texts stored in the text pool. They can be addressed using the name of the text symbol.
    Variables are data objects whose contents can be changed using ABAP statements. You declare variables using the DATA, CLASS-DATA, STATICS, PARAMETERS, SELECT-OPTIONS, and RANGESstatements.
    Constants are data objects whose contents cannot be changed. You declare constants using the CONSTANTSstatement.
    c.  Anonymous Data  Objects
    Data objects that cannot be addressed using a name are known as anonymous data objects. They are created using the CREATE DATAstatement and can be addressed using reference variables.
    d.  System-Defined Data Objects
    System-defined data objects do not have to be declared explicitly - they are always available at runtime.
    e.  Interface Work Areas
    Interface work areas are special variables that serve as interfaces between programs, screens, and logical databases. You declare interface work areas using the TABLES and NODESstatements.
    What is the difference between Type and Like?
    Answer1:
    TYPE, you assign datatype directly to the data object while declaring.
    LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.
    Answer2:
    Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.
    Answer3:
    type refers the existing data type
    like refers the existing data object
    reward if useful
    thanks and regards
    suma sailaja pvn

  • Data types and Data object

    Can Any one give me Clear definition of Data type and Data objects.
    Concept i know clearly.. but unable to explain it..
    Regards,
    Prasanna

    Data consists of strings of bytes in the memory area of the program. A string of related bytes is called a field. Each field has an identity (a name) and a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
             In the ABAP type concept, fields are called data objects. Each data object is an instance of an abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their own right. There are separate name spaces for data objects and data types. This means that a name can at the same time be the name of a data   object as well as the name of a data type.
    <b>Data Types:</b>
                     As well as occurring as attributes of a data object, data types can also be defined independently. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program (using the TYPES statement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
             Data types can be divided into elementary, reference, and complex types
    <b>Data objects:</b>
                      Data objects are the physical units with which ABAP statements work at runtime. Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running. The technical attributes of a data object are its length, number of decimal places, and data type. ABAP statements work with the contents of data objects and interpret them according to their data type. You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
    ABAP contains the following kinds of data objects
      Literals
       Named Data Objects
      Predefined Data Objects
      Dynamic Data Objects

  • Data types and data objects

    diff b/w data types and data objects

    hi prasanth,
    Data Types and Data Objects
    Programs work with local program data – that is, with byte sequences in the working memory. Byte sequences that belong together are called fields and are characterized by a length, an identity (name), and – as a further attribute – by a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
    In the ABAP type concept, fields are called data objects. Each data object is thus an instance of an abstract data type. There are separate name spaces for data objects and data types. This means that a name can be the name of a data object as well as the name of a data type simultaneously.
    Data Types
    Data types are templates for creating data objects. Data types can be defined independently in the ABAP program or in the ABAP Dictionary. As attributes of a data object, data types can also exist in a non-independent state. Data types do not use any memory space for work data, but may require memory for administration information.
    As well as occurring as attributes of a data object, data types can also be defined independently. You can then use them later on in conjunction with a data object. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program using the TYPESstatement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
    All programming languages distinguish between various types of data with various uses, such as ….. type data for storing or displaying values and numerical data for calculations. The attributes in question are described using data types. You can define, for example, how data is stored in the repository, and how the ABAP statements work with the data.
    Data types can be divided into elementary, reference, and complex types.
    a. Elementary Types
    These are data types of fixed or variable length that are not made up of other types.
    The difference between variable length data types and fixed length data types is that the length and the memory space required by data objects of variable length data types can change dynamically during runtime, and that these data types cannot be defined irreversibly while the data object is being declared.
    Predefined and User-Defined Elementary Data Types
    You can also define your own elementary data types in ABAP using the TYPES statement. You base these on the predefined data types. This determines all of the technical attributes of the new data type. For example, you could define a data type P_2 with two decimal places, based on the predefined data type P. You could then use this new type in your data declarations.
    b. Reference Types
    Reference types are deep data types that describe reference variables, that is, data objects that contain references. A reference variable can be defined as a component of a complex data object such as a structure or internal table as well as a single field.
    c. Complex Data Types
    Complex data types are made up of other data types. A distinction is made here between structured types and table types.
    Data Objects
    A data object is an instance of a data type and occupies as much memory space as its type specifies. An ABAP program only works with data that is available as content of data objects. Data objects are either created implicitly as named data objects, or exanonymous data objects using CREATEDATA.
    Data objects are the physical units with which ABAP statements work at runtime. The contents of a data object occupy memory space in the program. ABAP statements access these contents by addressing the name of the data object and interpret them according to the data type.. For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.
    Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type). You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
    A data object is a part of the repository whose content can be addressed and interpreted by the program. All data objects must be declared in the ABAP program and are not persistent, meaning that they only exist while the program is being executed. Before you can process persistent data (such as data from a database table or from a sequential file), you must read it into data objects first. Conversely, if you want to retain the contents of a data object beyond the end of the program, you must save it in a persistent form.
    Declaring Data Objects
    Apart from the interface parameters of procedures, you declare all of the data objects in an ABAP program or procedure in its declaration part. These declarative statements establish the data type of the object, along with any missing technical attributes. This takes place before the program is actually executed. The technical attributes can then be queried while the program is running.
    The interface parameters of procedures are generated as local data objects, but only when the procedure is actually called. You can define the technical attributes of the interface parameters in the procedure itself. If you do not, they adopt the attributes of the parameters from which they receive their values.
    ABAP contains the following kinds of data objects:
    a. Literals
    Literals are not created by declarative statements. Instead, they exist in the program source code. Like all data objects, they have fixed technical attributes (field length, number of decimal places, data type), but no name. They are therefore referred to as unnamed data objects.
    b. Named Data Objects
    Data objects that have a name that you can use to address the ABAP program are known as named objects. These can be objects of various types, including text symbols, variables and constants.
    Text symbols are pointers to texts in the text pool of the ABAP program. When the program starts, the corresponding data objects are generated from the texts stored in the text pool. They can be addressed using the name of the text symbol.
    Variables are data objects whose contents can be changed using ABAP statements. You declare variables using the DATA, CLASS-DATA, STATICS, PARAMETERS, SELECT-OPTIONS, and RANGESstatements.
    Constants are data objects whose contents cannot be changed. You declare constants using the CONSTANTSstatement.
    c. Anonymous Data Objects
    Data objects that cannot be addressed using a name are known as anonymous data objects. They are created using the CREATE DATAstatement and can be addressed using reference variables.
    d. System-Defined Data Objects
    System-defined data objects do not have to be declared explicitly - they are always available at runtime.
    e. Interface Work Areas
    Interface work areas are special variables that serve as interfaces between programs, screens, and logical databases. You declare interface work areas using the TABLES and NODESstatements.
    regards,
    sravanthi

  • Data types in internal tables.

    Examples for LINE & KEY.

    Mithun,
    Internal Tables as Data Types
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    Line type
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    Key
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    Pls. reward if useful

  • Predefined data types

    Hi,
    Can somebody give me details regarding predefined data types in ABAP and equivalent Character types ?
    For example :
    F2 type p  can be equivalent to F2(20) type c
    F2 CURR17 = F2(?)  TYPE c
    Thanks

    Hi,
    Predefined : it is used to specify the types of individual field whose lenghts are fixed.
    numeric(I,F,P)
    Charcter(C,D,N,T)
    Hexadecimal type(X)
    Predefined Elementary type with variable length (String for char String,XString for byte String)
    ACCP Posting period YYYYMM
    CHAR Character string
    CLNT Client
    CUKY Currency key, referenced by CURR fields
    CURR Currency field, stored as DEC
    DATS Date field (YYYYMMDD) stored as char(8)
    DEC Counter or amount field with comma and sign
    FLTP Floating point number, accurate to 8 bytes
    INT1 1-byte integer, integer number <= 255
    INT2 2-byte integer, only for length field before LCHR or LRAW
    INT4 4-byte integer, integer number with sign
    LANG Language key
    LCHR Long character string, requires preceding INT2 field
    LRAW Long byte string, requires preceding INT2 field
    NUMC Character string with only digits
    PREC Precision of a QUAN field
    QUAN Quantity field, points to a unit field with format UNIT
    RAW Uninterpreted sequence of bytes
    RAWSTRING Byte String of Variable Length
    SSTRING Short Character String of Variable Length
    STRING Character String of Variable Length
    TIMS Time field (hhmmss), stored as char(6)
    VARC Long character string, no longer supported from Rel. 3.0
    UNIT Unit key for QUAN fields
    Pls chk this links;
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm
    Hope this helps,
    Regards
    CSM Reddy

Maybe you are looking for

  • Aperture & Iphoto question

    I'm very disapointed with Iphoto not giving me the ability to delete the original file after i have edited it on Photoshop CS5, endless duplicating with no configurable alternative. I want to know if aperture does the same thing ? or does it delete t

  • Hide Dynamic columns and remove space

    I have an application that allows users to generate a Crystal report containing selected columns.  A user is able to check which columns should appear on the report from a web page.  I'm able to display and suppress the dynamic columns but the space

  • Nokia E-5 music player does not show all songs. Th...

    my Nokia E-5 music player does not show all songs. The filemanager does though. have tried every damn thing that i could, from the internet. no solution yet. Nokia wont address it. any solutions? please dont ask me to refersh my music player. nokia n

  • Newsstand Problem in iOS 7

    I have a problem with Newsstand after upgrading to iOS 7. When I try to open a magazine a window pops up saying "Connect to iTunes to Use Push Notifications." When I dismiss the window it immediately pops up again, ad infinitum. I'm not able to escap

  • SRM-MDM Catalog product heirarchy

    Hi, Please let me know how to dispaly the product category heirarchies in SRM-MDM catalogs. Thanks, Manu