Professional Documents
Culture Documents
Adobe Form Into Local System in PDF Format. - SAP Blogs
Adobe Form Into Local System in PDF Format. - SAP Blogs
Adobe Form Into Local System in PDF Format. - SAP Blogs
Follow
RSS Feed
Technical Articles
Rohith Ramagiri
December 28, 2020
| 2 minute read
Introduction:
I came across a situation where my client wants to download and save adobe form into local system in PDF format from the report on the
user confirmation. Confirmation message is shown when the user clicks back from output screen.
FP_JOB_OPEN
FP_FUNCTION_MODULE_NAME
FP_JOB_CLOSE
POPUP_TO_CONFIRM
SCMS_XSTRING_TO_BINARY
cl_gui_frontend_services=>gui_download
cl_gui_frontend_services=>execute
Follow
Step 1:
CHANGING
ie_outputparams = lv_fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
Step 2:
Gets the technical name of the generated form.
EXPORTING
IMPORTING
e_funcname = lv_fm_name.
IF sy-subrc <> 0.
ENDIF.
Follow
ELSE.
Like
Step 3:
RSS Feed
Call function ‘lv_fm_name’ (This variable contains technical name of the form). Here, we get a pdf in xsting format generated in
‘lv_fp_formutput-pdf’.
EXPORTING
/1bcdwb/docparams = lv_fp_docparams
gw_ers = gw_ers
IMPORTING
/1bcdwb/formoutput = lv_fp_formoutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
IF sy-subrc <> 0.
ENDIF.
Step 4:
* IMPORTING
* e_result =
EXCEPTIONS
usage_error = 1
system_error Follow
= 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
Like
ENDIF.
RSS Feed
Step 5:
We use this function module to generate an editable pop up to confirm saving the form into local system.
EXPORTING
text_question = text_question
IMPORTING
answer = answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
Step 6:
I have executed the following FM’s when user click’s ‘Yes’ in the step 5.
Follow
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = Like
lv_fp_formoutput-pdf
TABLES
binary_tab = data_tab.
RSS Feed
Step 7:
Using this method we can download the generated form. Here, we have to mention the desired file path in the exporting parameter
‘Filename’. We can save and open our file in the desired path.
EXPORTING
filename = filename1
filetype = 'BIN'
CHANGING
data_tab = data_tab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
Follow
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full Like = 17
dp_timeout = 18
file_not_found = 19
RSS Feed
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
IF sy-subrc <> 0.
ENDIF.
Step 8:
This method is optional. Here, we can able to view the saved or downloaded form in the local system or desktop.
EXPORTING
document = filename
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
others = 10
.
Follow
IF sy-subrc <> 0.
ENDIF. Like
RSS Feed
Conclusion:
Using the above steps one can save the adobe form into local system in PDF format at the desired path.
Alert Moderator
Assigned Tags
ABAP Development
Follow
Dynamic Fonts in Adobe Forms
By
Sambeet Mohapatra Dec 12, 2013
Like
Related Questions
RSS Feed
Adobe form - download the aodbe form
By
Former Member Feb 25, 2009
Adobe Forms function module - downloading the xstring output in PDF file
By
Former Member Jun 17, 2010
Find us on
Follow
Privacy Terms of Use
Trademark
RSS Feed
Newsletter Support