cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

GET LT_OTFDATA-OTFDATA AFTER 'CALL FUNCTION fm_name' SMARTFORMS

clayton_barbosa
Participant
0 Likes
482

Hi! 

I need to send by email a document (PDF) generated by SMATFORMS executed in BATCH.
When executing 'CALL FUNCTION fm_name' it does not feed the LT_OTFDATA-OTFDATA if executed with the 'NO_DIALOG' option.

What should I do to obtain data from OTFDATA and attach it to the email?

Thank you!

Print debug no_dialog and with dialog.

clayton_barbosa_0-1720200759542.png

with dialog.

clayton_barbosa_1-1720200872534.png

 

clayton_barbosa_2-1720200964645.png

 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

RaymondGiuseppi
Active Contributor
0 Likes

Try to remove the user_options parameter, and use following code to pass values to SmartForms

(Remove unwanted values, this is only a sample)

  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      mode           = 'CURRENT'
      no_dialog      = 'X'
      user           = sy-uname
    IMPORTING
      out_parameters = out_parameters
    EXCEPTIONS
      OTHERS         = 1.
  IF sy-subrc = 0.
    output_options-tddest     = out_parameters-pdest.
    output_options-tdcopies   = out_parameters-prcop.
    output_options-tdcovtitle = out_parameters-prtxt.
    output_options-tdautority = out_parameters-prber.
    output_options-tdimmed    = out_parameters-primm.
    output_options-tddelete   = out_parameters-prrel.
    output_options-tdnewid    = out_parameters-prnew.
    output_options-tdlifetime = out_parameters-pexpi.
    output_options-tdarmod    = out_parameters-armod.
    output_options-tdcover    = out_parameters-prsap.
    output_options-tdreceiver = out_parameters-prrec.
    output_options-tddivision = out_parameters-prabt.
  ENDIF.

 

raga1234
Explorer
0 Likes

Hi,

I have replicated the scenario but it is working fine for me in both with and without dialog box.

Kindly check by passing the user settings = space.

regards,

Raghav.