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

String templates alpha conversion problem

former_member210008
Active Participant
0 Likes
3,634

Hi all!

I'm trying to show a message like this


DATA: menge type menge_d,

meins type meins.

menge = 555.

meins = 'ST'.

MESSAGE |Amount available { menge } { meins alpha = out } | TYPE 'S'.

But I got ST not converted in my native language ( sy-langu ). I can use FM CONVERSION_EXIT_CUNIT_OUTPUT, but I want to do it with string templates.

Here is another example:


report zzz.

START-OF-SELECTION.

   SELECT SINGLE *
     INTO @DATA(ls)
     FROM mara
     WHERE meins <> @space.

   WRITE:/ ls-meins.
   WRITE:/ | { ls-meins } { ls-meins ALPHA = in } { ls-meins ALPHA = out } { ls-meins ALPHA = raw }|.
   DATA output TYPE string.
   CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
     EXPORTING
       INPUT                = ls-meins
    IMPORTING
      OUTPUT               = OUTPUT
             .
   WRITE:/ output.

Output


ШТ

ST ST  ST  ST

ШТ

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,263

I don't think there's an equivalence of WRITE USING NO EDIT MASK (to not execute the conversion routine). You may create a functional method which executes the WRITE, and execute it from within the string template.

Message was edited by: Sandra Rossi : my answer is out of context, sorry

Read only

Former Member
0 Likes
2,263

As far as I know the String-Template currently does not support CUNIT conversion. Your used ALPHA conversion adds or removes only leading zeros to or from a string containing a number.

Read only

0 Likes
2,263

Any links that confirm it? (only leading zeroes). Or you meant note from abap help http://help.sap.com/abapdocu_740/en/abapcompute_string_format_options.htm#!ABAP_ADDITION_13@13@ ?


  • The formatting option ALPHA has the same function as the conversion routineCONVERSION_EXIT_ALPHA_INPUT or CONVERSION_EXIT_ALPHA_OUTPUT.

  • The parameter IN can be used to transform numeric sequences without leading zeroes to the format of numeric text with leading zeroes. The parameter OUT can be used to convert numeric text with leading zeroes to numeric sequences without leading zeroes.
Read only

0 Likes
2,263

Yes, I refer to the ABAP language help.