on 12-09-2010 6:45 AM
Hello,
When i click on a link, which can show the stored document in DMS, what are the BAPIs called, is it BAPI_DOCUMENT_GETDETAIL2 only or along with it is der any other bapi that will load the document from DMS to portal.
I see that BAPI_DOCUMENT_GETDETAIL2 gives the details of file like storage catagory, file path etc..but it is not fetching the file, Please correct me if i am wrong.
Thanks,
Kishore.
Hi Kishore,
Please follow the steps to Download a file from DMS or Display in Browser.
1. Call BAPI u2018BAPI_DOCUMENT_GETDETAIL2u2032
call function u2018BAPI_DOCUMENT_GETDETAIL2u2032
exporting
documenttype = document_key-doctype
documentnumber = document_key-docnumber
documentpart = document_key-docpart
documentversion = document_key-docversion
getcomponents = u2018Xu2019
getdocdescriptions = u2018Xu2019
getdocfiles = u2018Xu2019
getclassification = u2018Xu2019
importing
documentdata = documentdata
return = lv_return
tables
documentdescriptions = it_documentdescriptions
documentfiles = it_documentfiles
characteristicvalues = it_characteristicvalues
classallocations = it_classallocations.
2. Then call BAPI_DOCUMENT_CHECKOUTVIEW2
documentfile-wsapplication = it_documentfiles-wsapplication.
call function u2018BAPI_DOCUMENT_CHECKOUTVIEW2u2032
exporting
documenttype = document_key-doctype
documentnumber = document_key-docnumber
documentpart = document_key-docpart
documentversion = document_key-docversion
documentfile = documentfile
getstructure = u20181u2032
getheader = u2018Xu2019
pf_ftp_dest = u2018SAPFTPAu2019
importing
return = lv_return
tables
documentfiles = it_co_documentfiles.
You need to pass PF_FTP_DEST as SAPFTPA as we are calling this FM from Browser not SAP GUI and if you dont pass this value then the FM errors out because it doesnu2019t find SAP GUI.
3. Now call SCMS_DOC_READ to get the Binary Data of the File.
call function u2018SCMS_DOC_READu2019
exporting
mandt = sy-mandt
stor_cat = c_storage
doc_id = it_co_documentfiles-file_id
tables
access_info = lt_access
content_bin = lt_sdokcntbin.
IT_SDOKCNTBIN is the Binary Data Table of the file you want to download.
Now you have the binary file data which you can write on Application Server or Convert it to XSTRING and show in a web dynpro application. I am not sure how to display in BSP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.