on 10-20-2004 2:06 PM
Hi all!
want to edit DMS document info records (as in cv04n - add, del files) without deleting original DIR -> Version management of DIRs.
I use the following BAPI scenario:
- BAPI_DOCUMENT_GETACTVERSION (get the highest version of a DIR)
- BAPI_DOCUMENT_GETDETAIL2 (to get the object links of the DIR)
- BAPI_DOCUMENT_CREATENEWVRS2 (create a new version of the DIR, copyoriginals = X, object links are copied as well)
- again BAPI_DOCUMENT_GETACTVERSION (get this new version number)
- again BAPI_DOCUMENT_GETDETAIL2 to get the files of the new version DIR)
- to delete single files, i change the file record of the files table ( set deletevalue = X).
- then BAPI_DOCUMENT_CHANGE2 as suggested in a nother thread of mine by 2 community members.
the latest step runs for version = 00, but when having a version gt 00, the bapi_document_change2 returns : "original is already checked in and stored".
also i checked the ph_objid and lo_objid (the ids are the same for Version n and n+1), which might be the reason for the error mentioned above.
i can't find any solution.
thanks for replies in advance,
Christoph
Hi all!
got the solution: - finally !!!
Problem:
you want to edit Document info records - using a new version of this DIR. in the new version it is possible to add and delete files.
Solution:
- CALL FUNCTION 'BAPI_DOCUMENT_GETACTVERSION'
and get the actual hightest version of the DIR
- ls_objtype-OBJECTTYPE = '*'.
append ls_objtype to myobjectlinks. to be able to copy all the objectlinks of the DIR.
- lv_dokvr_new = lv_dokvr_ref + 1. - increment the DIR version number
- CALL FUNCTION 'BAPI_DOCUMENT_CREATENEWVRS2 to create a new version of the DIR.
- * get again the actual version
CALL FUNCTION 'BAPI_DOCUMENT_GETACTVERSION'
- * get files of the new version
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
- * set the delete flag for those you want to delete in the table documentfiles.
- CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
IMPORTANT ***
!!! transfer O N L Y the files you want to delete O R transfer all files but C L E A R the STORAGE_CATEGORY field !!!
any questions? feel free to ask...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christoph,
BAPI_DOCUMENT_CREATENEWVRS2 delivers a new version (gt 00)
- your latest step ( BAPI_DOCUMENT_CHANGE2 ) must run for this new version gt 00.
Regards
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
that is exactly what I'm doing. But when i call the bapi, the return structure is set: "Original has already been checked in and stored."
I think the problem is located in the combination of the BAPI_DOCUMENT_CREATENEWVRS2 and BAPI_DOCUMENT_CHANGE2.
It seems that the files are not really copied by the first bapi. but in the cv04n, the new version is editable and files can be deleted. (???)
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
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.