Calculation between type DEC & CURR

data l_dmbtr type dmbtr. " curr 13 2
data l_dec type zdec. " dec 12 6
l_dec = '10.000000'.
l_dmbtr = 10000 * l_dec.
in program, the L_dmbtr get value '100000.00',
but in OO context, l_dmbtr get value '1000000000.00'.
could someone give me some link to explain the calculation of the DEC and CURR?
and is there the problem of OO context?

Hi,
Fixed point arithmetic
If you mark this checkbox, all calculations in the program will use fixed point arithmetic.
If you do not, packed numbers (ABAP/4 type P, Dictionary types CURR, DEC or QUAN) will be treated as integers when they are used in assignments, comparisons, and calculations, irrespective of the number of decimal places defined. Intermediate results in arithmetic calculations will also be rounded to the next whole number. The number of decimal places defined is only taken into account when you output the answer using the WRITE statement.
Regards,
Gaurav

Similar Messages

  • Cannot be converted in type DEC,CURR - longtext

    Dear,
    When we are loading the data to the targets, we are getting the errors in the Transfer rules like mentioned bellow
    Info source 0EC_CS_1 (Transaction Data for Consolidation)
    Status (tab) :
    Technical : Collection in source system ended
    Processing Step : Processing End
    Details (tab):
    Processing end : Errors occurred
    Error records written to application log
    Error in an arithmetic operation in record 1
    Record 1 :Contents 00 0.0000000 from field PCNT1 cannot be converted in type DEC ->longtext
    Info source 0CO_OM_CCA_9 (Cost Centers: Actual Costs with Delta E)
    Record 39952:Contents 048624.95- 1 from field SWF cannot be converted in type CURR ->longtext
    Kindly help.
    Thanks & Regards,
    Kiran A
    Edited by: Kiran A on Mar 21, 2010 10:23 AM
    Edited by: Kiran A on Mar 21, 2010 11:36 AM

    Hi,
                   It is sure some where in transferrules the mapping wasdone wrongly , like char --char of info object but in ur case some where data element is not same for field and info object.
      check throughly transfer rules correctly field level and infoobject mapping  and activate.
    it is some where currency and unit fields the difference is there for data elements
    Thanks&Regards,
    Sathish
    Edited by: sathish kakumudi on Mar 21, 2010 4:01 PM

  • Difference between types of plan data

    Hi Friends,
    BPS
    1. Cost Center Planning: Costs and Allocations
    2. Cost Center Planning: Activity Type Prices
    3. Cost Center Planning: Cost Center/Activity Type Prices
    4. Cost Center Planning: Cost Driver
    For the above types of data, I like to understand what is the difference them.
    For type 1, I understand it is for primary costs.
    For type 2 and 3 they are related / same type of data. So what is the difference between them?
    For type 3, seems like combo of types 1 and 2.
    For type 4, I am not sure what it is about.
    Questions I have:
    <b>1</b>. Why is it only primary costs. Where is secondary costs?
    <b>2</b>. Type 1 costs is identified by cost elements of costs centers. But type 2 is by activity, quantity and rates ( i think). And costs calculated. So, is this type of cost outside the cost calculation of type 1 such that to get wholistic cost picture, need to add types 1 and 2 at least? Thus, are they mutually exclusive.
    <b>3</b>. Now, how does the same apply to type 4?
    <b>4</b>. What is the purpose of type 3?
    Hope you could advise me friends
    Regards
    Michael

    Hello Michael,
    Different types of CO planning relate to how an organization is using SAP Controlling functionalities. Activity represent typically internal labor/machine provided by one department (cost center) to a production order, project network etc. depending on the type of organization (production activities or project-driven operation etc.). Activity price would set per cost center for time of periods (months), representing standard price for valuation of actitivities.
    More CO documentation attached:
    http://help.sap.com/saphelp_erp2005/helpdata/en/dd/4298375ae2f84ae10000009b38f8cf/content.htm
    Regards
    Auvo Ahola

  • Differnce between type f and type p?

    Hi All,
    What is the Differnce between type f and type p?
    Regard,
    Mike

    Hi Mike
    Differnce bw type F and type P:-
    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.
    C ---> character
    D ---> date
    P ---> packed
    T ---> time
    X ---> hexadecimal
    I ---> integer.
    N ---> Muneric.
    Reward pts if help.
    Regards
    Deepanker

  • The data type DEC while downloading from ALV to EXCEL

    The data type DEC while downloading from ALV to EXCEL is giving some invalid data .
    Ex : In ALV field is the time difference in  hours:minutes
      if the value is  :23 in Excel it will be 22:59 .
    Please Suggest immediately

    Hi ....
    I have the similar problem. My coumns are not in any sequence when I download it to excel sheet.
    How do I fix it.
    Neha

  • Crystal reports- Calculation between two reports

    Hi Experts
    I have designed a sales and purchase transaction report using crystal reports and i have designed another report for accounting transactions like Excise Duty payable and receivables, Vat payable and receivables, Expenses(like EB, Maintenance) and so on. Finally I added accounting report as sub-report into First Report.
    My question is, is it possible to made some calculations between sub-report and main report.
    Hope some solutions from you.
    By
    Kala

    Hello,
    right upto the linking is good?
    Right now you have to create a formula (which you might have already done for "Total expenses", you just need to alternate it slightly.
    Example:
    On 2nd report (subreport) You might have a formula like given below.
    Instead of Numbervar CAvg, which is the last shown value in the below formula, you have to make it like Shared Numbervar CAvg.
    Whileprintingrecords;
    Numbervar TJs;
    Numbervar TotalJobs=0;
    Shared Numbervar CAvg;
    Shared Numbervar CAvg=0;
    TotalJobs := DistinctCount({lab_credits.credit_no},{lab_credits.reason_code}); 
    CAvg:= TotalJobs /{@WorkingDays};
    TJs:=TJs + CAvg;
    CAvg
    Do your calculation above.
    Now in the main report you will create another formula which will look like below.
    Whileprintingrecords;
    Shared Numbervar CAvg;
    Numbervar TAvg:=fieldname;
    Numbervar TotalBoth:= Shared Numbervar CAvg+ Numbervar TAvg;
    TotalBoth;
    You will have a reset formula which will be placed ontop of the report header , group header if you are using grouping like this
    Whileprintingrecords;
    Shared Numbervar CAvg:=0;
    SHared Numbervar TAvg:=0;
    bearing in mind that we do not have to declare CAvg field here as it is being shared.
    Hope this helps
    Regards
    Jehanzeb

  • Error:   /BIC/ZPROP_REM cannot be convertedin type DEC

    Hi All,
    I am loading data from a flatfile, I am able to see Data coming in preview, but when I schedule its shooting an error message,
    Record                                                   1:ContentsProperties Remedi from field /BIC/ZPROP_REM cannot be convertedin type DEC ->longtext
    Message no. RSAR198
    Diagnosis
    The value 'Properties Remedi' from field /BIC/ZPROP_REM cannot be converted into the DDIC data type DEC of the InfoObject in data record                                                   1. The field contentcould not be transferred into the communication structure format.
    System response
    The data to be loaded has a data error or field /BIC/ZPROP_REM of the transfer structure is mapped to an unsuitable InfoObject.
    The conversion of the transfer structure into the communication structure was cancelled. The processing of data records with errors was continued with respect to the settings in the error handling of the InfoPackage (Tab Page: Update Parameters).
    Not able to find the solution..
    Please help in resolving this,
    Thanks in Advance,
    Sai

    Hi Kapadia,
    thanks for ur immedaite reply,
    As I am loading flatfile, the transfer rule assignment will be generated automatically when we aiisgn datas source,
    moreover its a keyfigure which is in DEC format..
    please explain me where I am going wrong..
    Thanks,
    Sai

  • Function module to convert float value to data type 'dec'

    Hi experts,
      In a report i need to convert float value to the data type 'DEC'. How to convert it. Is there any function module for this conversion.
    Thanks and Regards,
    Vaibhav Tiwari.

    Hi ..
    We can do like this...
    Data : V_float type F value '12345.67'.
    Data: V_dec type P Decimals 2.
    Write:/ V_float exponent 0. "This will display it like Type P
    or
    Write V_float to V_dec EXPONENT 0.
    Write:/ V_dec.
    reward if Helpful.
    <b></b>

  • Enable "dynamic date calculation" variable type

    When saving reporting date/period in a report variant, we may use "dynamic date calculation" to specific date as selection parameter.  But the "Dynamic date calculation" is not visible in some ABAP reports - only "Table Variable from TVARVC"  type is available for selection. 
    For those reports that are missing that variable type, how can we enable the "Dynamic date calculation" variable type to be visible?

    Hi Paco:
    Yes, they are z-reports, both have the same almost everything, created by the same ABAPer, for the same application SD, just grouping the data differently.
    It seems a screen (#100?) is missing,  In the old version, it's screen 100 where to activate the "D" and "B" variable types.  Now it goes to screen 281.
    Stacy

  • Displaying type dec when value = 0

    I have a variable which is of type dec. When 0 is entered as a value, the value displays as a blank field whereas I want to display as 0.0 - but only if 0 has been entered as a value. Can this be done?

    I have come with an approach but to be honest I think your original is probably better.
    I have basically worked with character fields but created them in the dictionary and used
    conversion exits.
    I created a data element ZNRW_CHAR5 using a domain of the same name.
    The domain ZNRW_CHAR5 is type CAHR length 5 but has an output length of 6 and uses a convers routine of ZNRW5.
    I created a local function group which contained two function modules which have the same interface:
    an untyped importing parameter 'input' and a simlar exporting parameter 'output'.
    CONVERSION_EXIT_ZNRW5_INPUT...the only code in this is: output = input.
    CONVERSION_EXIT_ZNRW5_OUTPUT...has a bit more code
    data l52(3) type p decimals 2.
    data l_string(6) type c.
    clear output.
    if input co ' 1234567890.'
    and input is not initial.
    write input to l_string.
    l52 = l_string.
    output = l52.
    endif.
    I created a test abap:
    REPORT  ZNRW_TEST_CONV_EXIT.
    parameters: p_char type ZNRW_CHAR5.
    write:/ '''' no-gap,p_char no-gap,''''.
    This works but I think it's messier than your origianl. Maybe it could be cleaned up a bit??

  • Problem with type DEC

    Hi,
    I have a data of type DEC in a table, in MI Server. The value it is 3. When i sync the app this value is transformed in 786435 by MI Server. And this happen with all data of this type. Anynone knows what can be happen?
    Thanks..

    Hi Jo,
    We are using smartsync layer... When i get this field, the type it is P in the application... I'm confusious because if i do a select in the table on MI Server, the data is returned correctly and when this data is sync, in the merep mon shows that this value updated. anymore idea?
    Thanks.

  • I get error message DB745 with EDIT ALV on a field type DEC?

    Hi,
    I have an ALV which has a field type DEC.
    The ALV is open for edit.
    Once I put negative number in, I get the error message DB745.
    This error is retrieved from SAP code and I do not see any reason why.
    I checked the field cat and it looks fine (ref to a field type DEC).
    I am using lcl_grid_event_receiver with method: handle_data_changed FOR
    EVENT data_changed OF cl_gui_alv_grid.
    In that method I get the error in er_data_changed->mt_protocol.
    There is no problem to show negative data if it is saved in the database
    as negative.
    Can anyone throw ideas how to fix that?
    Thanks,
    Itay

    If you simply check the domain WERT7, you'll see that the checkbox for "Sign" is <b>not</b> checked. Therefore negative numbers are <b>not</b> allowed.
    Just because a field is decimal or currency does <b>not</b> mean that negatives are allowed.
    Many times, the sign is handled by a separate debit/credit indicator field such as a field with a domain of SHKZG.
    Rob
    Message was edited by:
            Rob Burbank

  • Difference between type lvc_t_fcat and slis_t_fieldcat_alv

    Can you tell me the difference between type lvc_t_fcat and slis_t_fieldcat_alv?
    Both are used for field catalogue so which one is better to use?

    Hi,
    the field catalog using lvc_t_fcat  has some better and enhanced features over the old slis_t_fieldcat_alv.
    Ideally when displayed a normal ALV using these fieldcatalogs does not have any difference...
    You can more enhanced features of ALV using lvc_t_fcat but these cannot be done using slis_t_fieldcat_alv
    For using lvc_t_fcat, you require a screen and a container area...
    Based on the requirement, use the  fieldcatalogs.
    Also slis_t_fieldcat_alv does not have any classes or methods but the other has so..(objecct oriented)
    Regards
    Sk

  • Difference between type of Secondary Cost Element Category?

    Hi,
    I checked the system, and during the secondary cost element (CE) creation, I can select some of the CE category as follows:
    21 Internal settlement
    31 Order/project results analysis
    41 Overheads
    42 Assessment
    43 Internal activity allocation
    50 Project-related incoming orders: Sales
    51 Project-related incoming orders: Other
    52 Project-related incoming orders: Costs
    61 Earned value
    My question, what kind of report that I can read entries with these kind of CE?
    Reason: I want to check what has been posted to these secondary CE.
    Or
    Could anyone explain the use of above-mentioned CE category in brief?
    Thanks.

    Cost element that is used to allocate costs for internal activities.
    Most often used categories are
    21 Internal settlement
    (When ever an order is settled e.g internal order settling to cost center through this type of cost elements)
    31 Order/project results analysis
    (WIP in production orders are calculated and posted using this category)
    41 Overheads
    (Used in costing sheet to do an overhead allocation)
    42 Assessment
    (whenever cost is allocated between cost centers through allocation method - Assessment)
    43 Internal activity allocation
    (found in production orders when a routing activity is confimed the charge goes to the production order through this cost element)

  • DEC, CURR in a Custom Screen

    hi guys,
    I have this custom screen that displays DEC 12,2 CURR, and DATE. I am struggling to solve for some issues:
    1. For DEC type, The value moves in 2 decimal places. The correct value from the code is 12.34, but it is displayed as .1234
    2. For the 2 data types, how can I remove the default zeroes (for empty values) ? I know that this is already a characteristic of a data type. I have doubts of changing the values to CHAR it may affect negative and decimal values.
    need your professional advice.
    thank u

    Ans 2:
    *Macro for assigning space rather than 0.00 for numeric fields
    DEFINE concat_nonull.
    describe field &5 type w_type.
    if 'PND' cs w_type and &5 is initial.
    concatenate &1 '' into &3 separated by &4.
    else.
    concatenate &1 &2 into &3 separated by &4.
    endif.
    END-OF-DEFINITION.
    using the macro
    concat_nonull lf_line lf_buf lf_line c_tab <fs_comp>.

Maybe you are looking for

  • Apple tv 1st gen starts to sync then freezes up

    wanted to add somemore christmas tunes to my 1st gen. apple tv.would not let me sync.did everything the set-up shows.apple support said to reset atv back to factory settings.I would loose content (14,000 songs)but could sync them over again.Now every

  • Standard report for sales history.

    hi,     i need a standard report for sales history(all sales order ) for my company code. in va05 transaction it shows only for sales area. give the tcode . regards muthuraman.d

  • Firefox slows or freezes on Google Blogger Editor

    When writing or editing a post on Google's Blogger, right at the start, Firefox freezes for sometime when opening a new blank editor page. After it works OK. This initial freeze when opening the editor has been happening for over one year now. Since

  • Exported file is longer than actual podcast.

    Every time I export my audio file from Garageband to ACC format, the file is always longer than the audio that is contained in the file. How do I make a 38 second file export as a 38 second file? Thanks!

  • Adobe Illustrator CC 2014 – Smart Guides Not Working

    I have been having an issue with Illustrator CC 2014's smart guides not snapping to other objects. In this instance I dragged used the 'Selection Tool' to drag one of the 8 points of the bounding box to the second square. This also happens when tryin