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: 

Fill in spool options without dialog in Smartforms

Former Member
0 Kudos

Hi,

I´m trying to set the spool parameters before printing in Smartforms. Therefore I don´t want a dialog to choose the print options.

There are too structures, which are going to be passed to the smartform function: OUTPUT_OPTIONS and CONTROL_PARAMETERS.

I have the shortname of the device (CHAR4 field), like 'LOCL' or a print device.

How can I now set the parameters before calling the function of the smartform? When I fill the 4char device field into output_options-tddest, it´s not working! It´s always printing on the default device!

What else should I fill to get it printed right?

Cheers Arne

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi Ame,

in control params you need to set no_dialog

and in output options you need to give valid device.

for printer device names check the table<b> TSP03</b>

and give valid one.

Regards

vijay

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Hi Ame,

in control params you need to set no_dialog

and in output options you need to give valid device.

for printer device names check the table<b> TSP03</b>

and give valid one.

Regards

vijay

0 Kudos

Hi Vijay,

thanks for Your answer. The background is, that I need to change all production forms form DIN A4 to DIN A5 and make bigger changes in the layout.

Therefore I decided to create it new in Smartforms, it should be better than calculating the dynamic boxes again in Sapscript.

If You want to print the forms, You can do that about CO01/02/03. Therefore You have to set "lists" where You can customize the printer device, the sapscript form and the sapscript program.

To do it in Smartforms, I´m checking the list parameters in my print program and, in case which list was choosen, I call the specific smartform.

No I want to use the device options set in the list. I´m using the function CO_PRINT_GET_INFO_LIST and I get back two structures with the list information. PRINT_CO and PRINT_OPTS.

In PRINT_CO there is a field called DESTI. It contains the shortname of the device.

Now I want to pass this one to the smartform. The device is valid, but my smartform always uses the default device.

My code:


CALL FUNCTION 'CO_PRINT_GET_INFO_LIST'
       IMPORTING
            print_co_exp   = print_co
            print_opts_exp = print_opts
       EXCEPTIONS
            OTHERS         = 0.

    wa_control_parameters-device = 'PRINTER'.
    wa_control_parameters-preview = ''.
    wa_control_parameters-no_dialog = 'X'.
    wa_output_options-tddest = print_co-desti.
*    wa_output_options-tdprinter = print_co-desti.
    wa_output_options-tdarmod = '1'.
    wa_output_options-tdcopies = '001'.
    wa_output_options-tddelete = 'X'.
    wa_output_options-tdlifetime = '2'.
    wa_output_options-tdtitle = print_opts-tdtitle.

    CALL FUNCTION '/1BCDWB/SF00000029'
      EXPORTING
*       ARCHIVE_INDEX              =
*       ARCHIVE_INDEX_TAB          =
*       ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         =  wa_control_parameters
*       MAIL_APPL_OBJ              =
*       MAIL_RECIPIENT             =
*       MAIL_SENDER                =
       OUTPUT_OPTIONS             =  wa_output_options
       USER_SETTINGS              = 'X'
      IMPORTING
        JOB_OUTPUT_OPTIONS        =  wa_job_output.


I hope You understand my problem.

Cheers Arne

0 Kudos

Hi

The parameter USER_SETTINGS should be SPACE and transfer the short name to wa_output_options-TDDEST

Max

0 Kudos

Hi!

Before I have checked the field user_settings, it hasn´t worked, too....???

Ok, thank You very much, it´s working now! ;o)

Cheers

0 Kudos

Hey Arne ,

You just make the following change :

<b>USER_SETTINGS = SPACE</b>

Keep the remaining things same as before.

You should get the right result.

Regards,

Kunal