on 02-01-2007 3:55 PM
Hi all,
i've been struggling with the following, maybe anyone can help?
In a smartforms i want to, dynamically determine the printer for output.
Whatever i do, i cant get it to work. I have set 'print directly' OFF so i can catch the printjobs in the spool. When i look in the Spool, allways the default printer is selected. And when i delete my default printer, i get an error while printing saying i have to define a printer.
This is what i tried so far:
-set USER_SETTINGS to SPACE in the form
- set OUTPUT_OPTIONS-DDEST to the short printername
- set the OUTPUT_OPTIONS-TDPRINTEr to the long printer name
- i even tried the following code which comes with a popup to select th eoutput device..
data : g_dest TYPE rspopname,
g_printer TYPE rspoptype.
*FM to accept the device type and returns the short name of the output device
CALL FUNCTION 'EFG_GET_PRINTER'
EXPORTING
x_no_dialog = ' '
x_obligatory = 'X'
IMPORTING
y_tddest = g_dest
EXCEPTIONS
cancelled = 1
failed = 2
OTHERS = 3.
*device type name for the output device
SELECT SINGLE patype "#EC CI_NOFIELD
FROM tsp03d
INTO g_printer
WHERE padest = g_dest.
output_options-tddest = g_dest.
output_options-tdprinter = g_printer.
The result is allways the same: in the Spool, it has the default printer defined...
What am i doing wrong?
Is it wrong to send the jobs to the spool, where i've deactiveted 'print directly'?
Is it wrong to look at the spool-job for determining on which printer it will be printed?
Hope someone can help!
thanks
Joris Bots
Hi Joris,
Are you getting value in the g_dest variable after the call to the fm?
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ravi,
I nowhere can find the global var you mentioned.
i allredy implented the badi BADI_RE_CP_SF. but no luck here either.
i set the DDEST, i follow it through the whole SF fm. it stays the correct value.
but somehouw, when the document arrives at the spool, it has the default printer set again...
could it somehow be set at system level?
Some system setting forcing all documents to default printer?
Thanks,
Joris
Hi,
1)Go for the Menu item System->User Profile ->own data->defaults->go for the output device
2)check the field name by pressing F1 help.
3)And try to use the structure USDEFAULTS that contains the field SPLD,in ur program.
Try this,it would surely help u.
Reward points if useful
Thanks
seshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
seshu,
thanks for your reply.
Im not entirely sure what you mean with step 3.
the field name of my outputdevice field is indeed SPLD.
The type of this field is RSPOPNAME.
this is the type i used in my code example as well.
could you please explain what you mean?
Thank you for your help,
regards,
Joris
Hi Joris,
The function module EFG_GET_PRINTER will get the printer that is set for a specific user(As seshu mentioned, yu can find the printer that is defined for you , in System->User Profile->Own data.
Defaults tab, Printer name.
Check what printer is defined there? Is it different from the default printer?
Regards,
Ravi
Hi Ravi,
My default printer in Own data is set to let's say PR2007.
I'm not sure what other default printer you mean.
What i want is to send the smartform to a printer
depending on the user's printer in its Own Data.
so if a usre has defined printer PR2007, then the smartform should go to PR2557
if the user has defined printer PR3004, then the form should go to PR3557, etc.
Thank you for your help
Joris
Message was edited by:
Joris Bots
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.