‎2011 Sep 05 1:47 PM
Hi Experts,
i am trying to get the content of a file which i created with transaction cv02n.
Code:
CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW'
EXPORTING
PF_DOKAR = lv_doctype
PF_DOKNR = lv_docnumber
PF_DOKVR = lv_docversion
PF_DOKTL = lv_docpart
* PF_FTP_DEST = ' '
* PF_HTTP_DEST = ' '
* PF_HOSTNAME = ' '
PF_CONTENT_PROVIDE = 'TBL'
* PS_API_CONTROL =
* PF_STD_URL = 'X'
IMPORTING
PSX_MESSAGE = ls_mes
PSX_DRAW = ls_draw
TABLES
PT_FILES = lt_pt_files
PTX_COMPONENTS = lt_components
PTX_CONTENT = lt_content
.ls_draw shows the right result, but lt_pt_files, lt_content and lt_components are empty. ls_mes shows no errors.
Can someone help me?
‎2011 Sep 06 7:53 AM
Hi,
Try with the BAPI 'BAPI_DOCUMENT_GETDETAIL2'
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = current_dokar
documentnumber = current_doknr
documentpart = current_doktl
documentversion = current_dokvr
getobjectlinks = c_charx
getclassification = c_charx
IMPORTING
* DOCUMENTDATA =
return = wa_return
TABLES
objectlinks = objectlinks_tab. " this table will have the details which you are looking.
* DOCUMENTFILES = DOCUMENTFILES_tab.
* classallocations = clas_alloc_tab
* characteristicvalues = characteristicvalues_tab.Check for other Tables paramaters in this BAPI.
Thanks and Regard
Bala Krishna P
‎2011 Sep 05 4:02 PM
Hi
Try using BAPI_DOCUMENT_CHECKOUTVIEW or BAPI_DOCUMENT_CHECKOUTVIEW2.
Shiva
‎2011 Sep 05 4:24 PM
Hi Daniel,
Check with that bapi as Shiva suggested.
Regards,
Madhu.
‎2011 Sep 06 7:19 AM
BAPI_DOCUMENT_CHECKOUTVIEW2 works, I can download the file to my local computer. But I want to have the file content in a table, and that doesn't work
‎2011 Sep 06 7:53 AM
Hi,
Try with the BAPI 'BAPI_DOCUMENT_GETDETAIL2'
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = current_dokar
documentnumber = current_doknr
documentpart = current_doktl
documentversion = current_dokvr
getobjectlinks = c_charx
getclassification = c_charx
IMPORTING
* DOCUMENTDATA =
return = wa_return
TABLES
objectlinks = objectlinks_tab. " this table will have the details which you are looking.
* DOCUMENTFILES = DOCUMENTFILES_tab.
* classallocations = clas_alloc_tab
* characteristicvalues = characteristicvalues_tab.Check for other Tables paramaters in this BAPI.
Thanks and Regard
Bala Krishna P
‎2011 Sep 06 8:01 AM
I tried bapi_get_detail2l. The table objectlinks is empty, documentdescriptions has 1 entry, documentfile has 1 entry ans statuslog 20. The rest is empty
‎2011 Sep 06 8:21 AM
Hi,
Just check the Created Document in CV03N transaction and click on the Originals tab, do this DIR have any originals attached to it?
Thanks & Regards
Bala Krishna P
‎2011 Sep 06 8:23 AM
The Table looks like:
Appl: WWI
Description: Winword 6.0
Category: SAP-SYSTEM
Name: r000124.rtf
‎2011 Sep 06 8:36 AM
Hi,
The file content of the .rtf extension will be in binary format, in order to get that into an internal table, you need to use the BAPI_DOCUMENT_GETDETAIL2 and Loop the table DOCUMENTFILES which is returned from the above BAPI, in that loop use the FM 'SCMS_R3DB_GET'.
CALL FUNCTION 'SCMS_R3DB_GET'
EXPORTING
* MANDT = SY-MANDT
crep_id = v_crep_id " documentfiles-storagecategory
doc_id = v_doc_id " documentfiles-file_id
* PHIO_ID =
comp_id = v_comp_id " split the documentfiles-docfile at '\' and use the last field value filename
IMPORTING
comp_size = lv_comp_size
binary_flg = lv_binary_flg
mimetype = lv_mimetype
TABLES
data_txt = li_content_txt
data_bin = li_content_bin " File in binary in internal table.
EXCEPTIONS
error_import = 1
error_config = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Thanks & Regards
Bala Krishna P
‎2011 Sep 06 8:54 AM
I get the error "Content repository SAP-SYSTEM does not have storage type R/3 database".
‎2011 Sep 06 10:06 AM
Can you post a entry from table DOCUMENTFILES, which is returned by the BAPI. Post only below field entries.
DOCUMENTFILES-STORAGECATEGORY
DOCUMENTFILES-DOCFILE
‎2011 Sep 06 10:17 AM
DOCUMENTFILES-STORAGECATEGORY = SAP-SYSTEM
DOCUMENTFILES-DOCFILE = r0000124.rtf
‎2011 Sep 07 2:16 AM
Hi,
Just check what is the Storage catogory in the transaction CV03N by openning the DIR, clicking on the tab 'Document Data'. Now go to Transaction OAC0, and see what is the Content repository value for DMS. In our system it is configured as first 6 characters of the value of Storage Catogery.
So it will be similar to SAP-SY in your case, the value of crep_id = documentfiles-storagecategory+0(6) in the FM 'SCMS_R3DB_GET'.
Just test with above changes and also create another DIR and test, as you have used CHECKOUT function modules for the DIR, the document file might not be active.
Thanks & Regards
Bala Krishna.