Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

Re: Defaulting Output Device for Specific TCode

$
0
0

Thank you all I could do it successfully for defaulting the output device in the popup dialog. The user can still change the output device before generating the spool request and send the form to the printer.

 

I will share the code, so it might help

 

DATA: lv_formname TYPE tdsfname VALUE 'ZREPORT',

         lv_fm_name TYPE rs38l_fnam,

         s_output TYPE SSFCOMPOP. "This is the one that will specify the printing options

 

s_output-TDDEST = 'LP06'. "output device you can get from TSP03

s_output-TDPRINTER = 'ZHP4250'. "output device type you can get it from TSP03

s_output-TDIMMED = 'X'. "print immediately

 

"Function call will generate function module for the smart form

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

     EXPORTING

       formname           = lv_formname

     IMPORTING

       fm_name            = lv_fm_name

     EXCEPTIONS

       no_form            = 1

       no_function_module = 2.

 

   CALL FUNCTION lv_fm_name

     EXPORTING

       gs_header        = gs_header_data

       OUTPUT_OPTIONS = s_output

       USER_SETTINGS = ''

     TABLES

       gt_final         = gt_table_data

       gt_sub_final     = gt_sub_table

     EXCEPTIONS

       formatting_error = 1

       internal_error   = 2

       send_error       = 3

       user_canceled    = 4.



Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>