on 10-07-2008 11:58 AM
Hi to all,
I create ADOBE form and save it from the printing program.
I call to the form in loop, evry time I send it diffrent data.
I want the all the forms will be saved in one file.
I see that the file that created is getting bigger in evry loop, but when I try to opwn it in Acrobat Reader (not from sap) I see only the last page I saved.
Please review the code and tell me what I am doing wrong:
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT lt_emp_details INTO ls_emp_details.
CALL FUNCTION '/1BCDWB/SM00000018'
CALL FUNCTION l_fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
ls_emp_data = ls_emp_details
IMPORTING
/1bcdwb/formoutput = fp_result
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
filename =p_path.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = fp_result-pdf
append_to_table = 'X'
TABLES
binary_tab = gt_file.
cl_gui_frontend_services=>gui_download( EXPORTING
filename = filename
filetype ='BIN'
append = 'X'
CHANGING
data_tab = gt_file ).
PERFORM download_file.
ENDLOOP.
CALL FUNCTION 'FP_JOB_CLOSE'
IMPORTING
e_result = result
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
Thanks in advanced
Chaya.
Did anyone get this to work? I have the same requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The problem is that on every form you fet while calling the function module, you get the header information of an ADOBE Forms so when you try to open it you will see the latest one ...
The ideal solution is to merge all your document into one , unfortunately it's not possible while using ADS in SAP .
An alternative for your problem is to modify your form in order to have page break while changing of forms . Then you will retrieve only one form with all page and that should work.
Hope this is clear and help you .
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
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.