Skip to Content
0

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

Dec 13, 2016 at 04:10 PM

90

avatar image
Former Member

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.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Jānis B Dec 14, 2016 at 12:33 AM
0

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).

Show 1 Share
10 |10000 characters needed characters left 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

0
Florian Henninger
Jan 02, 2017 at 09:26 PM
0

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


Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 03, 2017 at 06:20 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded