on 10-07-2010 1:11 PM
Hi,
I want to get the list of folders and documents related to a Project in hierarchial fashion.
I tried using the BAPI's --- BAPI_BUS2172_FOLDER_GET_DETAIL and BAPI_BUS2172_DOCUMT_GET_DETAIL and got the list of documents and folders of a project seperately.
But I couldn't find any link between folders and documents.
Please try to help me out in finding the BAPI or Class that returns the hierarchy of folders and documents of a project.
Thanks in advance.
Regards
Navas
Navas,
You may use classes to achive this. Please perform the following steps.
1. Read the DPR_PROJECT table to get the cProject GUID.
SELECT SINGLE * FROM dpr_project INTO l_proj WHERE project_id = iv_external_id.
2. Get the instance of cProject Object Manager.
l_obj_mngr = cl_dpr_appl_object_manager=>get_instance( ).
3. Load Project using load_projects method of object manager.
l_obj_mngr->load_projects( EXPORTING iv_guid = l_proj-guid IMPORTING et_projects = lt_projects ).
READ TABLE lt_projects INTO ls_projects INDEX 1.
l_project = ls_projects-reference.
4. Get documents at cProject header level by reading global attribute of cProject object.
lt_cl_documents = l_project->mr_documents.
lt_documents = lt_cl_documents->get_all( ).
5. Loop on documents and get associated EDMS document object. EDMS document object has method to determine if the given document is a folder or document and who is the parent of given document. That's how you may build hierarchy.
LOOP AT lt_documents INTO l_document.
*------Get Easy DMS document
l_edms_doc = l_document->get_edms_document( ).
"NADK901294
*------Get EDMS attribute
l_folder = l_edms_doc->IS_FOLDER( ).
l_parent = edmsdoc->get_parent( ).
-
-
Endloop.
Edited by: Sharad Agrawal on Oct 29, 2010 9:45 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Navas,
Each folder or document should have a component in the structure that will specify its parent. You can use this to build the hierarchy.
For example, if there are 2 document under a folder and the Document ID of the folder is 00001. Then the Parent ID of the 2 documents will also be 00001. If a document lies under the root node, then the Parent ID will be blank.
Please try this out and let me know if you face any concerns.
Best Regards,
Prashanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.