Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

How to open a PDF-Smartform per Function

$
0
0

Hello together,

i have a Smartform which i want to open as a PDF out from the Web-UI.

Because i want to run the Methode Print_PDF out from a Survey i create the button with the follwing code:

 

  

* Add Print Button
  ls_button-page_id     = me->component_id.
  ls_button-TYPE        = cl_thtmlb_util=>gc_icon_print.
  ls_button-enabled     = abap_true.
  ls_button-ON_CLICK    = 'Print_Smartform'.

 

That i create the Methode Print_Smartform().

Here i want to open the Smartform as PDF:

 

So far i undersand i have 3 possibilities to open the PDF.

1. create a actionprofil and run the actionprofil (i am in a Survey on an Opportunity so i am not shure if that is possible)

2. CALL METHOD CL_DOC_PROCESSING_CRM_ORDER=>EXEC_SMART_FORM (and the Popup is created automatically?)

3. use the Functionmodules

   ********* Run Smartform *********************
**    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
**      EXPORTING
**        formname = 'ZCRM_JDI_SQ_MS_SUMMARY'
**      IMPORTING
**        fm_name  = lv_fnam.
**
**
***    DATA: OUTPUT_OPTIONS LIKE line of SSFCTRLOP.
**    data: output_options type SSFCTRLOP.
**    DATA: V_SIZE TYPE I.
**    DATA: s_job_output_info type SSFCRESCL.
**

*    OUTPUT_OPTIONS-TDDEST = 'OTF_MEM'.
*    OUTPUT_OPTIONS-TDPRINTER = 'IND5'.
*    OUTPUT_OPTIONS-TDIMMED = 'X'.
*    OUTPUT_OPTIONS-TDCOPIES = '1'.
*    OUTPUT_OPTIONS-DEVICE = 'PRINTER'.
*    OUTPUT_OPTIONS-GETOTF = 'X'.
*    OUTPUT_OPTIONS-no_dialog = 'X'.

*    CALL FUNCTION lv_fnam
*      EXPORTING
*        OUTPUT_OPTIONS       = OUTPUT_OPTIONS
*        ARCHIVE_PARAMETERS   = CONTROL_PARAMETERS
*        USER_SETTINGS        = ' '
*      IMPORTING
*      JOB_OUTPUT_INFO        =  s_job_output_info
*      EXCEPTIONS
*        FORMATTING_ERROR     = 1
*        INTERNAL_ERROR       = 2
*        SEND_ERROR           = 3
*        USER_CANCELED        = 4
*        OTHERS               = 5.


** Convert OTF data to PDF
*data: l_pdf_len type string.
*data: l_pdf_xstring type xstring.
*data: lt_lines type TLINE.
*
*    CALL FUNCTION 'CONVERT_OTF'
*    EXPORTING
*      FORMAT                = 'PDF'
*    IMPORTING
*      bin_filesize          = l_pdf_len
*      bin_file              = l_pdf_xstring
*    TABLES
*      otf                   = s_job_output_info-OTFDATA
*      LINES                 = It_lines
*    EXCEPTIONS
*      err_max_linewidth     = 1
*      err_format            = 2
*      err_conv_not_possible = 3
*      err_bad_otf           = 4
*      OTHERS                = 5.

 

Please could you help me to find the best solution?

 

Best Regards.

Benjamin


Viewing all articles
Browse latest Browse all 7775

Trending Articles



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