‎2011 Apr 19 8:23 AM
Dear experts ,
we are creating DMS document using BAPI_DOCUMENT_CREATE2 , its all working fine in DEV and Quality system but in production system in case of PDF file bapi is returning success message , but user is not able to display or see the document , getting an error saying 'There was an error opening this document. The file is damagedand could not be repaired'.
my fuction module getting call from java webdynpro application , I have doubt on the OPEN DATASET statments
I am using below code to transfer data to application server ,
IF iv_file_path IS NOT INITIAL.
SPLIT iv_file_path AT '.' INTO lv_filename lv_ext.
CALL FUNCTION 'CV120_DOC_GET_APPL'
EXPORTING
pf_file = iv_file_path
IMPORTING
pfx_dappl = lv_file_type.
TRANSLATE lv_file_type TO UPPER CASE.
OPEN DATASET log FOR OUTPUT IN BINARY MODE
TRANSFER lv_ext TO log.
ls_documentfiles-wsapplication = lv_file_type.
TRANSLATE ls_documentfiles-wsapplication TO UPPER CASE.
CONCATENATE
lv_filename
'.'
lv_ext
INTO lv_file_name.
CONDENSE lv_file_name NO-GAPS.
TRANSFER lv_file_name TO log.
OPEN DATASET lv_file_name FOR OUTPUT IN BINARY MODE MESSAGE lv_msg.
**Transfer Attachment Content to Application Server
TRANSFER iv_file_data TO lv_file_name.
CLOSE DATASET lv_file_name.
Please help
‎2011 Apr 21 9:20 AM
After convert PDF file you have to use following FM the u send file.
DATA: pdf TYPE REF TO cl_hrasr00_pdf_generation.
DATA : lt_data TYPE solix_tab.
OPEN DATASET filename FOR INPUT IN BINARY MODE.
IF sy-subrc EQ 0.
READ DATASET filename INTO filex.
ENDIF.
IF filex IS NOT INITIAL.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = filex
IMPORTING
output_length = file_length
TABLES
binary_tab = gt_objbin.
ENDIF.
CLOSE DATASET filename.
‎2011 Apr 21 11:11 AM
Hi Kripaji , thnaks for reply ,
why you are usin 'SCMS_XSTRING_TO_BINARY function module in your code
In my case I am creating document using all type of file and not the only PDF , and getting document corruption error in standard transaction CV04n
‎2011 Apr 21 12:19 PM
‎2011 Apr 25 6:38 AM
I am uploading file to application server without converting it into PDF , then using bapi BAPI_DOCUMENT_CREATE2 to create document into DMS , and its working fine in development and qaulity system , but not in production
‎2011 Apr 28 8:40 AM
Hi All
any body has any that whene we write OPEN DATASET lv_file_name FOR OUTPUT IN BINARY MODE MESSAGE lv_msg
then in case of PDF file do we need to write somthing extra in open dataset command like ENCODING , CODE PAGE etc