on 10-23-2006 12:29 PM
when trying to upload a (editable)interactive PDF form using Adobe PDF interactive forms,an unknown error is occuring.
see the sample code, its giving an error in ADS(Adobe Document Services)calling....
****************************************************
*lv_filename = p_pdf.
CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD(
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'BIN' "Binary
IMPORTING
FILELENGTH = LV_FILELENGTH
CHANGING
DATA_TAB = LT_RAWTAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
NOT_SUPPORTED_BY_GUI = 17
ERROR_NO_GUI = 18
OTHERS = 19 ).
Get FP reference
DATA: LO_FP TYPE REF TO IF_FP VALUE IS INITIAL.
LO_FP = CL_FP=>GET_REFERENCE( ).
For handling exceptions
DATA:
LO_FPEX TYPE REF TO CX_FP_RUNTIME VALUE IS INITIAL.
TRY.
Create PDF Object using destination 'ADS' (<-- this is how it
defined in SM59)
DATA:
LO_PDFOBJ TYPE REF TO IF_FP_PDF_OBJECT VALUE IS INITIAL.
LO_PDFOBJ = LO_FP->CREATE_PDF_OBJECT( CONNECTION = 'ADS' ).
********************************************
DATA:
LINE TYPE TLINE,
L_PDF_XSTRING TYPE XSTRING.
FIELD-SYMBOLS <P> TYPE X.
CLEAR L_PDF_XSTRING.
LOOP AT LT_RAWTAB INTO LINE.
ASSIGN LINE TO <P> CASTING TYPE X.
CONCATENATE L_PDF_XSTRING <P> INTO L_PDF_XSTRING
IN BYTE MODE.
ENDLOOP.
PDF_DATA = L_PDF_XSTRING.
*********************************************
Set document
LO_PDFOBJ->SET_DOCUMENT(
EXPORTING
PDFDATA = PDF_DATA ).
PDFFILE = LV_FILENAME ).
Tell PDF object to extract data
LO_PDFOBJ->SET_EXTRACTDATA( ).
Execute the call to ADS
LO_PDFOBJ->EXECUTE( ).
ENDTRY.
****************************************************
Following is the snapshot of the error analysis:
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assinged to the class 'CX_FP_RUNTIME_SYSTEM', was not
caught,
which led to a runtime error.
The reason for this exception is:
Error in Adobe Document Services: Processing exception during a
"CreateCorbaSupportObjects" operation.#Request start time: Mon Oct 23 16:35:34
IST 2006#com.adobe.ProcessingError: PDF operation failure error while creating
a PDFManipulation Module for PDF:
Hi Poonam,
thank you. I took note in this afternoon. And correct your error with file length (I must do it too).
Regards
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
Thanks a lot! The problem was because of using the XSLTDATA parameter of the method set_task_extractdata. As per your suggestion, I simply used the method without any parameters and it now works!
FYI, the method set_extractdata is now obselete and it is recommended to use set_task_extractdata in its place.
Thanks again.
Regards,
Poonam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Poonam
I am too working on Adobe form .
I am facing the problem of data extraction from PDF into Internal table.
As per suggested in the thread i am trying to use the method "set_task_extractdata" but in the class IF_FP_PDF_OBJECT no such method exist.
but method "set_extractdata" is there.
Can you guide me on this
Regards
Animesh S.
Hi Poonam
you have said that the method set_extractdata is now Out-dated and it is recommended to use set_task_extractdata in its place.
but to me in class IF_FP_PDF_OBJECT method set_task_extractdata is not found.
but set_extractdata is there.
Is it because of version difference or something else.
Regards
Animesh S.
Hi Poonam,
there is an error in your following code too. I have the same error in my code but it works Look to form convert_tab_to_x in the report FP_PDF_TEST_03.
* Move to XSTRING
LOOP AT lt_rawtab ASSIGNING <ls_rawtab>.
CONCATENATE pdf_data <ls_rawtab>-data INTO pdf_data IN BYTE MODE.
ENDLOOP.
Regards
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael
I need some clarification regarding download of details from pd to internal table.
standard programme FP_PDF_TEST_03 will download the details from PDF formatt into excell-sheet but in my case i need to download the details into an internal table.
In the standard program there is a perform ( PERFORM download_file USING l_data p_xml) which loads details from into XLS fromat.
i have records in l_data but need to upload it itno IT .
Is there any standard FM which could help .
Regards
Animesh S.
Hi Poonam,
I think that your problem is in parameter xsltdata of method set_task_extractdata.
Use code from example report FP_PDF_TEST_03:
call method l_pdfobj->set_task_extractdata( ).
Regards
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Poonam ,
I don't use method set_task_extractdata. I use a code like this:
LOOP AT lt_rawtab ASSIGNING <ls_rawtab>.
CONCATENATE pdf_data <ls_rawtab>-data INTO pdf_data IN BYTE MODE.
ENDLOOP.
lo_pdfobj->set_document( EXPORTING pdfdata = pdf_data ).
* Tell PDF object to extract data
lo_pdfobj->set_extractdata( ).
* Execute the call to ADS
lo_pdfobj->execute( ).
Regards
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Here is my code extract.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = lt_file_table
rc = lv_rc
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
READ TABLE lt_file_table
INTO lv_filename
INDEX 1.
cl_gui_frontend_services=>gui_upload(
EXPORTING
filename = lv_filename
filetype = 'BIN' "Binary
IMPORTING
filelength = lv_filelength
CHANGING
data_tab = lt_rawtab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19 ).
Get FP reference
DATA: lo_fp TYPE REF TO if_fp VALUE IS INITIAL.
lo_fp = cl_fp=>get_reference( ).
For handling exceptions
DATA: lo_fpex TYPE REF TO cx_fp_runtime VALUE IS INITIAL.
TRY.
Create PDF Object using destination 'ADS' (<-- this is how it is
defined in SM59)
DATA: lo_pdfobj TYPE REF TO if_fp_pdf_object VALUE IS INITIAL.
lo_pdfobj = lo_fp->create_pdf_object( connection = 'ADS' ).
FIELD-SYMBOLS: <ls_rawtab> LIKE LINE OF lt_rawtab.
Move to XSTRING
LOOP AT lt_rawtab ASSIGNING <ls_rawtab>.
CONCATENATE pdf_data <ls_rawtab>-data INTO pdf_data IN BYTE MODE.
ENDLOOP.
Set document
lo_pdfobj->set_document(
EXPORTING
pdffile = lv_filename
pdfdata = PDF_DATA
).
Tell PDF object to extract data
lo_pdfobj->set_task_extractdata(
EXPORTING
xsltdata = pdf_data
).
Execute the call to ADS
lo_pdfobj->execute( ).
CATCH cx_fp_runtime_system.
ENDTRY.
Moreover, the ADS connection is working fine when tested using report FP_PDF_TEST_00
Any help will be greatly appreciated.
Regards,
Poonam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Poonam,
is your code for reading correct? I haven't yet seen any problem with uploading of an adobe form from pc. My code is like:
DATA: lt_file_table TYPE filetable,
l_rc TYPE I,
lt_rawtab TYPE TABLE OF OCS_F_DATA,
l_filelength TYPE I,
l_filename TYPE string,
l_pdf TYPE xstring.
FIELD-SYMBOLS: <ls_file_table> LIKE LINE OF lt_file_table,
<ls_rawtab> LIKE LINE OF lt_rawtab.
* Selection of a file
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
FILE_FILTER = 'PDF files (*.pdf)|*.pdf|All Files (*.*)|*.*'
CHANGING
FILE_TABLE = lt_file_table
RC = l_rc
EXCEPTIONS
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.
IF lt_file_table[] IS INITIAL.
RETURN.
ENDIF.
READ TABLE lt_file_table ASSIGNING <ls_file_table> INDEX 1.
l_filename = <ls_file_table>-filename.
* Reading of a file
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = l_filename
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = l_filelength
CHANGING
DATA_TAB = lt_rawtab
EXCEPTIONS
others = 19.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Move to XSTRING
LOOP AT lt_rawtab ASSIGNING <ls_rawtab>.
CONCATENATE l_pdf <ls_rawtab>-data INTO l_pdf IN BYTE MODE.
ENDLOOP.
Regards
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am uploading the pdf form (.pdf) from the C:\ drive of the presentation server. And I am getting this exception 'CX_FP_RUNTIME_SYSTEM'. Obviously the contents of the file are not read subsequently.
However, if I upload the same file from the application server, it works!
Is there any limitation that the file has to reside on the application server only?
Regards,
Poonam
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.