!--a11y-->
IDoc Copy Management 
The outbound IDocs (for example, POS outbound IDocs and assortment list IDocs) from many stores are identical or only differ very slightly. This means that you do not have to generate outbound IDocs for all stores but just for certain reference stores. You can then copy their outbound IDocs, according to certain rules, from the existing outbound IDocs. This can significantly improve performance.
In addition, you can use IDoc copy management as a one-off, for example, for the initial supply of a new store, if the stores can be grouped and a reference store can be determined for each group, whose IDocs can then be copied to the other stores in the group.
You can use IDoc copy management for all applications that generate outbound IDocs, which the SAP system sends to file ports.
It makes sense to schedule the program for regular execution in the background.
· There must be a copy rule in the SAP system.
· A programming interface port must be assigned to the reference recipient. Define an ABAP programming interface port in the port description (IDoc and EDI basis) and assign it to the function module WDL_COPY_LOG.
· File ports must be assigned to the recipients of the copies.
· All recipients that are assigned to a reference must be assigned to one and the same file port.
· The partner profiles for the recipients must be maintained in such a way that IDocs are collected first. The IDoc copy management tool sends the IDocs automatically.
· In the partner profile for the reference recipient, you must specify that the IDocs are sent immediately by the application. Otherwise, they have to be sent manually after the reference IDocs have been generated.
Various applications generate outbound IDocs for the reference recipients. Using the programming interface port, which is assigned to each reference customer within the partner profile, the SAP system logs these reference IDocs in table WDLCOPY. The IDoc copy management tool uses this log.
Program RWDLCOPY_MANAGE copies the reference IDocs to the recipients (customers) that are assigned to it using the copy rule. It then generates trigger files for the individual recipients for each message type if this is set in the copy rule.
The tool optimizes its performance internally using asynchronous processes. Multiple scheduling is therefore not recommended.
As an alternative to the actual copy rule, a consistency check is also possible. The program will issue a list of violations against the prerequisites cited above.
You can use a BAdI to adjust the IDoc control records and IDoc data records for each specific recipient. To do this, you can carry out an implementation for the BAdI definition IDOC_COPY_MANAGE using the BAdI Builder. You can find the BAdI for modifying outbound IDocs in the IMG for Sales under POS Interface Outbound.
If there is no implementation, the program copies the IDoc data records unchanged from the reference IDoc and simply replaces the reference recipient with the actual customer in the control record.
It makes sense to implement or modify the data records if individual IDoc segments or fields have to be adjusted for particular customers. Note that only the IDocs for the reference recipient are available for the BAdI. You can have these modified in the BAdI.
The SAP system stores the log data required for correct operation in tables WDLCOPY and WDLCOPYLOG. You should reorganize these regularly. The program then deletes entries that it no longer requires.
The IDoc copy management tool provides two options for reorganization:
· Reorganization by status
The program only deletes records whose status indicates that they have been executed correctly and that the IDoc copy management tool no longer requires.
· Reorganization by date
The program deletes all records that are older than the relevant creation date or copy date. The program does not perform a status check. This reorganization option can sometimes lead to the loss of data that may be required subsequently.
We recommend that you reorganize by status.
...
1. Define a copy rule using transaction WDL_COPY_FILL.
2. Start the IDoc copy management tool using transaction WDL_COPY.
3. Perform a consistency check and observe the problem descriptions that are displayed.
4. Run IDoc copy management or schedule it at regular intervals in the background as program RWDLCOPY_MANAGE.
5. Reorganize your data regularly, for example, once a month. To do this, plan the relevant variant of the program to be executed in the background.
You have 30 stores, 10 of which have very similar or identical assortment list versions. You now want to supply all 30 stores using the full version of the assortment list.
In this case, define three stores as reference recipients in the copy rule and the nine similar stores for each as recipients. You can use the BAdI to make any changes that are necessary to the reference data (for example, prices).
Schedule assortment list generation for the three reference recipients only and ensure to schedule IDoc copy management to begin upon completion of assortment list generation.
