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: 

Printing a Table in the Form

Former Member
0 Kudos

Hi Experts..

I would like to print the box below like this in a Form..

Plz any one can help me clearly with coding.

____________________________________________________

Service

Person

Rate

Amount

|----


7.6cm

1.4cm

-1.7cm-

-- 2.3 cm -

___________________________________________________

Headings height -- 0.5 cm

Body of table height -- 9 cm

I am Trying to print with ‘WRITE_FORM’ WITH Element

But it is taking too much space & it is not printing all the fields in the same line & not printing the box.

Even I want to print the boxes exactly like above in form layout.. plz send me the code ASAP

Thanks & Regards

Rajendra

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

Use the 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 parameter (XPOS, YPOS, WIDTH, HEIGHT and FRAME), both a measurement and a unit of measure must be specified. The INTENSITY parameter should be entered 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: Decimal numbers must be specified as literal values (like ABAP/4 numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.

this is a very time consuming task. well, hope this will help you

/E HEADING

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

/: BOX XPOS '1.5' CM YPOS 0 CM WIDTH 4 CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS '5.5' CM YPOS 0 CM WIDTH '3.5' CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS 9 CM YPOS 0 CM WIDTH '2.5' CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS '11.5' CM YPOS 0 CM WIDTH '3.5' CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS 15 CM YPOS 0 CM WIDTH '1.5' CM HEIGHT 10 CM FRAME 10 TW

/E

DETAILS

  • &IT_FINAL-WERKS&,,&IT_FINAL-NAME1&,,&IT_FINAL-PSTAT&,, &IT_FINAL-PRCTR&

= ,,&IT_FINAL-MINLS&,,&IT_FINAL-MAXLS&

Regards,

Richa

7 REPLIES 7

Former Member
0 Kudos

hi create a <b>paragraph format</b> & give <b>tabs</b> as per ur req spacing between field

then try to print the data using that paragraph format

Former Member
0 Kudos

The box is like this..

______________________________________

Service

Person

Rate

Amount


7.6cm

1.4cm

-1.7cm-

-- 2.3 cm -

__________

_________

______ _

__________

0 Kudos

Hi Rajendra,

You can fix the tab positions as like this

first: 7.6cm

second 9.0cm

third 10.7cm

fourth 13.0cm

Regarding the boxes,code like this:

BOX WIDTH 14 CM HEIGHT 10 CM FRAME 5 TW INTENSITY 1 "outline box

BOX XPOS '7.6' CM YPOS 0 CM WIDTH 0 CM HEIGHT 5 CM FRAME 5 TW INTENSITY 1 " First vertical line

BOX XPOS 9 CM YPOS 0 CM WIDTH 0 CM HEIGHT 5 CM FRAME 5 TW INTENSITY 1 "second vertical line

BOX XPOS '10.7' CM YPOS 0 CM WIDTH 0 CM HEIGHT 5 CM FRAME 5 TW INTENSITY 1 "third vertical line

BOX XPOS 0 CM YPOS 2 CM WIDTH 15 CM HEIGHT 0 CM FRAME 5 TW INTENSITY 1 first horizontal line

I think this will create a complete box.

You can loop the table and draw the remaining horizontal lines to create a table.

Regards,

SP.

Former Member
0 Kudos

hi

Use the 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 parameter (XPOS, YPOS, WIDTH, HEIGHT and FRAME), both a measurement and a unit of measure must be specified. The INTENSITY parameter should be entered as a percentage between 0 and 100.

•&#61472;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: Decimal numbers must be specified as literal values (like ABAP/4 numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.

this is a very time consuming task. well, hope this will help you

/E HEADING

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

/: BOX XPOS '1.5' CM YPOS 0 CM WIDTH 4 CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS '5.5' CM YPOS 0 CM WIDTH '3.5' CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS 9 CM YPOS 0 CM WIDTH '2.5' CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS '11.5' CM YPOS 0 CM WIDTH '3.5' CM HEIGHT 10 CM FRAME 10 TW

/: BOX XPOS 15 CM YPOS 0 CM WIDTH '1.5' CM HEIGHT 10 CM FRAME 10 TW

/E

DETAILS

  • &IT_FINAL-WERKS&,,&IT_FINAL-NAME1&,,&IT_FINAL-PSTAT&,, &IT_FINAL-PRCTR&

= ,,&IT_FINAL-MINLS&,,&IT_FINAL-MAXLS&

Regards,

Richa

former_member480923
Active Contributor
0 Kudos

Hi

THIS WILL BE SOME TIDIOUS JOB

Please use the BOX command in Script for each of the levels i.e. 1 box for the header and 1 box each for the inner data levels ... after you have completed the formating portion i think the data display will have no problem

Hope this helps

Anirban

Former Member
0 Kudos

Hi

You can use the Tables option in the smartforms to achieve this. You can find the "details" button clicking which will take you to table properties. here you can define the size as per your requirement. Then using the table header, body and footer you can display the data as preferred.

Cheers

Kathir

Former Member
0 Kudos

Hi Rajendra,

Just create a another window (lets say BWIND) with same size of MAIN WINDOW and keept it behind MAIN WINDOW.

Now, Draw the lines in the BWIND using following code.

Dont create a text element for this window. Just write the code in the BWIND. You dont need to call this window using WRITE_FORM.

/: BOX HEIGHT '1.7' LN INTENSITY 10

/*

/* The top line

/: POSITION PAGE

/: POSITION XORIGIN '2.0' CH YORIGIN '26.20' LN

/: SIZE WIDTH '75.2' CH HEIGHT '0' LN

/: BOX FRAME 10 TW

/*

/* The bottom line

/: POSITION PAGE

/: POSITION XORIGIN '2.0' CH YORIGIN '61.8' LN

/: SIZE WIDTH '75.2' CH HEIGHT '0' LN

/: BOX FRAME 10 TW

/*

/: POSITION PAGE

/: POSITION XORIGIN '2.0' CH YORIGIN '26.20' LN

/: SIZE WIDTH '0' CH HEIGHT '35.5' LN

/: BOX FRAME 10 TW

/*

/: POSITION PAGE

/: POSITION XORIGIN '77.20' CH YORIGIN '26.20' LN

/: SIZE WIDTH '0' CH HEIGHT '35.5' LN

/: BOX FRAME 10 TW

Now, create text elemetns in the MAIN WINDOW to print your Header and Line Items.

You can use TAB positions in the paragraph format to print data exactly on a particular position.

regards,

ram