Type Decimal in ABAP

Hi All,
Data : var1 type zdec.      (here zdec is of type decimal with length 5)
var1 = 1,234.
Now i want only two places after decimal. Which means (1,23). How can i do this ? Please suggest if there is any function Module

data: var1(5) type p decimal 2.
This will solve your problem.
please take F1 help for such issues.
Regards
Suvendu

Similar Messages

  • How to declare variable for Table type in the ABAP Editor

    Hi!
    I have Table Type 'FIELDNAME_TAB' (Table of fieldnames). I want to pass the list of fieldnames to this Table Type in the ABAP Editor.
    Can anyone help me in this?

    You would declare the internal table like so.
    data: itab type FIELDNAME_TAB.
    data: wa like line of itab.
    wa = 'This_value'.
    append wa to itab.
    Regards.
    Rich Heilman
    Message was edited by:
            Rich Heilman

  • Consume Type Any in abap proxy

    Hi experts,
    Is it possible to consume the type Any in abap proxy?. I dont want to change the schema type to string. The generated proxy hasn't any final type. Check the screenshoots:
    Regards.

    well XSDANY is a rawstring, it is not an ANY type. A rawstring, defined in DDIC is the same thing as a xstring in ABAP. So I propose you to look e.g. at this post:
    Guide towards a simple conversion of an XML file to ABAP Internal table, using XML parsing.

  • Data Type Convertion in ABAP

    Hi,
    i want to convert a numeric type field to character type field in ABAP,
    and also i want to concatenate some set of different types of field to a character type field at last
    if i give just like this
    <b>CONCATENATE '   ' it_pa0000-pernr it_pa0105-usrid '                        ' it_pa0105-begda into record_tab-string.</b>
    it remove space out from the string i need space also in the <b>record_tab-string</b>,
    Reg,
    Hariharan

    Hi,
    The CONCATENATE statement combines two or more separate strings into one.
    <b>CONCATENATE <c1> ... <cn> INTO <c> [SEPARATED BY <s>].</b>
    This statement concatenates the character fields <c1> to <cn> and assigns the result to <c>. The system ignores spaces at the end of the individual source strings.
    The addition SEPARATED BY <s> allows you to specify a character field <s> which is placed in its defined length between the individual fields.
    try with this sample code..........
    CONCATENATE  it_pa0000-pernr it_pa0105-usrid  it_pa0105-begda INTO record_tab-string  SEPARATED BY SPACE.
    regards,
    Ashok Reddy

  • Whats the important of "  table-type  " in sap abap?

    hi,
    i am ahmed. abap fresher.
    i want to what use and importance of table-type in sap abap which comes in      
                         datadictionary
                                V               
                        data types
    V----
    V                         V                                 V
    data element       structure                   table type
    i want to know about table type. plz give a brief idea.
    bye.

    hi,
    Transparent Tables
    A transparent table in the dictionary has a one-to-one relationship with a table in the database. Its structure in R/3 Data Dictionary corresponds to a single database table. For each transparent table definition in the dictionary, there is one associated table in the database. The database table has the same name, the same number of fields, and the fields have the same names as the R/3 table definition. When looking at the definition of an R/3 transparent table, it might seem like you are looking at the database table itself.
    Transparent tables are much more common than pooled or cluster tables. They are used to hold application data. Application data is the master data or transaction data used by an application. An example of master data is the table of vendors (called vendor master data), or the table of customers (called customer master data). An example of transaction data is the orders placed by the customers, or the orders sent to the vendors.
    Transparent tables are probably the only type of table you will ever create. Pooled and cluster tables are not usually used to hold application data but instead hold system data, such as system configuration information, or historical and statistical data.
    Both pooled and cluster tables have many-to-one relationships with database tables. Both can appear as many tables in R/3, but they are stored as a single table in the database. The database table has a different name, different number of fields, and different field names than the R/3 table. The difference between the two types lies in the characteristics of the data they hold, and will be explained in the following sections.
    Table Pools and Pooled Tables
    A pooled table in R/3 has a many-to-one relationship with a table in the database (see Figures 3.1 and 3.2). For one table in the database, there are many tables in the R/3 Data Dictionary. The table in the database has a different name than the tables in the DDIC, it has a different number of fields, and the fields have different names as well. Pooled tables are an SAP proprietary construct.
    When you look at a pooled table in R/3, you see a description of a table. However, in the database, it is stored along with other pooled tables in a single table called a table pool. A table pool is a database table with a special structure that enables the data of many R/3 tables to be stored within it. It can only hold pooled tables.
    R/3 uses table pools to hold a large number (tens to thousands) of very small tables (about 10 to 100 rows each). Table pools reduce the amount of database resources needed when many small tables have to be open at the same time. SAP uses them for system data. You might create a table pool if you need to create hundreds of small tables that each hold only a few rows of data. To implement these small tables as pooled tables, you first create the definition of a table pool in R/3 to hold them all. When activated, an associated single table (the table pool) will be created in the database. You can then define pooled tables within R/3 and assign them all to your table pool (see Figure 3.2).
    Pooled tables are primarily used by SAP to hold customizing data.
    When a corporation installs any large system, the system is usually customized in some way to meet the unique needs of the corporation. In R/3, such customization is done via customizing tables. Customizing tables contain codes, field validations, number ranges, and parameters that change the way the R/3 applications behave.
    Some examples of data contained in customizing tables are country codes, region (state or province) codes, reconciliation account numbers, exchange rates, depreciation methods, and pricing conditions. Even screen flows, field validations, and individual field attributes are sometimes table-driven via settings in customizing tables.
    During the initial implementation of the system the data in the customizing tables is set up by a functional analyst. He or she will usually have experience relating to the business area being implemented and extensive training in the configuration of an R/3 system.
    Table Clusters and Cluster Tables
    A cluster table is similar to a pooled table. It has a many-to-one relationship with a table in the database. Many cluster tables are stored in a single table in the database called a table cluster.
    A table cluster is similar to a table pool. It holds many tables within it. The tables it holds are all cluster tables.
    Like pooled tables, cluster tables are another proprietary SAP construct. They are used to hold data from a few (approximately 2 to 10) very large tables. They would be used when these tables have a part of their primary keys in common, and if the data in these tables are all accessed simultaneously. The data is stored logically as shown in Figure 3.3.
    Figure 3.3 : Table clusters store data from several tables based on the primary key fields that they have in common.
    Table clusters contain fewer tables than table pools and, unlike table pools, the primary key of each table within the table cluster begins with the same field or fields. Rows from the cluster tables are combined into a single row in the table cluster. The rows are combined based on the part of the primary key they have in common. Thus, when a row is read from any one of the tables in the cluster, all related rows in all cluster tables are also retrieved, but only a single I/O is needed.
    A cluster is advantageous in the case where data is accessed from multiple tables simultaneously and those tables have at least one of their primary key fields in common. Cluster tables reduce the number of database reads and thereby improve performance.
    For example, as shown in Figure 3.4, the first four primary key fields in cdhdr and cdpos are identical. They become the primary key for the table cluster with the addition of a standard system field pageno to ensure that each row is unique.
    Reward if helpful
    Jagadish

  • Setting the content type inside the ABAP mapping.

    Hello All,
    Can any one help me by telling me how to set the content-type inside ABAP mapping. I have searched a large no of blogs and help.sap.com for the same.
    My requirement is I want to change the MIME type of the Main Document in side SXMB_MONI so that can change the content type of Main document which is application\xml by default.
    I would appreciate an early response regarding the same.
    Abinash

    Hello Raj,
    The output of my ABAP mapping is a flat file. So when I try to open the file with content type application/xml in the message monitor it shows the file has some error which is natural. The way to get around this problem is change the content type to application\txt from application\xml.
    I am not finding an option to set the content type inside the ABAP mapping for the same.
    Abinash

  • Wrong numbering of elements styled with "display: list-item; list-style-type: decimal;"

    Following code :
    <!DOCTYPE html>
    <style type="text/css">
    div {
    display: block;
    margin-left: 2em;
    span {
    display: list-item;
    list-style-type: decimal;
    </style>
    &lt;div>
    &lt;span>first&lt;/span>
    &lt;span>second&lt;/span>
    &lt;span>third&lt;/span>
    &lt;/div>
    Displays as :
    0. first
    0. second
    0. third
    while looking fine in other browsers (checked IE7, chrome, opera, safari...)

    updated code snap...

  • What is the use P type variable in ABAP?

    ex:
    data <variable name > type p decimals 2.
    here what is the use of declaring it to p type.
    what is the difference between p type and float type.

    Hi,
    using packed variable we can decide the length of number and  number of decimals we want in o/p which is not possible with other types
    Packed numbers - type P
    Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
    You can use type P data for such values as distances, weights, amounts of money, and so on.
    Floating point numbers - type F
    The value range of type F numbers is 1x10*-307 to 1x10*308 for positive and negative numbers, including 0 (zero). The accuracy range is approximately 15 decimals, depending on the floating point arithmetic of the hardware platform. Since type F data is internally converted to a binary system, rounding errors can occur. Although the ABAP processor tries to minimize these effects, you should not use type F data if high accuracy is required. Instead, use type P data.
    You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.
    Using I and F fields for calculations is quicker than using P fields. Arithmetic operations using I and F fields are very similar to the actual machine code operations, while P fields require more support from the software. Nevertheless, you have to use type P data to meet accuracy or value range requirements.

  • Condition type decimal point issue in pricing

    Hi
    I have a import pricing Procedure as shown
    The condition types JEDB and JSED were calculated on 0.16 EUR,
    Like JEDB 2% of 0.16EUR= 0.0032
    and JSED 1% of 0.16EUR= 0.0016
    it is taking the first two digits of the value, ie 0.00 only
    Please confirm how to come with the corrected values,
    Thanks,

    Yes it is intended for TM but you can do the manual changes as recommended in the note and for technical coding, you can copy that logic.  Else, have a look at this note:-
    Note 38881 - Pricing with different decimal places
    G. Lakshmipathi

  • TYPES statement in abap class to include structure

    hi ,
    i have declared following in a abap class...
    TYPES:
          zts_alv_line TYPE zmat_pr_costest_alv.
         TYPES:BEGIN OF ts_alv_line,
                include type zts_alv_line,
                matkl type mara-matkl,
                t023t type t023t-wgbez,
                lvorm type mara-lvorm,
                end of ts_alv_line.
         TYPES: tt_alv_data TYPE STANDARD TABLE OF ts_alv_line WITH DEFAULT KEY.
         DATA:
          alv_data TYPE tt_alv_data.
    now while refering to alv_data-matnr the sap is giving error that this component does not have matnr.
    please help.
    Edited by: Suhas Saha on Feb 3, 2012 1:11 PM

    TYPES: zts_alv_line TYPE zmat_pr_costest_alv.
    TYPES:BEGIN OF ts_alv_line,
                include type zts_alv_line,
                matkl type mara-matkl,
                t023t type t023t-wgbez,
                lvorm type mara-lvorm,
                end of ts_alv_line.
    Actually by defining this you've defined include as field of ts_alv_line. Actually ts_alv_line is a nested structure.
    I think you need to re-define the structure definition as:
    TYPES:BEGIN OF ts_alv_line.
          INCLUDE TYPE zts_alv_line.
    TYPES: matkl TYPE mara-matkl,
           t023t TYPE t023t-wgbez,
           lvorm TYPE mara-lvorm.
    TYPES: END OF ts_alv_line.
    BR,
    Suhas

  • How to Get File type in webdynpro abap

    Hi,
    I am using File Upload UI element of webdynpro ABAP to upload data  into SAP table. I want that the file type should only be tab delimited. How to get the file type to validate the same.
    Regards,
    Dhiraj Mehta

    hi,
    just follow the link :
    http://help.sap.com/saphelp_40b/helpdata/en/2a/fa02b7493111d182b70000e829fbfe/content.htm
    Hope this will help u!!!
    thanks & regards,
    punit raval.

  • Custom proces type based on ABAP OO class

    Hy,
    I have a process type and in one method of its asoociated ABAP OO class I have to check if their process chains are running or not.
      I know how to make the tests, but the problem is that I have to integrate them in one method. I'm lookink for a solution to adapt the process type from :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/509f3ae6-e36e-2910-48a8-ab43dc167dd9   
    Any suggestions about what should I keep or not and in which method should I put my tests?
    Thank you.

    Hello,
    Sorry, not sure where my brain was. Actually I do know: at two clients with projects going live this month, so apologies for a rushed and inaccurate response. It's CL_SWF_EVT_EVENT.
    Jocelyn's blog I referred to includes a code sample using the same class on how to raise an event with an object key.
    Regarding your second question: No you don't need to do any binding. Just use an instance of your object and it will wait for an event with the same key. The WF part is very straightforward and works exactly like BOR, it's just raising event that can't be done with the WAPI.
    Cheers,
    Mike

  • How to indicate a message by a planning function type in an ABAP-OO-Class

    Hello,
    I integrated a message with following statement " MESSAGE i003(upf1) WITH v1 v2." in an ABAP-OO-Class, which is used by a Planning Function Type. The function type works but it´s not indecated after executing the Planning Sequence, neither from web template nor in the planning modeller.
    Does anybody know this problem/behavior?
    Thank for response
    Andreas

    Hi Joerg,
    how about this:
    data: l_dummy type char100.
    MESSAGE i003(upf1) WITH v1 v2  into l_dummy.
    i_r_msg->add_msg( ).
    You do not need to take special care about the variables. Just raise the message as you want it to be raised. The only thing you need to do is to raise the message into a string (..into l_dummy). The interface IF_RSPLFA_MSG and the implemetation of add_msg is going to read the standard message variables (SY-MSGNO, SY-MSGID, SY-MSGTY, MSGV1 ...). You just need to throw the message
    and call  i_r_msg->add_msg( ) e.g. in the execute method of your customer planning function.
    Please give it a try and take a look at it in the debugger.
    Hope this helps.
    Matthias Nutt
    SAP Consulting Switzerland

  • NUMBER return types (Decimal/Int16/Int32) how does it work?

    We ran into a problem with a stored procedure returning the result of a select (using Fill method).
    Sometimes some data comes back as int32, sometimes the same data has decimal as datatype.
    We've been struggling to get the same datatype back all the time for the same column. Unfortunately so far without success. The problem is that these columns are part of our key and we can't use a 'relation' between them if the datatypes are int32/decimal: they don't match.
    To simulate the problem:
    Create table myTest (col1 number(2));
    insert a row (e.g. 12)
    SELECT col1 FROM myTest
    this becomes an Int16 when retrieved.
    now comes the strange part:
    SELECT col1 FROM myTest
    UNION
    SELECT 0 FROM DUAL
    returns an DECIMAL.
    We tried:
    SELECT col1 FROM myTest
    UNION
    SELECT TO_NUMBER(0,2) FROM DUAL
    but this does not work, it still returns an Decimal (expected Int16).
    We tried to make the to_number into an outer select, we tried to create an UDT and populate that one, we tried a lot but did not succeed in get a guaranteed Int32 back.
    Any ideas on how to resolve this?

    Out of curiosity
    what does
    "select TO_NUMBER(0,2) from dual" returns? A Decimal or Int16?
    Maybe (i am really guessing here) the union stmt returns a NUMBER(x,y) type which will cause the provider to gives you back a Decimal .net type.
    Arnold

  • Passing values to idoc data of type edidd40  using ABAP

    Hi All,
    I am using orders05 (purchasing) idoc for creating purchase order inbound in ABAP program. I need to read a file and fill values to idoc_data of type edidd40
    and idoc control record (of type edidc) and call function module idoc_inbound asynchronous. In this, how can I fill the values to idoc_data (edidd40). If anyone has some sample program to fill idoc_data (of type edidd40), it will be helpful.
    Thanks

    Hi,
    Please find a sample code
    * Build Control records
    CONTROL_RECORD_OUT-MESTYP = MESTYP.
    CONTROL_RECORD_OUT-IDOCTP =  IDOC_TYPE.
    CONTROL_RECORD_OUT-RCVPRT = 'LS'.   " << Fill the receiver port type US/LS
    CONTROL_RECORD_OUT-RCVPRN = LOGSYS.
    * Build Data records
    *--- EDIDD40 data Here if you have multiple items then make a loop
    loop at i_itab.                   " i_itab contains the details about EDIDD40 fields
      IT_EDIDD-SEGNAM = SEGMENT.   " Will be EDIDD40
      IT_EDIDD-SDATA = i_itab.
    *--- Append the data
    APPEND IT_EDIDD.
    endloop.
    aRs

Maybe you are looking for

  • Log-in lately doesn't work in Chrome or Firefox.

    This isn't consistent, just happens in some posts. Seems like you think Apple couldn't possibly make things worse they just dig deeper into that big bag of hurt they have in Cupertino.

  • [solved] Virtualbox guest additions stopped working

    Hi, I got some trouble after an upgrade of kernel yesterday. Virtualbox guest additions doesn't work any longer, and I have tried both downgrading virtualbox-guest-additions and the new linux that got pushed yesterday, but it's still not working. Is

  • NUmber of records in query mismatch number of records in file

    Hi  Experts, I am running an APD having as source a query and target file. The issue is that in my query i have 78 records and in my file 138 any possible solutions?? Points will be awarded for useful answers. Kevin

  • ShowModalDialog in jsf

    I have a view page that shows a list account in a dataTable. When the user clicks on the edit link, a showModal box opens which shows the edit view for the list of accounts. When the user clicks on one of the Add or cancel action buttons, the action

  • IWeb and iPhone

    If you want to see how your website will view on an iPhone the latest version of the freeware application iPhoney is available at.... http://www.marketcircle.com/iphoney/ Message was edited by: Roddy