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: 
Read only

Save PDF file smartforms with custom name

rangerlet_mesee
Participant
0 Likes
1,193

Hello

I am saving the PDF preview of a smartform into local directory using SSF_PDF_PREVIEW successfully....but I need custom specific name for the PDF file while saving the file..how can I achieve this?

Thanks!!

Hello

I am saving the PDF preview of a smartform into local directory using SSF_PDF_PREVIEW successfully....but I need custom specific name for the PDF file while saving the file..how can I achieve this?

Thanks!!

1 REPLY 1
Read only

0 Likes
757
if me->ms_nast-kschl = 'ZIN7'.
    me->store_pdf( iv_form_output = ls_formoutput-pdf
    iv_pdf         = ls_formoutput-pdf ).
endif.

lv_dataset     type rlgrap-filename
call function 'SCMS_XSTRING_TO_BINARY'
  exporting
    buffer        = iv_form_output
  importing
    output_length = lv_file_length
 tables
    binary_tab    = lt_data.

*-Construct dataset
concatenate lv_sap_dir '\' me->ms_data-header-vbeln '.pdf'
into lv_dataset.
*-Store PDF on de Unix server as a binary file
open dataset lv_dataset for output in legacy binary mode.
transfer iv_form_output to lv_dataset.
close dataset lv_dataset.


does that help?