cancel
Showing results for 
Search instead for 
Did you mean: 

Variable print adjustments

Former Member
0 Kudos

Hi pros,

a simple question, but i do not find the answer fast.

I have a number and want it to be printed as a natural value ( no decimals ).

I thought i could do it like this in SAPScript: &number(I)&.

This didn't work out.

Where do i find the formatting commands for SAPScript?

Thanx in Advance

Jan

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi, thanks 4 your incredible fast answer.

I guess i got the problem: (.0) would only work for numbers.

Maybe although containing this variable is a char...

This also seems realistic, since i can cut off the lenth (e.g. (5) will cut it to five letters)...

best regards /J

Former Member
0 Kudos

The thing is:

it doesn't work in debug mode:

MENG_NET_SUM(.0) shows 142.881

and not in print-out:

&MSEG_NET_SUM(.0)& results in 142.881...

Why is this? MAybe a language problem?

Thx Jan

Sandra_Rossi
Active Contributor
0 Kudos

maybe it means 142 thousands and 881 (decimal point for US format)

Make sure what is the value of the variable before printing

Former Member
0 Kudos

Thanks for your answer!

I've been trying to use this formatting, but it doesn't round the numbers.

Does this not work in debugger? Can i only see the formatted results in the print-out?

My best wishes

Jan

Sandra_Rossi
Active Contributor
0 Kudos

You'll be able to see the result in the sapscript debugger (step by step), but I don't really see the advantage here compared to the print preview.

&NUMERIC(.0)& works well

Make sure the variable is numeric

Sandra_Rossi
Active Contributor
0 Kudos

[sap library - sapscript - formatting options|http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/803411454211d189710000e8322d00/frameset.htm]

Number of Decimal Places &symbol(.N)&