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: 

Form Print on different Printers

Former Member
0 Kudos

Hi

We have a requirement to print A4 size print on different models of laser jet printer, but the default paper Margins are not common for all the printers.

How to over write these Margins(Left and Upper) and make accept our settings.

Please help.

Regards

SK.

8 REPLIES 8

former_member182915
Active Contributor
0 Kudos

Collected from

hi

why is not good idea? it's not true

All u need to do is just to open/close the spool once and show the dialog at the beginning.

That means after the first calling u need to transfer the same print data to the following calls:

DESCRIBE TABLE ITAB LINES TOT_LINES.  LOOP AT ITAB.    IF SY-TABIX = 1. * Dialog at first loop only       CONTROL_PARAMETERS-NO_DIALOG = SPACE. * Open the spool at the first loop only:       CONTROL_PARAMETERS-NO_OPEN     = SPACE * Close spool at the last loop only       CONTROL_PARAMETERS-NO_CLOSE   = 'X'.    ELSE. * Dialog at first loop only       CONTROL_PARAMETERS-NO_DIALOG = 'X'. * Open the spool at the first loop only:       CONTROL_PARAMETERS-NO_OPEN     = 'X'.    ENDIF.     IF SY-TABIX = TOT_LINES. * Close spool       CONTROL_PARAMETERS-NO_CLOSE   = SPACE.    ENDIF.      CALL FUNCTION <SMARTFORM       EXPORTING         CONTROL_PARAMETERS = CONTROL_PARAMETERS         OUTPUT_OPTIONS            = OUTPUT_OPTIONS         ........................       IMPORTING          JOB_OUTPUT_OPTIONS   = JOB_OUTPUT_OPTIONS         ........................  *  the same output options for all:   MOVE-CORRESPONDING JOB_OUTPUT_OPTIONS TO  OUTPUT_OPTIONS. ENDLOOP.

Max

Private_Member_7726
Active Contributor
0 Kudos

Hi,

I doubt anybody can give you useful advice based on the kind of vague information you have supplied.

"Form print" of what kind of forms? Which "models of laser jet printer"? Which printer language is to be used - PCL, Postscript, something else?


What is meant by "default paper Margins" - printers printable area? What is meant by "overwrite" - control printer settings programmatically, from ABAP?


Printer settings for SAP Spool system are configured in SAP device type; SAPscript/Smartforms have limited ability to control printers using something called Print-Controls, which are exposed by device type.

cheers

Jānis

0 Kudos

Dear Janis,

I am repeating my requirement. I need to print Billing document details on A4 size paper , where so many different models of laser jet printers are already in use at different depots of our client company.

We used following details in Smartform

page format - DIN4

Printer models  : HP 1108, 1006,1008...

Overwrite means :

Example :

Printer 1 having 30 mm as left & Upper margin

Printer 2 having 50 mm as left & Upper margin

We want to overwrite it as 10 mm as a common left and upper margins on all the printers.

Please suggest.

Thanks,

SK.

0 Kudos

Thanks, that's much better, but I'm still a bit puzzled by two things:

- what SAP device type is used for printing the Smartforms (PCL, Postscript, Windows or other device  type for frontend printing...)?

- depending on the concrete setup used, there can be more than one place where the page settings could be controlled (the printer itself, in SAP device type, or - if frontend printing is used - frontend print driver for example)

Can you also try to describe the print setup in SAP (at least the SAP device types involved and host printer access methods)?

cheers

Jānis

0 Kudos

Dear Janis

Thanks for the reply.

Device Type Used : Front End Printer.

Access Method     : F.

Kindly advise.

Regards

SK.

0 Kudos

Hi,

I have very limited experience with frontend printing so I hope someone from or some expert like catches a glimpse of your post and can confirm whether we are on the right way

I'd start by trying to add to the Initialization "event" of page Format DINA4 of a (copied) SAP device type whats outlined in OSS note 50744 - Modify page layout SAPWIN / print lists:


4. Set left hand margin in nnn=points*20

\eMLnnn;


5. Set upper margin in nnn=points*20

\eMTnnn;

"enable_phys_margins" from 85469 - Options for the SAPSprint print server tool may or may not have something to do with it as well:


  • Key: "enable_phys_margins"
    • Default: 1
    • Other values: 0, 2
  • Effect:
    1 = if required by the user, the physical paper boundaries are used for printing (see SAPWIN commands).
    0 = the printable area of the relevant printer is always used even if you activate physical positioning for each command.
    2 = physical positioning is always activated even if the command "logical" is required. The default remains "logical" (important for lists). Therefore, you must ensure that you make a switch. The switch also occurs if you use the "Baseline" command (\eOCb).

I have never come across a requirement to manipulate page layout/printer's printable area for Smartform printing for predefined page Format like DINA4... It feels like an "odd" requirement - because SAP device types and most if not all of printers have this format predefined and SAP would use whatever printable area printer manufacturers have set up for DINA4 paper size. If upper margin of the printable area has been set to 30 mm (3 cm), I don't believe there is even space left to fit DINA4 size output on the paper...

Smartform itself has no such concept as "page margins" - the output elements (windows) can be placed within whole of area defined for DINA4 and if all forms need to begin output 1.5 cm from the left it's just a matter of arranging all Smartform windows appropriately (and calibrating the printer's printable area, if there are noticeable differences between the models)...

One can also do small adjustments in whole milliliters at the level of individual output devices as outlined in Adjusting Margins for SAPScript and Smartform Printouts, but I'd leave that as the last option if everything else fails.

Or it may also be that I'm still completely misunderstanding what the problem is and what you are trying to achieve...

Cheers

Jānis

0 Kudos

Janis,

Thank you for your help.

We could solve our problem after read the SAP Note (50744 - Modify page layout SAPWIN / print lists) that you recommended.

Best Regards,

Sergio Souza

Laszlo_B
Active Contributor
0 Kudos

Hello Shravan,

  gave a pretty good description about the situation and the possible solutions: unfortunately this is a hardware setting which can be hardly influenced by SAP.

A bit of technical background is written in SAP Note #101266 - "SAPscript: Printable area for laser printers", and a possible workaround is in SAP Note #183948  - "Identical output on PCL-5,PostScript,SAPWIN".

Although unfortunately the (last) Note won't give a definitive solution, it has not yet been mentioned which Device Type is used.

If there is a selection possibility, it would be useful to choose a PostScript Device Type, because as Note #101266 states:

"PostScript interprets the X/Y coordinates as positions on the physical paper page, so with the device type POSTSCPT there is no difference between the coordinate positions in the form and on the paper."

So, to sum up the possible solutions:

  • if PostScript Device Types can be used for the printers, try to only use Device Type POST2 (instead of POSTSCPT)
  • if not a PostScript Device Type is used but either only SAPWIN or either only PCL, set the margin commands mentioned by for SAPWIN, or set the PCL commands which are described in the printer's manual. Both in the case of SAPWIN and PCL the commands need to be put into the "Printer initialization". (This means: in transaction SPAD open the used Device Type for editing. Press the button "Formats" and double-click on the Format name - according to your description, it should be DINA4 - and enter the page commands under "Printer initialization")
  • if several Device Types will be used, please test the margin adjustments options in transaction SPAD in the Output Device definition, or follow the general recommendations from Note #183948.

Best regards,

Laszlo