Decimal place in ALV

Hi
i have created an ALV for the excise department and the output is coming correctly,but the problem i face is that the value for the export goods(series 21) comes wrongly.for eg:it has to come 407952.60 it comes as 4,079,526.00.
I like to know how to bring the decimal point one place in front
thanks in advance

HI,
Try use the code as below while building fieldcatalog for that field.
gs_fieldcat-datatype = 'DATATYPE'.
Thanks,
Sriram Ponna.

Similar Messages

  • Quantity column display upto 2 decimal places in ALV

    I've created an ALV for dynamic columns. For this i've first created the fieldcatalog and then the internal table.
    The problem that i'm facing in this is that the user wants the quantity column to be displayed upto 2 decimals. For this i tried the following:
    1.)     wa_fldcat-decimals_o = '2'
             wa_fldcat-decimals    = '3'.
             wa_fldcat-datatype     = 'QUAN'.
    with this i tried that let the calculation be to 3 decimal places but on output it should show 2 decimal places.
    But this doesnot gets reflected on ALV. It still shows 3 decimal places.
    eg:  3 decimal places: 16.667 + 16.667 + 66.667 = 100.001
    2.)     wa_fldcat-decimals_o = '2'
             wa_fldcat-decimals    = '2'.
             wa_fldcat-datatype     = 'CURR'.
    I also tried doing the calculation with 2 decimal places with datatype CURR but with this the last digit gets rounded.
    eg:  2 decimal places:  16.67  + 16.67   + 66.67   = 100.01
    Now we are taking total as 100 %. So tha calculative total cannot be more than 100.
    On seeing 100.001 user says show it to me to 2 decimal places  i.e. 100.00
    On seeing 100.01 user says  how can the total be more than 100 & this is .01 more than 100.
    Therefore how can the 1.) option be achieved.
    PLZ HELP!

    Hi,
    Can u check this one
    DATA: gv_packed TYPE p DECIMALS 2.
    CATCH SYSTEM-EXCEPTIONS conversion_errors = 6.
    MOVE char_field TO gv_packed.
    ENDCATCH.
    IF sy-subrc = 6.
    error handling
    ENDIF
    Try to move ur char field to a type p field. If char field is other than numeric then u will get error that can be handled in try...chatch..endtry block.
    data: l_val type p decimals 2.
    parameter my_val type char20.
    try .
    l_val = my_val.
    catch cx_root.
    Do ur error handling here
    endtry.
    you can work with search and concatenate.
    value1 = 3601152
    search value1 for '.' .
    if sy-subrc eq 0.
    concatenate value1(5) '.' value1(2)+5 into text.
    Or value1 = value1 / 100.
    endif.
    Thanks.
    Ashok.

  • 2 decimal places in alv output

    Dear Experts,
    I need to display an quantity value with 2 decimals places in output. I have tried many options like,
    1.wa_fieldcat-decimals = '2'.
    2.wa_fieldcat-decimals_o = '2'.
    3.wa_fieldcat-ref_table = 'VBAP'.
      wa_fieldcat-ref_field = 'NETPR'.
    But its always coming with 3 decimal places. I have assigned a variable with type p & decimals 2.
    Also I searched sdn & found many threads. But still its coming as 3 places.
    Can you please guide me on the same.
    Bharath

    3.wa_fieldcat-ref_table = 'VBAP'.
    wa_fieldcat-ref_field = 'NETPR'.
    it's a currency field, you should give a column with currency to get the correct format
    wa_fieldcat-cfieldname = 'WAERS'.

  • Display amount in ALV Grid with different Decimal Places based on Currency

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2.
    we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65
    i need to display values like AED : 22.56

    HI Experts,
    Working with ALV Report i have one Amount field NETWR which is having Length 15 and Decimal Places 2. we have two different types of currency's AED and KWD and AED having 2 decimal Places and KWD having 3 decimal places.
    im using FM: REUSE_ALV_GRID_DISPLAY for Display. value storing in Table was like this
    AED---22.56
    KWD---225.65 (converting this value to 22.565 using BAPI_CURRENCY_GETDECIMALS according to currency in my Report)
    i need to display values like AED : 22.56
                                             KWD---22.565 but here field is NETWR with 2 decimal.
    Need to Display amount in ALV Grid with different Decimal Places based on Currency
    Regards,
    Dileep Kumar Reddy

  • Decimal upto 3 places in ALV report output

    Hi Experts
    My requirement is that User wants to have 3 decimal places in report output.I have used type P decimal 3,also have used field catalog Decimals_o = '3' .In the report output Lets say Previously it was 123 now after the changes its coming 123.000 but its only virtual when i try to edit that it takes only upto 4 characters like 123.???I think because the datatype defined is NUMC and its limited to 4 characters only so it is not allowing to enter more than 4 characters??Please suggest me a way?sud I change   the NUMC to 6 characters as it is standard??sud I make changes in it??
    Thanks & Regards
    Shankar

    Hi
    i have tried that but still it takes 4 characters in output.pasting the code
    1)The declaration part
    DATA : gv_gjahr TYPE gjahr,
           gv_plant TYPE cciht_ial-iaplant.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-003.
    SELECT-OPTIONS: s_plant FOR gv_plant NO INTERVALS NO-EXTENSION OBLIGATORY,
                    s_gjahr FOR gv_gjahr NO INTERVALS NO-EXTENSION OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    CONSTANTS : c_x          TYPE c VALUE 'X',
                c_celltab(7) TYPE c VALUE 'CELLTAB',
               c_gjahr(5)   TYPE c VALUE 'GJAHR',
                c_april(5)   TYPE c VALUE 'APRIL',
                c_may(3)     TYPE c VALUE 'MAY',
                c_june(4)    TYPE c VALUE 'JUNE',
                c_july(4)    TYPE c VALUE 'JULY',
                c_augus(5)   TYPE c VALUE 'AUGUS',
                c_septe(5)   TYPE c VALUE 'SEPTE',
                c_octob(5)   TYPE c VALUE 'OCTOB',
                c_novem(5)   TYPE c VALUE 'NOVEM',
                c_decem(5)   TYPE c VALUE 'DECEM',
                c_janua(5)   TYPE c VALUE 'JANUA',
                c_febru(5)   TYPE c VALUE 'FEBRU',
                c_march(5)   TYPE c VALUE 'MARCH',
                c_rw(2)      TYPE c VALUE 'RW',
                c_ro(2)      TYPE c VALUE 'RO'.
    TYPES : BEGIN OF ty_envtran,
              envno TYPE numc3,
              envlx TYPE zehenvlx,
              plant TYPE ccihe_iaplant,
              gjahr TYPE gjahr,
              april  TYPE numc4,
              may   TYPE numc4,
              june  TYPE numc4,
              july  TYPE numc4,
              augus TYPE numc4,
              septe TYPE numc4,
              octob TYPE numc4,
              novem TYPE numc4,
              decem TYPE numc4,
              janua TYPE numc4,
              febru TYPE numc4,
              march TYPE numc4,
            END OF ty_envtran.
    DATA: gt_envtran TYPE TABLE OF ty_envtran,
          gs_envtran TYPE ty_envtran,
          gt_envmast TYPE TABLE OF zehs_envmast,
          gs_envmast TYPE zehs_envmast.
    DATA: save_ok     LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'ZEHS_ENVIRONMENTS_CC1',
          g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout   TYPE lvc_s_layo,
          g_success   TYPE c,
          gv_success  TYPE c,
          gt_envtran3 TYPE TABLE OF ty_envtran,
          gs_envtran3 TYPE ty_envtran,                          "#EC NEEDED
          gt_envtran2 TYPE TABLE OF zehs_envtran,
          gs_envtran2 TYPE zehs_envtran.
    DATA: BEGIN OF gt_outtab OCCURS 0.     "with header line
    DATA: envlx TYPE zehenvlx,
          gjahr TYPE gjahr,
          april TYPE numc4,
          may   TYPE numc4,
          june  TYPE numc4,
          july  TYPE numc4,
          augus TYPE numc4,
          septe TYPE numc4,
          octob TYPE numc4,
          novem TYPE numc4,
          decem TYPE numc4,
          janua TYPE numc4,
          febru TYPE numc4,
          march TYPE numc4,
          plant TYPE ccihe_iaplant,
          envno TYPE numc3.
    DATA: celltab TYPE lvc_t_styl.
    DATA: END OF gt_outtab.
    DATA: gs_outtab LIKE LINE OF gt_outtab.
    2)The Field catalog part
    LOOP AT pt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN c_APRIL.
            ls_fcat-scrtext_l = 'April'(c01).
            ls_fcat-scrtext_m = 'Apr'(c13).
            ls_fcat-scrtext_s = text-c13.
          WHEN c_MAY.
            ls_fcat-scrtext_l = 'May'(c02).
            ls_fcat-scrtext_m = 'May'(c14).
            ls_fcat-scrtext_s = text-c14.
          WHEN c_JUNE.
            ls_fcat-scrtext_l = 'June'(c03).
            ls_fcat-scrtext_m = 'Jun'(c15).
            ls_fcat-scrtext_s = text-c15.
         WHEN c_JULY.
            ls_fcat-scrtext_l = 'July'(c04).
            ls_fcat-scrtext_m = 'Jul'(c16).
            ls_fcat-scrtext_s = text-c16.
          WHEN c_AUGUS.
            ls_fcat-scrtext_l = 'August'(c05).
            ls_fcat-scrtext_m = 'Aug'(c17).
            ls_fcat-scrtext_s = text-c17.
          WHEN c_SEPTE.
            ls_fcat-scrtext_l = 'September'(c06).
            ls_fcat-scrtext_m = 'Sep'(c18).
            ls_fcat-scrtext_s = text-c18.
          WHEN c_OCTOB.
            ls_fcat-scrtext_l = 'October'(c07).
            ls_fcat-scrtext_m = 'Oct'(c19).
            ls_fcat-scrtext_s = text-c19.
          WHEN c_NOVEM.
            ls_fcat-scrtext_l = 'November'(c08).
            ls_fcat-scrtext_m = 'Nov'(c20).
          WHEN c_DECEM.
            ls_fcat-scrtext_l = 'December'(c09).
            ls_fcat-scrtext_m = 'Dec'(c21).
          WHEN c_JANUA.
            ls_fcat-scrtext_l = 'January'(c10).
            ls_fcat-scrtext_m = 'Jan'(c22).
            ls_fcat-scrtext_s = text-c22.
          WHEN c_FEBRU.
            ls_fcat-scrtext_l = 'February'(c11).
            ls_fcat-scrtext_m = 'Feb'(c23).
            ls_fcat-scrtext_s = text-c23.
          WHEN c_MARCH.
            ls_fcat-scrtext_l = 'March'(c12).
            ls_fcat-scrtext_m = 'Mar'(c24).
            ls_fcat-scrtext_s = text-c24.
    Note: I have already tried giving DECIMALS_O,OUTPUTLEN,DATATYPE,FIELDCAT-REF_FIELD ,FIELDCAT-REF_TABLE BUT but still it takes upto 4 characters in output.

  • ALV output is 2 decimal places, but prints as 3

    Hi,
    In my current ABAP program, the output is shown as 2 decimals, using the following domain:
    Data Type: QUAN
    No. Characters: 13
    Decimal Places: 2
    Output length: 17
    However, during unit testing, it was found that during printing, instead of printing it out as 2 decimals (ex. 12.00,) its printed out as 3 decimals (ex. 12.000.)
    The same thing can be noticed when using Print preview. It starts at the editable fields and continues onward to others.
    Why is this occurring and what can I do to fix this problem?
    Points will be rewarded and all help will be greatly appreciated.
    Thanks,
    John

    Hi
    Check once again the attributes of that Qty field in Dataelement and domain
    Because for all QUAN type fields it is always 3 DECIMAL places
    you are saying it is 2
    check it
    All the qty fields in SAP with data type QUAN uses/prints 3 decimals
    so check and  see
    like fields LFIMG.MENGE,FKIMG,KWMENG all fields with 3 decimals
    Reward points for useful Answers
    Regards
    Anji

  • DIsplaying WRBTR (AMOUNT FIELD)WITHOUT  DECIMAL PLACES

    Dear all,
    I am facing a problem in displaying amount field  in alv report. I have two currency keys (US dollar and Japan yen). if it is japan yen I should not have to show decimal places and if it is US dollar I should show decimal places.
    How can I do it in a alv report if I have only one output amount field?
    thanks
    Ranjan.

    Hi chittaramjan,
    1. use this kind of funda (just copy paste in new program)
    Important things
    a) one extra field in internal table
      declared in the same exact fashion
    waers LIKE tcurc-waers,
    b) Populate this field
    c) REST THE System will take care
       (based upon country settings)
    2.
    REPORT abc.
    TYPE-POOLS : slis.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA  : BEGIN OF itab OCCURS 0,
            f1  LIKE P0008-BET01,
            waers LIKE tcurc-waers,
            END OF itab.
    START-OF-SELECTION.
      itab-f1 = '-4.15'.
      itab-waers = 'KRW'.
      APPEND itab.
      itab-f1 = '4.68'.
      itab-waers = 'GBP'.
      APPEND itab.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = sy-repid
          i_internal_tabname = 'ITAB'
          i_inclname         = sy-repid
        CHANGING
          ct_fieldcat        = alvfc.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-repid
          it_fieldcat             = alvfc
        TABLES
          t_outtab                = itab
        EXCEPTIONS
          OTHERS                  = 2.
    regards,
    amit m

  • Decimal places in quantity depending on currency

    hi
    i m doing an alv list display in which i need to display a quantity field with 3 decimal places for some currencies, but for one particular currency such as 'AED'
    that field should display only 2 decimal places in the output.
    regards
    Zarina

    Hi Zarina,
    Populate decimals_out with 2 for this field while building the fieldcatalog.
      g_t_fieldcat-decimals_out = 2.
    Note: don't declare the field as currency which will overwrite above setting.
    i.e., don't use g_t_fieldcat-cfieldname in this case.
    ==============================================
      g_t_fieldcat-seltext_s =  'USD Equi'.
      g_t_fieldcat-seltext_m =  'USD Equi'.
      g_t_fieldcat-seltext_l =  'USD Equivalent'.
    g_t_fieldcat-cfieldname = ' '.
      <b>g_t_fieldcat-decimals_out = 2.</b>
      g_t_fieldcat-just      =  'R'.
      modify g_t_fieldcat index zindx.
    ==============================================
    Hope this helps you.
    Regards,
    Vicky
    PS: Award points if helpful

  • GUI download, how to retain format of decimal places

    Hi everyone!
    I have a program that downloads data to excel file using GUI Download. The values of the amount in the ALV display are 11.90, 11.90- which is correct because it has two decimal places. But the problem now occurs in the excel file. The values are now 11.9, 11.9-.
    Do you know of any method that will retain the format of the values when it is already in the excel file.
    The format of my decimal notation is 1,234,567.89.
    Thanks in advance.

    Thank you!
    But I need to have the format of the numbers in the excel the same as the format in the ALV <b>without changing the format of the cells in the excel file</b>. It has to be changed in the program.
    Actually there are also amounts that are being displayed in excel file with 2 decimal places the same as the ALV display. But some of the amounts were changed when it comes to the excel file, and I don't know why this happens.
    Thanks.
    Message was edited by:
            Betsie Camoro

  • Decimal filed in ALV

    Hi Abaper,
    I am showing one field in ALV of likp LGMNG which is using refrence of data element LGMNG (QUAN     13     3). it is displaying with 3 decimal places.
    I want to display the value of LGMNG with 2 decimal place, how?
    Thanks,
    Rajesh.

    Hi,
    Use 
    ls_fieldcat-decimals    = '000003'.
    in the fieldcatalog. please let me know if problem not solved.
    Thanks

  • Displaying 3 decimal places?

    Hi,
    I have a bespoke program which picks up lines from bsis and displays them on a screen, the user then selects a few lines and the program posts them using program RFBIBL00. 
    Currently this program is working perfectly but I have a few countries which work with 3 decimal places instead of 2 and the program isn't picking this up.
    I've found that table TCURX holds currencies which have 3 decimal places but I want to know how I change all my internal tables and screen fields to suddenly have 3 decimal places instead of 2?  My internal tables and screen fields are all based on fields from BSIS and I have ALV grids and individual screen fields.  Do I need to duplicate all of the amount fields, one set to have 2 decimal places and the other to have 3?
    Any suggestions welcome.
    Gill

    OK, I've figured this out.
    If you define your screen fields (on the screen not in your data declarations) as CURR not DEC as mine were then you can put in a field as a reference.  I defined a new field (not a screen one) which held the currency for the screen.  If I define all my currency amount fields with 3 decimal places but refer them all to the currency field then they appear as 2 or 3 decimals places depending on the currency.
    Thanks for all your suggestions, they got me thinking on the right track.

  • Change screen field dynamically only for decimal places

    Hi,
    I have variable for which is declared to take upto 3 decimal places, my requirement is ...
    when this variable is getting populated for a particular screen i have to display decimal upto only 2 places, this data element is also used in other screens ao i cannot modify its domain directly...
    is there anyway i can do it dyanmically when values are getting populated on screen
    Regards,
    Prateek.

    Hi,
    If you want to use with WRITE statement:
    Effect of different DECIMALS specifications:
    DATA: X TYPE P DECIMALS 3 VALUE '1.267',
    Y TYPE F VALUE '125.456E2'.
    WRITE: /X DECIMALS 0, "output: 1
    /X DECIMALS 2, "output: 1.27
    /X DECIMALS 5, "output: 1.26700
    /Y DECIMALS 1, "output: 1.3E+04
    /Y DECIMALS 5, "output: 1.25456E+04
    /Y DECIMALS 20. "output: 1.25456000000000E+04
    If you want to use in ALV display - Fieldcatalog:
    *-Decimal places for Del Qty and Bag Wt
        IF p_fieldname = 'DELQTY' OR  p_fieldname = 'BAGWT'.
             ls_fieldcat-decimals    = '000002'.
        ENDIF.
      APPEND ls_fieldcat TO gt_fieldcat.
    Regards,
    ~Satya

  • Decimal Places is not showing in Qty field in COPA report

    Hi,
    I have made a COPA report using one form that I have made it through TC:KE34.
    I have used ABSMG for Sales qty in my report.
    What I am observing in report, the qty is  not showing the decimal places for exmaple 6.032 MT but it gets round over to 6 MT.
    I want the system should show the 3 decimal places for the Sales Qty.
    How to do resolve this.
    Regards
    Kami

    Hi Ajay,
    No this is somthing new you mentioned. I havent tried to change the number format after executing the report.
    Please let me know how to do that. I am using Object ALV to display the report and I am not getting any option in the menus to change the number format.
    Also I noticed one thing, In other output format like drill down report its coming correctly , only in Object ALV output format its showing the rounded values.
    Please let me know the path.
    Regards
    Kami

  • Download amount value without decimal place but element with decimal place

    Hi all,
    to display the amount without decimal places in classic report, i can use this way which is wa_wrshb NO-ZERO CURRENCY wa__waers.
    may i know,
    1) how to display amount in ALV where amount value (which using dmshb/wrshb) has no decimal place like JPY?
    2) what should i do if i want to download the amount value which field using dmshb or wrshb that the value has no decimal place like JPY?
    Thanks

    Hello,
    You can display the ALV output according to the decimal point in the currency.
    When creating the field catlog for the amount field add the currency parameter also.
      wa_fieldcat-fieldname     = <amount_field>.
      wa_fieldcat-tabname       = <output_table>.
      wa_fieldcat-seltext_l     = <column_heading>.
      wa_fieldcat-outputlen     = p_olen.
      wa_fieldcat-currency      = wa_waers.              " This will work same as CORRENCY wa_waers
    Regards
    DKS

  • Error while updating decimal places in general settings

    Hii All
             I have got an error while updating Decimal places in General Settings
    Cannot update while another user is connected to the company i have checked, there is no other user logged in, i could add other settings but the problem is only with Decimal Places
    Note : there are no postings yet, a fresh database for a new client
             what could be the possible reason
                                                                 thanks
                                                                         RIYAZ

    Hiii All
          As a forum rule, i have initially gone through with the existing threads and then i was force to post a thread,
              would be helpfull if there is any other way..
                                                Thanks
                                                         RIYAZ

Maybe you are looking for

  • Flash mp3 player HELP!!!

    i am tying to add a flash mp3 player to my blog posts to have samples of the scores on each page using this: http://creativetechs.com/tipsblog/embed-a-free-flash-mp3-player-on-your-blog/ the code i have is this: <object type="application/x-shockwave-

  • Workspace Error 404

    Hi to all gurus! Im two days without sleep trying to solve an issue with workspaceon production server. EPm 11.1.2. Planning-Wintel 64bits-MSQL Server. The oracle support do far is doing circles. we went live a month ago, and yesterday I rebooted the

  • Search across multiple folders in the Mail application...

    Is it possible to search across multiple folders using the Mail application in Windows 10?  I can't seem to find that option. Thanks in advance, M

  • Find out the Extractor names from the Table name

    Hello, I wanted to know given a name of the table in ecc, if there is any way to check which extractors have used this table. for example, I have a table name VBAP and I want to see the list of the extractors that are extracting data from this table.

  • IRig Macbook Air Problem

    I've just bought iRig and I can't get it work with my Macbook Air. It's working with iOs, but when I plug into my Macbook Air nothing it's happening. I went to System-Preferences -> Audio  and I can't see nothing signed as External Microphone. I read