on 04-18-2011 3:54 AM
Hi experts !!
I have a problem with this Bapi "BAPI_DOCUMENT_CREATE2". I can attach a file manually in CV01N.But when i try to attach a file using this BAPI - file not getting store.Following is my code,
ls_doc-documenttype = 'DRW'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'WR'.
ls_doc-laboratory = '001'.
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'KPRO'.
lt_files-docfile = 'C:\temp\Documents and Settings\anuvidhya.t\anu.doc'."'c:\temp\drawing.txt'.
lt_files-wsapplication = 'WRD'."'TXT'.
APPEND lt_files.
CLEAR lt_drat.
REFRESH lt_drat.
lt_drat-language = 'EN'.
lt_drat-description = 'Testing document from bapi'.
APPEND lt_drat.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING documentdata = ls_doc
IMPORTING documenttype = lf_doctype
documentnumber = lf_docnumber
documentpart = lf_docpart
documentversion = lf_docversion
return = ls_return
TABLES documentdescriptions = lt_drat
documentfiles = lt_files.
Thanks in advance,
Regards,
Anu.
Hi Anu/Surjit Bawa
Have you been successful in uploading a document using JAVA.
I am trying to send document from external DMS system into SAP DMS using SAP JCo
I can create DIR in SAP but not sure which JAVA API to use to insert doc.
JCoStructure importStructure =function.getImportParameterList().getStructure("DOCUMENTDATA")
importStructure.setValue("DOCFILE","file location")
If I am following example in ABAP.
However in ABAP,it_files, takes the path of the file location and adds the file into SAP system
Whereas JAVA it is only sets the value.
However in JAVA we can pass byte array of the document.Will that work if I pass byte array of the document?.
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Anu,
based on the provided sample data for the BAPI I would kindly ask you to try with the following values:
ls_doc-documenttype = 'DRW'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'WR'.
ls_doc-laboratory = '001'.
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'DMS_C1_ST'.
lt_files-docfile = 'C:\temp\Documents and Settings\anuvidhya.t\anu.doc'.
lt_files-wsapplication = 'WRD'.
APPEND lt_files.
CLEAR lt_drat.
REFRESH lt_drat.
lt_drat-language = 'EN'.
lt_drat-description = 'Testing document from bapi'.
APPEND lt_drat.
Regarding the lt_files table you have to made sure that for each original you want to add a separate line has to be appended.
For further information on the BAPI behavior please see SAP note 766277 where you will find a detailed documentation on all DMS BAPIs in the attachment list.
Best regards,
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christoph,
Thanks for ur reply.I had solved this issue by below changes,
ls_doc-originaltype = '001'.
lt_files-storagecategory = 'SAP-SYSTEM'.
Now everything is working fine is SAP server,but when i call it from JAVA server values are comming
but document has not created.Is any value need to pass in BAPI(specialy for calling from JAVA)??
Regards,
Anu.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.