on 11-10-2009 8:45 AM
Hi Experts
I have a program that needs to generate a form and save it to the local hard drive.
I use the following functions for populating the form:
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name ='ZSFPFLS_EX_WDA_CON'
IMPORTING
e_funcname = fm_name.
* Set output parameters and open spool job
fp_outputparams-nodialog = 'X'. " suppress printer dialog popup
fp_outputparams-getpdf = 'X'. " launch print preview
fp_outputparams-PDFCHANGESRESTRICTED = 'N'. "Form can be filled out and signed and you can also create comments
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
* Set form language and country (->form locale)
fp_docparams-langu = 'E'.
fp_docparams-country = 'ZA'.
fp_docparams-dynamic = 'X'.
* Now call the generated function module
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
SCHEDULE = ls_pdf_sched
ADDITIONAL_INFO = ls_convocation-additional_info
ISSUE_DATE = ls_convocation-issue_date
...
IMPORTING
/1bcdwb/formoutput = fp_formoutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
* Close spool job
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
* Now you have the PDF form in xstring format inside the field fp_formoutput-pdf
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = fp_formoutput-pdf
TABLES
binary_tab = itab.
I then want to use the following method for selecting the location where to save the file:
CALL METHOD cl_gui_frontend_services=>file_save_dialog
...
What do I now need to do to actually save the file to that location?
Thanks in advance
Anton Kruse
Decide, whether you want to use this ABAP coding, or it is cleaner/ better/ proper to display the form to the user and let him save it. I recommend this:
Use outputparams to set up the preview every time. Then the form will be displayed with no additional clicks and waiting to the user, And he can check it first and save it using "save" in adobe reader.
Of course you could do this using ABAP, but why would you do this? (except some FTP silent save crazy function:))). And that I would use only for a server not a client purpose. Then I would place the save dialog code right after the conversion at the end of the code you provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That makes much more sense than I was originally thinking..
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.