‎2006 Feb 03 8:17 AM
Hi,
can anybody tell me, how to export a file (e.g. a picture) <b>from KPRO to local file-system</b>. The file i want is element of the filelist of a DVS (DIS)
Problem is - i have to use an outstanding report and (as far as i know) can't use HTTP-response. Also, the download should work automatically in background and save the file to defined path.
There is a FM CV120_DOC_CHECKOUT_TO_CLIENT that looks right, but i can't get it work.
Also i have the requirement to get a link for the file in KPRO, wich i can later use to build html img-tags with this source. I used BAPI_DOCUMENT_GET_DETAIL2 and get the filelist (with file_id). I also tried CV120_KPRO_MASTER_DATA_GET to get file_id. Both works well, but when i try to get the url by calling the FM CV120_KPRO_CHECKOUT_TO_URL the function SCMS_URL_GENERATE raise "sdoki_subrc_bad_stor_cat" and later on handle the error as "no_content".
<b>Most important is to get the file to local folder.</b>
Thx for every answer.
‎2006 Feb 03 12:28 PM
Hi Thomas,
First I use FM "CVAPI_DOC_GETDETAIL" to get a list of files which are connected to the DIS. Then FM "CV120_DOC_CHECKOUT_VIEW" to copy files from kpro to application server.
Here my codeing:
clear st_def.
st_def-kpro_use = 'X'.
st_def-comp_get = 'X'.
st_def-content_provide = 'SRV'.
clear st_doc_file.
st_doc_file-langu = it_pool-langu.
t_dappl = it_pool-dappl.
translate t_dappl to lower case.
concatenate path_daten1 it_pool-description '.' t_dappl
into st_doc_file-filename.
st_doc_file-dappl = it_pool-dappl.
clear st_phio.
select single protected from dms_phio2file
into st_phio-protected
where file_id = it_pool-file_id.
st_phio-lo_objid = it_pool-lo_objid.
st_phio-ph_objid = it_pool-ph_objid.
st_phio-langu = it_pool-langu.
st_phio-filename = it_pool-filename.
st_phio-file_id = it_pool-file_id.
st_phio-storage_cat = it_pool-storage_cat.
st_phio-created_by = it_pool-created_by.
st_phio-created_at = it_pool-created_at.
st_phio-changed_by = it_pool-changed_by.
st_phio-changed_at = it_pool-changed_at.
clear st_frontend.
call function 'CV_GET_FRONTEND_TYPE'
importing
pf_frontend_type = st_frontend-frontend_type
pf_hostname = st_frontend-hostname
pf_winsys = st_frontend-winsys.
call function 'CV120_DOC_CHECKOUT_VIEW'
exporting
ps_cout_def = st_def
ps_doc_file = st_doc_file
ps_draw = st_draw
ps_phio = st_phio
ps_frontend = st_frontend
exceptions
error = 1
others = 2.
Regards,
martin
‎2006 Feb 03 1:41 PM
OK, very interesting to see how to fill all the structures.
Some (newbie-) questions left:
it_pool seems to be a structure of file list, right?
What about st_def-content_provide? Is 'SRV' a specific value in your case? how can i find out, what i have to take.
Last question:
Where's the right place to define LOCAL Path (e.g. C:\xyz\) I wont check out to appliation server.
‎2006 Feb 03 2:42 PM
Now, i tried your coding and it works "nearly" fine.
I get a strange hostname (iuEZxaeu#*ae#w#i#w-I) while using the FM for frontend type. It works the first time and than - never again.
Also found the part of coding where i can enter the path
Will debug this next week.