cancel
Showing results for 
Search instead for 
Did you mean: 

output_options in SF; selecting output device

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member181962
Active Contributor
0 Kudos

Hi Joris,

Are you getting value in the g_dest variable after the call to the fm?

Regards,

Ravi

Former Member
0 Kudos

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

Former Member
0 Kudos

hi

along with the parameters u r passing( printer name etcc) u need to pass the DEVICE.

  st_control_parameters-device     = c_printer. "Output device
  st_output_options-tddest         = p_prntr.   "name of printer
  st_output_options-tddataset      = p_prntr.   "dataset name

i hope u r problem will be solved

Former Member
0 Kudos

Hi,

if i'm correct this should be set with the value 'PRINTER' right?

i allready tried that

but whats the tddataset in your example meaning?

I've never doen anything with that yet

Thanks

Joris

Message was edited by:

Joris Bots

Former Member
0 Kudos

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

Former Member
0 Kudos

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

former_member181962
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

just to make sure:

I'm trying to set the outputdevice FROM WITHIN the smartform.

thanks,

Joris

Former Member
0 Kudos

no one?