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: 

Purchase Order SmartForm: job_output_info is empty

Former Member
0 Kudos
2,333

Hi ABAPers,

I cannot get the export parameter JOB_OUTPUT_INFO to populate at all for the baseline smartform YBUS_MMPO (Purchase Order) function module.

My goal is to retrieve the OTF data table and convert to PDF. For some reason, nothing is returned in this structure and I can't for the life of me figure out why. I've tried many different combinations of values in the control_parameters structure as well as the output_options structure based on different recommendations but to no avail. Please provide some recommendations...

Note: I have tried to retrieve OTF data for a different smartform in this system and was successful, leading me to believe it has something to do specifically with this smartform itself and/or my combination of parameters. Additionally, if the control_parameters-getotf is not passed, the smartform will successfully generate/be displayed.

Here's what I got. Thanks in advance:

    lf_formname = 'ZBUS_MMPO'.

*   Determine smartform function module for purchase document

     CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

       EXPORTING

         formname           = lf_formname

       IMPORTING

         fm_name            = lf_fm_name.

.

     DATA: ls_control_param      TYPE ssfctrlop.

     DATA: ls_job_output_info TYPE SSFCRESCL,

           ls_job_output_options TYPE ssfcresop,

           ls_document_output_info TYPE SSFCRESPD,

           ls_output_options TYPE ssfcompop.

*    control parameters

     ls_control_param-device = 'PRINTER'.

     ls_control_param-preview = 'X'.

     ls_control_param-langu = 'E'.

     ls_control_param-no_dialog = 'X'..

     ls_control_param-getotf = 'X'.

*    output options

*     ls_output_options-tdarmod = '1'.

*     ls_output_options-tddest = 'LOCL'.

*     ls_output_options-tdimmed = 'X'.

*     ls_output_options-tdreceiver = 'BMCDONNELL'.

*     ls_output_options-tdcopies = '001'.

*     ls_output_options-tdprinter = 'PDF1'.

*      ls_output_options-tdnoprev = 'X'.

     DATA: ls_pekko TYPE pekko,

           ls_ekko TYPE ekko,

           lv_druvo TYPE druvo VALUE '1'.

     DATA: lt_ekpo TYPE TABLE OF ekpo,

           lt_ekpa TYPE TABLE OF ekpa,

           lt_pekpo TYPE TABLE OF pekpo,

           lt_eket TYPE TABLE OF eket,

           lt_tkomv TYPE TABLE OF komv,

           lt_ekkn TYPE TABLE OF ekkn,

           lt_ekek TYPE TABLE OF ekek,

           lt_komk TYPE TABLE OF komk.

     CALL FUNCTION lf_fm_name

       EXPORTING

*        archive_index      = toa_dara

*        archive_parameters = arc_params

         control_parameters = ls_control_param

*        mail_recipient     = ls_recipient

*        mail_sender        = ls_sender

         output_options     = ls_output_options

         is_ekko            = ls_ekko

*        user_settings      = ' '  "Disable User Printer

         is_pekko           = ls_pekko

*        is_nast            = l_nast

*        iv_from_mem        = l_from_memory

         iv_druvo           = lv_druvo

*        iv_xfz             = iv_xfz

       IMPORTING

*        document_output_info = ls_document_output_info

         job_out_info       = ls_job_output_info

*        job_output_options = ls_job_output_options

       TABLES

         it_ekpo            = lt_ekpo

         it_ekpa            = lt_ekpa

         it_pekpo           = lt_pekpo

         it_eket            = lt_eket

         it_tkomv           = lt_tkomv

         it_ekkn            = lt_ekkn

         it_ekek            = lt_ekek

         it_komk            = lt_komk

       EXCEPTIONS

         formatting_error   = 1

         internal_error     = 2

         send_error         = 3

         user_canceled      = 4

         OTHERS             = 5.

5 REPLIES 5

anubhab
Active Participant
0 Kudos
1,126

Hi Alex,

    Please try with  ls_control_param-preview = ' ' (space). And also check the sy-subrc value after executing the FM in debugger, if it's anything other than 0. Do let us know.


Regards,

Anubhab

Former Member
0 Kudos
1,126

Anubhab,

I tried the change you suggested and changed ls_control_param-preview to ' '.

Unfortunately, ls_job_output_info is still coming out completely empty. Strangely, sy-subrc is 0.

Alex

anubhab
Active Participant
0 Kudos
1,126

Hi Alex,

           Please try the following and let us know:

ls_control_param-no_dialog = 'X'.

ls_control_param-device      = 'PRINTER'.

ls_control_param-tdnewid    = 'X'.

ls_control_param-tdimmed    = 'X'.

ls_control_param-preview   = ' '.

ls_control_param-tdprinter   = 'PDF1'.

ls_control_param-tddest      = 'LP01'. (your local printer name)

ls_control_param-getotf       = 'X'.


And also for IMPORTING (EXPORTING) parameter for the smartform pass

user_settings    = 'X'.
  

Regards,

Anubhab

Former Member
0 Kudos
1,126

Anubhab,

Tried this configuration and still no luck. Sy-subrc = 0 but again empty export parameter.

Thanks,

Alex

Former Member
0 Kudos
1,126

Hii Alex,

try below mention code.

    is_ctrlop-getotf = 'X'.
   is_ctrlop-preview = ''.
   is_ctrlop-no_dialog = 'X'.
   is_outopt-tddest = 'LP01'.


Regards

Gaurav