Ask the Expert

Printing multiple line items in a box for a purchase order

I am working on a SAPscript (copied from medruck form). I have to print line items of a purchase order in boxes. Now my problem is I have written the following code, which is in main window, and text-element is under loop of ekpo table. The boxes are printing only once - this is not working for multiple line items.

ITEM_LINE_3F_PRICE(Text element)
BOX XPOS '0.0' CM YPOS '1.0' CM WIDTH '1.5' CM HEIGHT 2 CM FRAME 10 TW
BOX XPOS '1.5' CM YPOS '1.0' CM WIDTH '2.5' CM HEIGHT 1 CM FRAME 10 TW
BOX XPOS '4.0' CM YPOS '1.0' CM WIDTH '3.0' CM HEIGHT 1 CM FRAME 10 TW
BOX XPOS '7.0' CM YPOS '1.0' CM WIDTH '3.0' CM HEIGHT 1 CM FRAME 10 TW
BOX XPOS '10.0' CM YPOS '1.0' CM WIDTH '3.0' CM HEIGHT 1 CM FRAME 10 TW
BOX XPOS '13.0' CM YPOS '1.0' CM WIDTH '1.8' CM HEIGHT 1 CM FRAME 10 TW
BOX XPOS '14.8' CM YPOS '1.0' CM WIDTH '1.5' CM HEIGHT 1 CM FRAME 10 TW
BOX XPOS '16.3' CM YPOS '1.0' CM WIDTH '3.0' CM HEIGHT 1 CM FRAME 10 TW

&EKPO-EBELP& &EKPO-EMATN& &EKPO-TXZ01& &EKET-EINDT& &EKET-UZEIT& &EKPO-MENGE& &EKPO-MEINS& &EKPO-KONNR&&EKPO-KTPNR&

    Requires Free Membership to View

As you have discovered the hard way, I would advise against having a BOX command in a conditional text element in a MAIN window. There are limitations on how this command works, particularly as relates to information which can print anywhere on a page. Generally, boxes belong either in a secondary window or in a default text element (i.e. at the top) of the MAIN window. I imagine you will need to redesign your form to accommodate these restrictions.

That being said, if you are determined to draw dynamic boxes in the MAIN window, take a look at SAP-provided print program 'PSFC_OBJECT_LIST' and SAPscript form 'PSFC_PRINT_LAY'. Here the print program tracks precisely where each text element begins and ends so that it can accomplish this, but it requires a rigidly built form. I'll leave it to you to decide whether the trade-off in design flexibility is worth it.

This was first published in January 2007

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: