cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Script Positions Command

Former Member
0 Kudos

I have to draw 2 Boxes in a window,

i have drawn with with the following command,

/: BOX XPOS 1 CM YPOS 0 CM WIDTH 5 CM HEIGHT 5 CM FRAME 1 TW

/: BOX XPOS 7 CM YPOS 0 CM WIDTH 5 CM HEIGHT 5 CM FRAME 1 TW

Now the requirement is like this,

The Values are seperate by tab(Double comma ,,)

Box over text over,

At run time the value of plant description is changing......

We can fix the value as well like &WERKS(4)& &WERKS-DESCRIPTION(20)&

Now the question is, in the second box text, which is Plant(2nd box plant) and its text, I want to start from tht position(like position is 35) only not matter the length of plant description variese between 1 to 20, like i want to give

&WERKS-DESCRIPTION& not &WERKS-DESCRIPTION(20)&

Source Destination

-


-


Plant: 1000 Plant1

Plant: 4000 plant2

Storage Loc: 0200 Storage Loc1

Storage Loc: 2100 Storage Loc2

Address: Name1 Name2

Address: Name1 Name2

Street

Street

| city, Postal COde | | city, Postal COde |

-


-


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

POSITION Command

Syntax

/: POSITION XORIGIN YORIGIN WINDOW PAGE

Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).

Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.

XORIGIN, YORIGIN

Origin of the coordinate system.

WINDOW

Sets the values for the left and upper edges to match those of the current window (default setting).

PAGE

Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).

/: POSITION WINDOW

Sets the origin for the coordinate system to the upper left corner of the window.

/: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'

Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.

/: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM

Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.

Pre-Setting BOX Position Arguments

You can use the POSITION and SIZE commands to preset some arguments in the BOX command. POSITION presets the start point (upper left corner) of a box or line. SIZE specifies the width and height of a box.

You can use POSITION and SIZE to preset arguments, but you can also set the start point and size arguments of a box or line directly in the BOX command.

By default, if no positioning is specified, the upper left corner of a box or halftone or the top of a line is aligned with current SAPscript window. That is, the upper left corner of the box, halftone, or line starts at the upper left corner of the current window in the active form. By default, the height and width of a box are set to the height and width of the current window.

Use POSITION and SIZE to preset the arguments in a BOX command in the following situations:

The BOX command exceeds the 132-character (1 line in SAPscript) length limitation if you specify all arguments directly in the command. You may exceed this length limit if, for example, you use symbols in a command.

By pre-setting arguments with POSITION and SIZE, you can work around the limitation on the length of a command. You do not need to specify the preset arguments in the BOX command.

You want to use the enhanced capabilities of POSITION for adjusting the starting point of a box or line.

With BOX, you can specify an offset for the starting point only as a whole number (non-negative integer). This command would print a box starting 1 CM to the right and 1 CM down from the left upper corner of a window:

/: BOX XPOS '1' CM YPOS '1' CM

With POSITION; you can adjust the position of a line or box relative to a window much more precisely. In the POSITION command, you can specify positive and negative offsets and use non-integer numbers.

Example: The commands shown below position a box slightly to the left and slightly above a window. This leaves a margin between the edge of the box and the text in the window.

/: POSITION XORIGIN '-.2' CM YORIGIN '-.2' CM

/: SIZE WIDTH '.2' CM HEIGHT '.2' CM

/: BOX FRAME 10 TW

(Note that the box must be enlarged to accommodate the shift. If it is not enlarged, then it will not cover all of the window.)

You can also use POSITION to set the starting point to the upper left corner of the active page format. Example: POSITION PAGE moves the starting point from the active window to the active page format.

You want to use the relative sizing capabilities of SIZE to adjust the size of a box, line, or halftone.

With BOX, you can make only absolute size specifications. BOX HEIGHT, for example, overrides the default height setting to the height of the current window.

With SIZE, you can adjust the size of a box or a line with respect to its previously-set dimensions. The following commands would, for example, draw a frame 1 CM in from the margins of the paper:

/: POSITION PAGE

/: POSITION XORIGIN 1 CM YORIGIN 1 CM

/: SIZE PAGE

/: SIZE HEIGHT '-2' CM WIDTH '-2' CM

former_member196280
Active Contributor
0 Kudos

It is little tought to handle your scenario in SAPscript, but this can be easily done in case of smartform.

Try it like this, it my work out or it may be helpful for you, create another window similar to main window dimension and place it over main window and do all you drawing in that window.

Rgds,

SaiRam