Programming

Counter in SAPscript

In SAPscript, sysem has symbol SAPSCRIPT-COUNTER_x (x=0...9) for apply in your program. You can increase or decrease by 1 by option (+) or (-).

Syntax


&SAPSCRIPT-COUNTER_x(+)& Increase by 1
&SAPSCRIPT-COUNTER_x(-)& Decrease by 1

Example

&SAPSCRIPT-COUNTER_1&     =      1
&SAPSCRIPT-COUNTER_1(+)& = 2
&SAPSCRIPT-COUNTER_1(-)& = 1

Formatting Options in SAPscript: Suppress Output of Initial Value

In SAPscript, you can apply this option when you want to suppress the output when the symbol contian the initial value.

Syntax


&VAR(I)&

Example

&VAR&        =       0.00              "&VAR& is CURR
&VAR(I)& =

Formatting Options in SAPscript: Replace Leading Spaces by Character

In SAPscript, if you want to replace leading space by a fill character, you can apply this option.

Syntax


&VAR(Ff)&

Example

&VAR&        =       500.00
&VAR(F*)& = **500.00

Formatting Options in SAPscript: Right-Justified Output

In SAPscript, when you want to define the numeric value to right-justified, you can apply this option.

Syntax


&VAR(R)&

Example

&VAR&        =     1111
&VAR(R)& = 1111

Formatting Options in SAPscript: Exponent for Floating Numbers

In SAPscript, if you don"t want to specify format an exponent for DATA TYPE FLTP, you can apply this option.

Syntax


&VAR(En)&

Example

&VAR&        =     +1.23456780000000E+06
&VAR(E2)& = +12345.6780000000E+02
&VAR(E7)& = +0.123456780000000E+07
&VAR(E)& = +1234567.80000000