Skip to Content
avatar image
Former Member

ALV OUTPUT Display issue

Hello All,

ALV Output Display Issue..

I have an internal table, where the values are correctly populated as below,

in field catalog table also the values are same as displayed above.

But in ALV display,

For the Currency 'KRW' the NETPR value displayed is different.

I.e. in table = 1200.00

     in ALV  =  120,000.

is it due to the difference in data type of NETPR..in table it is p(6) dec(2), whereas in fieldcat table it is c(30).

Please help me out.

alv_prob1.png (38.6 kB)
alv_prob.png (96.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    Jan 06, 2015 at 02:13 PM

    hi Giri,

    This is clearly due to number of decimal in a particular currency, KRW in this scenario.

    KRW(Korean Won) do not have any decimal point and hence have 1 as a minimum unit.

    SAP, when storing data in Database or internal tables, uses same field for all currencies and hence stores 120000 KRW as 1200.00 and 1200.00 EUR as 1200.00

    That is why, when displaying amount on screen, corresponding Currency field is important.

    In this scenario, as rightly mentioned in another response, you can use SAP Std FM CURRENCY_AMOUNT_SAP_TO_DISPLAY to convert it to correct format.

    You can check that this FM converts 1200.00 EUR to 1200.00 EUR, but 1200.00 KRW to 1200000 as explained above.

    Hope this helps.

    Warm Regards,

    Shyam Agrawal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 04:11 PM

    Hello Giri,

    Seems  something is messed up while building the Final table which is displaying as output.

    This is not issue of Data Type because rest of below fields in the output are coming correct only the value of the Currency Key - KRW.

    Also while looking closely to above 2 screens, data which is coming to the output of Currency Key - KEW is all INCORRECT.

    I would suggest you to please check the final table(output) during debugging, which data is coming for above currency key.

    Thanks

    Romit Raina

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 06:37 AM

    Hi Giri,

    Convert currency format using.

    FM CURRENCY_AMOUNT_SAP_TO_DISPLAY


    Thanks and Regards,

    Anil

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 06, 2015 at 07:56 AM

    First read some documentation as ALV Grid Control  -> The Field Catalog , Generating the Field Catalog, Fields of the Field Catalog, Value Display with Currency/Quantity Unit.

    Then check your final table definition (and how values are passed) did you use CURR types or DEC types, did you give reference to a currency code (CUKY) column in the first case, execute also The Consistency Check.

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 03:52 PM

    hi giri,

    try with fcat-DECIMALS_OUT = '2'.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 08:33 PM

    Hi,

    While building the fieldcat, have you put ref table and field? In that case, it is the same as the type of the field on the internal table declaration?

    Regards

    Ernesto

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 06, 2015 at 01:12 AM

    Hi,

    please check fieldcatalog setting

    IF fieldname = 'CMPRE'.          "Amount Field    fieldcatalog-cfieldname = 'WAERK'.   "Reference Currency code    fieldcatalog-ctabname  = 'IT_TABNAME'.

    ENDIF.

    Regards,

    Jimmy

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 06, 2015 at 07:28 AM

    Hi Giri

    This is a matter of how the currencies are defined in the system as to how many decimals should be displayed.  As reference check table TCURX for exception currencies which should show NOT 2 decimal places.  For your field catalog create a dictionary object and on your amount field link it to a currency and you will not have to worry about display as SAP will handle it.

    regards

    Prince Isaac

    Add comment
    10|10000 characters needed characters exceeded