Automated creation of follow-up transactions. How to use and enhance COPY_DOCUMENT?

To create follow-up documents automatically from a business transaction we can use a ppf action with method COPY_DOCUMENT.

We have to use the parameter „process_type“ to specify to transaction type.

The title of the ppf action will be taken over as description of the follow-up transaction. There is no way to deactivate this feature except the title of the ppf action will be left empty. Then it depends on the copy control what will happen, mostly description of the predecessor transaction will be transferred then. If we always want to take over description from predecessor transaction, we have to de-comment line/parameter iv_actiontext on call of lc_action_execute->copy_document in PPF method COPY_DOCUMENT (BADI Def. EXEC_METHODCALL_PPF -> BADI Impl. COPY_DOCUMENT -> Method EXECUTE). Either via modification or via copy, past and adjust.

The long text of the ppf action can be transferred to a text type of the follow-up document. If we want to do this, we just need to configure and use a text determination access sequences using function module CRM_REFERENCE_TEXT_GET (ref object and ref text type can be left empty in customizing).

If we want to set some more values (i.e. priority, category, …), we have to put these static values in the ppf action container like parameter process_type. We also have to enhance method copy_document of class cl_action_execute to transfer these data to the follow-up document. There is currently no standard solution to default/transfer some data to the follow-up document.

If we want to set a partner for a specific partner function we should do it using partner determination or BRF+ based on a field which is already defaulted using solution mentioned above (i.e. category). We should never try to default a partner by the follow-up creation routine itself because the partner number will be different in different systems and the assignment rule might change very often.

The copy control is per default active for the follow-up creation, which means that data can be overtaken from the current transaction to the follow-up transaction.

Unfortunately there is currently no way to create a follow-up based on a template transaction. Only SAP CRM Service is using such a feature for Service Plans (we can have a look at ppf action method CREATE_ORDER_SRVPLAN and transaction CRMD_SERV_CYCLE). However, this solution is specific for this use case only and cannot be used for other use cases as well.

For a lot of use cases COPY_DOCUMENT (with the mentioned extensions) will be sufficient to implement the requirements. However there exist some other ppf action methods which handles items and document flow in a different way. If we want to use/copy items we should try COPY_DEF_ITEMS (create follow-up and copy items), COPY_ITEM_LOCAL (create/copy items in a transaction locally) and COPY_ITEM_TO_TASK (create follow-up transaction with current item as predecessor).