Convert Sales Unit into Text using Function Module in Target Language
ABAP developers use CONVERSION_EXIT_CUNIT_OUTPUT function module to convert units of measurement into text definitions in target language. For example, use ABAP function module CONVERSION_EXIT_CUNIT_OUTPUT in a SAP Smart Form output code to convert sales unit into translated text definitions.
For example, in this ABAP tutorial you will see how you can get the definition text of ST unit in English as "piece(s)" which is "adet" in Turkish.
As seen in below screenshots, I call function module CONVERSION_EXIT_CUNIT_OUTPUT using SAP transaction code SE37 and execute with required parameters unit and language to get the translation description of the unit in target language.
ABAP developers can change the SE37 function module parameter "Language" with other language abbreviations like TR for Turkish, UK for Ukranian or DE for German, etc to get the translated short and long text of the input measurement unit. In this example ST for unit or piece. You can play with the measurement unit parameter to get translations of descriptions of provided units.
In below ABAP codes, I'll be returning the sales unit text of an item on a sales invoice using the ABAP function module CONVERSION_EXIT_CUNIT_OUTPUT.
Since I used this ABAP code block in an output of a billing document, I got the sales unit abbreviation from IT_GEN component of the IS_BIL_INVOICE import parameter.
ABAP function module CONVERSION_EXIT_CUNIT_OUTPUT returns the unit text, explicitly the long text description of the sales unit in gv_unittext import parameter. SAP Smartform developers can easily display this value on a Text object.