cancel
Showing results for 
Search instead for 
Did you mean: 

FOLDERCOPY creates links, not new duplicates

Former Member
0 Kudos

Hi,

The BAdI EASYDMS_MAIN01-FOLDERCOPY only creates links to the folders/files it is copying from.

Is it possible to have actual new duplicated folders/files in the destination?

Thks,

William

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi William,

basically I only copied the children table and loop at it, simply following the OSS note, creating too many folders in the process and without a new document ID for the children.

Of course there are unnecessary steps here, but I only wanted a quick first implementation showing some results before turning to the main programming starting at monday. I still need to find out the best way to set a new document ID to the additional folders.

Here is my code fragment of resetting iv_parentfolder, iv_destfolder and iv_sourcefolder. ...SAP Note Code... represents the coding in the SAP Note.

Thanks

Frank

...SAP Note Code...

* Creating real folders for all children, looping at another children table

LOOP AT lt_children_hilfe INTO ls_child_hilfe.

iv_parentfolder-documenttype = iv_sourcefolder-documenttype.
iv_parentfolder-documentnumber = iv_sourcefolder-documentnumber.
iv_parentfolder-documentpart = iv_sourcefolder-documentpart.
iv_parentfolder-documentversion = iv_sourcefolder-documentversion.

iv_destfolder-documenttype =   iv_sourcefolder-documenttype.
iv_destfolder-documentnumber =  iv_sourcefolder-documentnumber.
iv_destfolder-documentpart = iv_sourcefolder-documentpart.
iv_destfolder-documentversion = iv_sourcefolder-documentversion.

iv_sourcefolder-documenttype = ls_child_hilfe-documenttype.
iv_sourcefolder-documentnumber = ls_child_hilfe-documentnumber.
iv_sourcefolder-documentpart = ls_child_hilfe-documentpart.
iv_sourcefolder-documentversion = ls_child_hilfe-documentversion.

...SAP Note Code...

Edited by: FrankSchmidt2 on May 20, 2011 3:43 PM

Former Member
0 Kudos

Hi William,

might I humbly request some information about the involved solution?

Currently I'm trying to implement the mentioned SAP note mentioned before to copy all documents in the original folder as new documents. First steps reveal that I'm able to copy the documents, but there are still some issues with the correct usage of the parent-,source- and destination-structures, I create too many folders.

More importantly, I cannot find an easy way (is there ever an easy way in programming, which is not a bad one?) to create a new document ID, the copied folders have the same ID as the original ones.

Best Regards

Frank

Former Member
0 Kudos

Hi Frank,

Would you like to post what you have coded already and I'll have a look? As mentioned, the OSS note doesn't work for creating duplicates in it's current form even with the suggestions made in the note! 😛

William

Former Member
0 Kudos

Hi, experts,

This is the question that I have been searching for answer for few months. We implemented SAP note 694471, an enchanced function module Z_EASYDMS_FOLDER_COPY of Easy DMS. But it copied those children folders as links, only top folder is created as new. It makes an issue as all DIR searching result link back to one original folder.

So what we want is those new copied folders should be created with new document numbers. In this sap note, it mentioned function module BAPI_DOCUMENT_CREATEFROMSRC2 should be used if all children folders should be copied as new documents. Could somebody give some more details on this? It is very appreciated.

Best regards

Ping

Former Member
0 Kudos

Hi Ping,

After many hours I've finally got it to work! That OSS note is too vague and it leaves out a number of small but important steps!

I'm copying a folder (right-click > copy), and pasteing it as a new folder. All the documents in the original folder are being copied as new documents (new document numbers) into the new folder. Is this what you are also trying to do? if so I'll send you the code.

I'm using the BAPI rather than the function module by the way, but that shouldn't make any difference.

Rgds,

William