cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Script Table Formatting Issue

Former Member
0 Kudos

I have a driver program which inputs the po number. Say that PO has 20 line items.

In the script i have to display these items in the form of a table i.e border round the data that i have printed.

______________________________________________________________

Ex: | ITEM MATERIAL Qty Price |

______________________________________________________________

_______________________________________________________________

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

Put these command in Text editor of a Page window in which you want to display table.

BOX WIDTH '16.5' CM HEIGHT '5' CM FRAME 10 TW INTENSITY 15

BOX XPOS '5.0' CM WIDTH 0 TW HEIGHT '5' CM FRAME 10 TW

BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '5' CM FRAME 10 TW

These three comands together creates a table with 2 vertical lines. Adjust the dimensions according to your requirement.

Dont forget to put ' /: ' in Tag cloumn ( in which you specify paragraph) . /: is used as SAPscript control command.

Answers (5)

Answers (5)

Former Member
0 Kudos

I came to know that Dyanmic Table formatting is not possible in SAP Script. So we can go for Smart Form. Anyway i have got many replies. Thanks to all of them.

Kindly let me know if i am not correct.

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi,

I did this thing recently ,,,,,,,,write this code in ur text element which is used to print heading

<B>,,TEST,,,,,,,,,,,,UOM,,,,,,,,,,Results</>

POSITION XORIGIN '-5.8'CM YORIGIN '+2' CM

BOX WIDTH '15' CM HEIGHT '8' MM FRAME 10 TW INTENSITY 15

BOX XPOS '5' CM WIDTH 1 TW HEIGHT '8' MM FRAME 15 TW

BOX XPOS '10' CM WIDTH 1 TW HEIGHT '8' MM FRAME 15 TW

And write this code in the text element which is used for printing data...

POSITION YORIGIN '+8' MM

BOX WIDTH '15' CM HEIGHT '8' MM FRAME 10 TW

BOX XPOS '5' CM WIDTH 1 TW HEIGHT '8' MM FRAME 15 TW

BOX XPOS '10' CM WIDTH 1 TW HEIGHT '8' MM FRAME 15 TW

hope this will help U...

With Warm regards...

Thank Q

Always learner

Former Member
0 Kudos

BOX Command

Syntax

/: BOX XPOS YPOS WIDTH HEIGHT FRAME INTENSITY

Effect: draws a box of the specified size at the specified position.

Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.

XPOS, YPOS

Upper left corner of the box, relative to the values of the POSITION command.

Default: Values specified in the POSITION command.

The following calculation is performed internally to determine the absolute output position of a box on the page:

X(abs) = XORIGIN + XPOS

Y(abs) = YORIGIN + YPOS

WIDTH

Width of the box. Default: WIDTH value of the SIZE command.

HEIGHT

Height of the box. Default: HEIGHT value of the SIZE command.

FRAME

Thickness of frame.

Default: 0 (no frame).

INTENSITY

Grayscale of box contents as %.

Default: 100 (full black)

Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.

Units of measurement: The following units of measurement may be used:

TW (twip)

PT (point)

IN (inch)

MM (millimeter)

CM (centimeter)

LN (line)

CH (character).

The following conversion factors apply:

1 TW = 1/20 PT

1 PT = 1/72 IN

1 IN = 2.54 CM

1 CM = 10 MM

1 CH = height of a character relative to the CPI specification in the form header

1 LN = height of a line relative to the LPI specification in the form header

/: BOX FRAME 10 TW

Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).

/: BOX INTENSITY 10

Fills the window background with shading having a gray scale of 10 %.

/: BOX HEIGHT 0 TW FRAME 10 TW

Draws a horizontal line across the complete top edge of the window.

/: BOX WIDTH 0 TW FRAME 10 TW

Draws a vertical line along the complete height of the left hand edge of the window.

/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15

/: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW

/: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW

/: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW

Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.

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:

Former Member
0 Kudos
Former Member
0 Kudos

Sorry formatting problem.

i need the vertical lines at the starting and ending of the horizantal lines.

Former Member
0 Kudos

Create Box.

Former Member
0 Kudos

I HAVE TRIED USING THAT OPTION.

Say i have 32 line items.

I have printed 30 items in the first page. For the 31st item second page will get triggered . Now in the second page also we will get the box for whole window. but i have only two items remaining. i want the line ended after the last item got printed.