Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Currency Field Reference on ABAP2XLSX


As I understand, any amount-like field can refer to a currency key field to make the format or amount appropriate according to the currency. This can apply in CDS View, Data Dictionary (Tables, Structure, etc), ALV Report, etc

For example in ALV such as this, the AMOUNT_ESTIMATE field refers to WAERS field for currency.

              lo_col ?= lo_cols->get_column( 'AMOUNT_ESTIMATE' ).
              lo_col->set_currency_column( 'WAERS' ).

Is there a way to apply this similar approach to fields that are going to be exported to Spreadsheet with ABAP2XLSX?

Thanks for the help.


Active Contributor

You mean that the currency amounts are handled a special way in ABAP, a number which you see in the debugger is displayed elsewhere differently based on the currency code (number of decimals in table TCURX-CURRDEC / Transaction OY04), for instance:

  1. Value "0.01" in the debugger with currency HUF is displayed "1" elsewhere, because HUF is defined with 0 decimals.
  2. Value "0.01" in the debugger with currency EUR is displayed "0.01" elsewhere, because EUR is defined with 2 decimals.

Active Contributor

This point is currently discussed here: Currency amount to external format using zcl_excel_worksheet->bind_table don't work for 1 HUF · Issu....

There's also a discussion in the point 4 here, concerning doing a fix in ZCL_EXCEL_CONVERTER* classes (for ALV).

You're welcome in participating.

0 Kudos

Yes, the issue would be similar to that. Thanks for the info, I'll look into that.