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

SAPScript:Selecting Different Tray in SAPscript

Former Member
0 Likes
3,522

Hi all,

I want to print on different tray depending up company Code. I want to achieve this with in SAP script rather than modifying Print Prog.

After doing research I come to know that I need to use Print Control Command in Sap Script. Do any one has step by step explanation for this starting from SPAD settings.

Thanks in advance.

7 REPLIES 7
Read only

Former Member
0 Likes
1,241

Hi,

I found the following:

Sapscript form => go to <pages> => print attributes => Resource name

Resource

This field is used to set which paper tray in the target printer is used.

To set this, specify which print control the system is to send to the target printer when this form is printed.

Possible values are:

TRY01: Use paper from tray 1

TRY02: Use paper from tray 2

TRY03: Use paper from tray 3

All printers do not necessarily support tray selection. For a list of printers for which the TRY* print controls are maintained by SAP, see the SAPscript document SAPSCRIPT-TRAYTEST.

Example

If a particular paper type is required for this form and this paper is always located in tray 1 of the printer, specify TRY01 here so that the printer always uses this tray.

Read only

0 Likes
1,241

Thanks Johan Geraedts

for your reply,

Your Solution is perfect for Static situation.

But I want to set Tray dynamically from SapScript.

/: if &CompamyCode& = 'ABC'

/: print-control 'TRY01'

/: endif

/: if &CompamyCode& = 'XYZ

/: print-control 'TRY02'

/: endif

Is the above approach correct? If Yes, then

Do i need to give above statement on every window?

if No, then Do i need to create a different page for each company code?

Do any one has step by step explanation for this starting from SPAD settings.

Message was edited by: Vipin Nagpal

Message was edited by: Vipin Nagpal

Read only

0 Likes
1,241

Hi Vipin, I think your approach is amost there. What I think you need is instead of using print controls, use the 'NEW-PAGE' command with the name of the page within your SapScript that has the paper resource of the printer tray you want to use for that company and so on for each company. So yes, I think you need to create a different page for each company code, but you can share windows between the different pages. See sample layout set S_TEST_02 and standard text SAPSCRIPT-TRAYTEST for further details. (I am currently working on 3.1i so apologies if this info. is not relevant). Regards, Martina

Read only

0 Likes
1,241

In the example S_TEST_02 the key is on the PAGE Print attributes. Under Resource Name you must have TRY01 (or TRY02, TRY03). That selects the tray you want the paper to come from

Read only

0 Likes
1,241

In the example S_TEST_02 the key is on the PAGE Print attributes. Under Resource Name you must have TRY01 (or TRY02, TRY03). That selects the tray you want the paper to come from

Read only

0 Likes
1,241

In the example S_TEST_02 the key is on the PAGE Print attributes. Under Resource Name you must have TRY01 (or TRY02, TRY03). That selects the tray you want the paper to come from

Read only

juan_suros
Contributor
0 Likes
1,241

If I understand you correctly, you want to change the output tray to which the printed documents are sent, not change the source of paper for printing.

I recently worked on a related project, where I wanted to call advanced printer functions from within SAPscript. I used the Actions (simmilar to events) built into each format in every Device Type in SAP to do this.

In SPAD, make sure you are in "Full Administration" mode and select tab "Device Types". Then enter and view any Device Type and press the "Formats" button in the application toolbar. Double click on any format to bring up the "Maintain Format <FORMAT> for Device Type <DEVICE TYPE>" screen. The tab "Formats" shows all the Actions in the process of SAPscript printing where you can enter your own printer control commands.

I found the information needed to explain how all this works in a couple of zip files with the following names:

ZKM10PRE.zip <- for PRESCRIBE printers

ZKM10PCL.zip <- for PCL printers

They include a document that explains everything with the title:

<b>New Custom Device Type for SAP R/3

Short Installation Guide / Feature List</b>

It is all available upon request from Kyocera/Mita corporation.

website: www.kyoceramita.com

technical support line: (800) 438-6482