Application Development 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: 

Sapscript

Former Member
0 Kudos

In the Sapscript form, I am printing Material Code, Material Description, Purchase qty, Rate and amount.

The problem I am getting is that, based on the contents of the Material Description, the qty,rate and amount columns are getting shifted towards left side. (ie., if the content in the material description is less, then the qty,rate and amount columns are getting shifted).

Pls guide me how to correct this.

Thanks in advance.

Mark K

7 REPLIES 7

Former Member
0 Kudos

Hi mark,

1. For such requirements (column wise data)

its always better to use TAB concept in layout.

2. There we can fix

eg

2CM - 5 CM - 10 CM

Width/starting point of each column.

3. Then we have to just give data like this,

(USING TWO COMMAS AS TAB)

&field1&,,&field2&,,&field3&

regards,

amit m.

0 Kudos

create the tab and assign it very printing the field!!

Reward points if it helps

regards

Gunjan

Former Member
0 Kudos

1) Got to paragraph format> Tabs> define tabs for your paragraph format depends upon the position of each fields.

2) Go to SAP script--> Use this para format to print your line. For eg

IP   ,,&VBDPR-POSNR(CZ)&,,<B>&VBDPR-MATNR&</>,,&MAT_TEXT&

RGDS,

TM.

Former Member
0 Kudos

Hi,

U can define a new paragraph format with the individual tab position for each field.

and then simply assign this paragraph format in sapscript where u are displaying field contents.

for eg : &fld_1&,,&fld_2&,,&fld_3&

vinod_gunaware2
Active Contributor
0 Kudos

<b>Omitting the Leading Sign</b> Program symbols with numeric values can have a leading sign. This sign usually appears to the right of the numeric value, either as a space for positive numbers, or as a minus sign for negative numbers . You can use t he S option to ensure that the value is formatted without the sign .

Syntax

&symbol(S)&

The ITCDP-TDULPOS field contains the value -100.00. The ABAP Dictionary definition for this field includes a leading sign.

&ITCDP-TDULPOS& -> 100.00-

&ITCDP-TDULPOS(S)& -> 100.00

<b>Leading Sign to the Left</b> The leading sign is normally displayed to the right of a numeric value, except in the case of a floating point number. This option enables you to specify that the leading sign should be placed to the left of the number.

Syntax

&symbol(<)&

&ITCDP-TDULPOS& -> 100.00-

&ITCDP-TDULPOS(<)& -> -100.00

The SET SIGN LEFT control command specifies that all subsequent symbols with a numeric value should have a left-justified leading sign. If you use this control command, you must no longer repeat the < option for each individual symbol.

<b>Leading Sign to the Right</b> The default setting is to print the leading sign to the right of a numeric value. If you used the SET SIGN LEFT control command to specify that the leading sign should be printed in front of the value, you can override this specification for individual symbols. The symbols specified with the > option are then printed with the leading sign to the right.

Syntax:

&symbol(>)&

You can use the SET SIGN RIGHT control command to switch back to the default setting for the output of the leading sign.

<b>Omitting Leading Zeros</b> Certain symbol values are printed with leading zeros. If you want to suppress these, use the Z option.

Syntax

&symbol(Z)&

Assuming the current date is 1.1.1994,

&DAY& -> 01

&DAY(Z)& -> 1

7.6.7 Space Compression

The symbol value is viewed as a sequence of ‘words’, each separated from the next by either one or a string of space characters. The C option has the effect of replacing each string of space characters with a single space and shifting the ‘words’ to the left as necessary to close up the gaps. Leading spaces are completely removed. The results are the same as those of the ABAP command CONDENSE.

Syntax:

&symbol(C)&

Assuming ' Albert Einstein ' is the symbol value,

&symbol& -> Albert Einstein

&symbol(C)& -> Albert Einstein

<b>Number of Decimal Places</b> A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.

Syntax

&symbol(.N)&

The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.

&EKPO-MENGE& -> 1,234.560

&EKPO-MENGE(.1) -> 1,234.6

&EKPO-MENGE&(.4) -> 1,234.5600

&EKPO-MENGE&(.0) -> 1,235

<b>Omitting the Separator for ‘Thousands’</b> Symbols of the DEC, CURR, INT, and QUAN data types are normally formatted with the a ‘thousands’ separator character. The T option allows you to omit this separator character.

Syntax:

&symbol(T)&

The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.

&EKPO-MENGE& -> 1,234.560

&EKPO-MENGE(T)& -> 1234.560

<b>Specifying an Exponent for Floating Point Numbers</b> The way a floating point number is formatted depends on whether an exponent is specified. The mantissa is adjusted by shifting the decimal point and, if necessary, introducing leading zeros, according to the exponent chosen. Using an exponent value of 0 means that the exponent representation will not be used for displaying the symbol.

Syntax

&symbol(EN)&

If you specify an exponent of 0, then the number is displayed without using the exponent representation. This has the same effect as completely omitting the specification of an exponent: &symbol(E0)& has the same effect as &symbol(E)&

In this example, the PLMK-SOLLWERT field is assumed to have the value 123456.78 and to be of data type FLTP.

&PLMK-SOLLWERT& -> 1.23456780000000E05

&PLMK-SOLLWERT(E3)& -> 123.456780000000E03

&PLMK-SOLLWERT(E6)& -> 0.12345678000000E06

&PLMK-SOLLWERT(E0)& -> +123456.780000000

&PLMK-SOLLWERT(E)& -> +123456.780000000

<b>Right-Justified Output</b> Symbol values other than numeric values are normally formatted left-justified. To specify right-justified formatting, use the R option. You must use this option in conjunction with an output length specification.

Syntax

&symbol(R)&

If symbol has the value 1234.

&symbol& -> 1234

&symbol(8R) -> 1234

For program symbols, the length specification contained in the Dictionary definition may be used instead of an explicit length.

<b>Fill Characters</b> You can replace leading spaces in a value with a fill character. Use the F option with the character immediately following the F in the specification as the fill character.

Syntax

&symbol(F f )&

f = fill character

The figure for customer sales in the KNA1-UMSAT field is $700. The Dictionary description of the field specifies an output length 8.

&KNA1-UMSAT& -> 700.00

&KNA1-UMSAT(F*)& -> **700.00

&KNA1-UMSAT(F0)& -> 00700.00

7.6.13 Suppressing Output of Initial Values

Use the I option to suppress the output of symbols that still contain their initial values.

Syntax

&symbol(I)&

Assuming KNA1-UMSAT contains the value 0 and the currency is DEM.

&KNA1-UMSAT& -> 0,00

&KNA1-UMSAT(I)& ->

If the field contains an amount other than 0, this value is printed in the normal way.

&KNA1-UMSAT& -> 700,00

&KNA1-UMSAT(I)& -> 700,00

regards

vinod

0 Kudos

Thank you Vinod!

Since this thread was not my question, I'm not sure if I can offer you reward points, but I would if I could. This explanation of numeric display operations in SAPScript is exactly what I have been looking for. It is very useful!

Former Member
0 Kudos

Thank you Dhananjay and Vinod.

You both have have mentioned good points and my many queries are solved.

Thank you once again.