SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

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.

TYPES :
  BEGIN OF lty_ktext,
    ktext TYPE ktext,
  END OF lty_ktext.

DATA :
  lt_ktext TYPE TABLE OF lty_ktext,
  ls_ktext TYPE lty_ktext.

SELECT ktext
  INTO TABLE lt_ktext
  FROM TCURT
  WHERE
    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.
  ENDLOOP.
ENDIF.
Code


SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.