How to Get Invoice Currency Text in SAP Smartforms Documents
If you are an ABAP developer creating SAP documents for your business flow using SAP Smartforms, possibly you deal with currency.
Currency values requires to display the currency name on the SAP Smartforms document also.
Of course each currency has different translation text for different languages.
So as a developer you should also take the document language into account for the invoice currency text for example on SAP Smartform document.
Here is a sample ABAP code, I used to display the currency text of an invoice in Italian.
The currency text of the SAP invoice document is kept at is_bil_invoice-hd_gen-bil_waerk
Searching within the ABAP table TCURT enables ABAP users to get the text translation of the cuurency for different languages.
So when we add an additional filter for the SPRAS or the document language, we can easily find the currency text translation for specific language.
BEGIN OF lty_ktext,
ktext TYPE ktext,
END OF lty_ktext.
lt_ktext TYPE TABLE OF lty_ktext,
ls_ktext TYPE lty_ktext.
INTO TABLE lt_ktext
spras = 'IT' AND
waers = is_bil_invoice-hd_gen-bil_waerk.
" Invoice Currency Text
IF lt_ktext IS NOT INITIAL.
LOOP AT lt_ktext INTO ls_ktext.
gv_ktext = ls_ktext-ktext.
TRANSLATE gv_ktext TO UPPER CASE.