Skip to Content
avatar image
Former Member

Output a number raised to a power as a string in SAPScript i.e. 10³

Hello,

when entering or printing material sales texts, we need to be able to enter mathematical expressions such as 10 to the power of minus 4 (10-4) or 10 to the power of 5 (105).

Any suggestions? Basically we can only enter n² or n³, because we can use our keyboard for this.

Defining a character format in SE71/SE72 may be an option, but I wouldn't know which font to use. It would have to align with the character properties entered by keyboard.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 14, 2016 at 12:33 AM

    You could try to use character format with superscript font attribute. I'm not quite sure, but I think you should be able to omit font in format definition (it's possible in Smartstyle character format).

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      thanks for your answer. I have tried this, but the superscript text is positioned a half of a line above the original text and not in the same relation as when entered with the keyboard (10²).

      Also this positioning doesn't look good compared to the positioning of the other lines of text.

      There must be a way to enter the Unicode key of the needed combination i.e. 10 to the power of minus 3.

      Any further ideas?

      I truly appreciate your help.

      Amber

  • Jan 02, 2017 at 09:26 PM

    You just can insert the unicode-key aswell. Mhh... it's been a while, but I think you just have to add aglobal variable and assign the correct hexcode of the unicode character to the symbol.

    I'm off this week, so I cannot provide you an example, but this works for sure.

    ~Florian


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 03, 2017 at 06:20 AM

    1.open se71 and then smartform name.

    2.Go to Character Formats and Edit->create Element

    3.In standard Attributes you will options like Superscript/Subscript.

    4.Save the character format and use it in your script.

    note:the same can be achieved using Smartstyles for smartform.

    Add comment
    10|10000 characters needed characters exceeded