Application Development and Automation 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: 
Read only

Hello need vertical lines in the script

Former Member
0 Likes
1,233

Dear ABAP GURUS,

I need to draw verticle lines in the script as a tabel, i have drawn the horizontal lines. I heard that there is the the function module to draw the verticle lines but how is that possible to use in the script. Plwase help me out in drawing the vericle lines, i Have tried using the vline but no use.

Dear ABAP GURUS,

I need to draw verticle lines in the script as a tabel, i have drawn the horizontal lines. I heard that there is the the function module to draw the verticle lines but how is that possible to use in the script. Plwase help me out in drawing the vericle lines, i Have tried using the vline but no use.

5 REPLIES 5
Read only

Former Member
0 Likes
992

Hi,

Just use BOX command with WIDTH '0'.

I hope this helps.

Regards

Raju Chitale

Edited by: Raju Chitale on Apr 21, 2008 7:49 AM

Read only

Former Member
0 Likes
992

Hi Soni,

Its very easy to draw the vertical lines in a script. Use BOX statement to draw the same. Check out the syntax for BOX statement. Give the 'Y' coordinate only and do not mention 'X' coordinate. So that the box will appear as a vertical line. Check it.

Boxes, Lines, Shading: BOX, POSITION, SIZE

The BOX, POSITION and SIZE commands for drawing boxes, lines and shadowing can be used for specifying that within a layout set particular windows or passages of text within a window are to be output in a frame or with shadowing.

The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when outputting. Line printers and page-oriented printers not supported in the standard ignore these commands. The resulting printer output may be viewed in the SAPscript print previewer.

Syntax:

1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]

2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]

3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]

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 both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.

1. 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

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

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

4. FRAME: Thickness of frame.

Default: 0 (no frame).

5. INTENSITY: Grayscale of box contents as % .

Default: 100 (full black)

Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used 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 layout set header

• 1 LN = height of a line relative to the LPI specification in the layout set 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 shadowing 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 which 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.

1. XORIGIN, YORIGIN: Origin of the coordinate system.

2. WINDOW: Sets the values for the left and upper edges to be the same of those of the current window (default setting).

3. PAGE: Sets the values for the left and upper edges to be the same of 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.

SIZE Command

Syntax

/: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]

Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started the SIZE value is set to the same values as the window itself (default setting).

Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.

1. WIDTH, HEIGHT: Dimensions of the rectangle or line.

2. WINDOW: Sets the values for the width and height to the values of the current window (default setting).

3. PAGE: Sets the values for the width and height to the values of the current output page.

/: SIZE WINDOW

Sets WIDTH and HEIGHT to the current window dimensions.

/: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM

Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.

/: POSITION WINDOW

/: POSITION XORIGIN -20 TW YORIGIN -20 TW

/: SIZE WIDTH +40 TW HEIGHT +40 TW

/: BOX FRAME 10 TW

A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.

Thanks & regards

Kishore Kumar Maram

Read only

Former Member
0 Likes
992

hi soni,

Below code will help you to draw vertical lines in Scripts.

but we r not drawing vertical lines..

we r drawing Boxes

for that you have to *declare a variable window , Size same as variable window.

then draw box size of the main window...

-


I have given the code for variable window..its size is same of main window..

IF &NEXTPAGE&  NE  0                                            
  BOX WIDTH '18.5' CM HEIGHT '1.1' CM  FRAME 10 TW  INTENSITY 15  
   Sno,, Carrier ID       Connection ID,,      CityFrom,,         
              CityTo                                              
                               Flight Date                        
  BOX WIDTH '18.5' CM HEIGHT '18' CM FRAME 10 TW                  
  BOX XPOS '1.3' CM WIDTH 0 TW HEIGHT '18' CM FRAME 10 TW         
  BOX XPOS '5' CM WIDTH 0 TW HEIGHT '18' CM FRAME 10 TW           
  BOX XPOS '9.7' CM WIDTH 0 TW HEIGHT '18' CM FRAME 10 TW         
  BOX XPOS '14' CM WIDTH 0 TW HEIGHT '18' CM FRAME 10 TW          
  ENDIF

The above code will work well...if dont undrstand it...reply ..

it will help you..to draw a table..

reward if helpful..

Regards ,

Brijesh..

Read only

Former Member
0 Likes
992

Hi,

BOXES and LINES

To use boxes in the form or to create a table in the form we use BOX statement. a table can be constructed by using a combination of BOXes.

/:BOX XPOS val unit YPOS val unit WIDTH val HEIGHT val INTENSITY val FRAME val unit .

The Unit used in the sapscript cane be:

TW twip

MM milimeter

CM centimeter

LN line

CH character

IN inch

PT point

The parameters like WIDTH , XPOS etc should be followed by a proper unit.

The INTENSITY is in the percentage of the grey scale.

The FRAME parameter is the thickness of the frame the default value is 0.

e.g.

/:BOX XPOS '5' CM YPOS '2' CM WIDTH '14' CM HEIGHT '20' CM FRAME 20 TW INTENSITY 10.

e.g.

/:BOX INTENSITY 10

will fill the current window background with a shading of grey scale 10%..

To draw a horizontal line we set the HEIGHT parameter to the value of 0.

e.g.

/:BOX XPOS '5' CM HEIGHT 0 TW FRAME 10 TW.

This will draw a horizontal line across the top edge of the window.

To draw a horizontal line we should set the value of WIDTH parameter to 0.

e.g.

/:BOX XPOS '5' CM YPOS WIDTH '0' TW FRAME 10 TW.

This will draw a vertical line across the complete height of the left edge of the current window.

POSITION and SIZE

We can use POSITION and SIZE to set default position and size of the window and also for relative positioning. With POSITION we can use the paramters XORIGIN , YORIGIN ,WINDOW. With SIZE we can use WIDTH and HEIGHT and WINDOW and PAGE.

e.g.

/:POSITION XORIGIN '5' CM YORIGIN '5'CM

/:SIZE HEIGHT '5' CM WIDTH '14' CM

/:BOX FRAME 10 TW INTENSITY 10

POSITION WINDOW

We can use POSITION WINDOW to set the position relative to current window i.e to the left,top of the current window ,then we can use POSITION with XORIGIN and YORIGIN to specify the current position relative to the start of the window, we can use '+' and '-' with the values.

e.g.

/:POSITION WINDOW

/:POSITION XORIGIN '5' CM YORIGIN '5' CM

In the above example the position now becomes 5 CM left from the origin of the window and 5 CM from the top of the window.

WINDOW sets the value of the WIDTH and HEIGHT to current window and

PAGE sets the value of the WIDTH and HEIGHT to current page.

e.g.

/:SIZE WINDOW

e.g.

/:SIZE PAGE.

please reward points if helpful.

Read only

Former Member
0 Likes
992

Hi,

Think you can use the BOX command for this.

POSITION WINDOW

specify the POSITION XORIGIN and YORIGIN and also the SIZE WIDTH and HEIGHT

BOX FRAME 5 TW

BOX HEIGHT '0.8' CM INTENSITY 20

BOX HEIGHT '0.8' CM FRAME 10 TW

BOX YPOS '+0.6' CM HEIGHT '0.46' CM FRAME 10 TW

Rwd if helpful.

Thanks.