Online Tutorials & Training Materials | STechies.com
Register Login

CRM_COPY_BADI method is not called while creating follow-up transaction

|| || 2

CRM_COPY_BADI method is not called while creating follow-up transaction
Stechies

Crmv_Event

Hi SAP Experts,

CRM_COPY_BADI is having a method for each object, e.g. DOC_FLOW. While implementing the z implementation and assigning it to the copy routine in copying control customizing. But, the CRM_COPY_BADI method is not called while creating follow-up transaction.


Comments

  • Nitesh Singh
    13 Sep 2016 12:43 pm

    To solve this issue you may have to follow the instructions for DOC_FLOW for other objects.

    1.First, check copy routine and assign the z CRM_COPY_BADI to copy control for item category or transaction types

    2.And then check if the CRM_COPY_BADI method is called in corresponding to CRM_<OBJECT>_COPY_EC

    if the CRM_COPY_BADI method is called in corresponding to CRM_<OBJECT>_COPY_EC then check if CRM_<OBJECT>_COPY_EC is maintained in CRMV_EVENT. And if it is not maintained in CRMV_EVENT, then maintain event for this FM like the others.

    But if the method is not called in corresponding CRM_<OBJECT>_COPY_EC for ex DOC_FLOW then:

    • Replace CRM_DOC_FLOW_COPY_EC by creating ZCRM_DOC_FLOW_COPY_EC FM
    • After creating FM ZCRM_DOC_FLOW_COPY_EC code your logic in it simply by filling it with standard code from standard CRM_DOC_FLOW_COPY_EC.
    • Call DOC_FLOW before CRM_DOC_FLOW_MAINTAIN_OW in ZCRM_DOC_FLOW_COPY_EC. For example: CRM_ACTIVITY_H_COPY_EC 
    • Now maintain event for ZCRM_DOC_FLOW_COPY_EC.
    • Run tcode CRMV_EVENT.
    • Find a event for FM CRM_DOC_FLOW_COPY_EC and replace it with ZCRM_DOC_FLOW_COPY_EC.
    • At last, Save all changes 
  • 13 Sep 2016 12:39 pm

    Due to z implementation assigned to copy routine, therefore only z implementation is called during copying. While the other implementations are not called.
    In CRM_COPY_BADI the method for each object is basically called in corresponding to FM CRM_<OBJECT>_COPY_EC. Therefore FM CRM_<OBJECT>_COPY_EC must be maintained in CRMV_EVENT, published and executed properly when copying as an event call.

    However, not all the methods of CRM_COPY_BADI are called in standard logic. For example DOC_FLOW. RM_DOC_FLOW_COPY_EC does not call the method DOC_FLOW in CRM_COPY_BADI because it is not needed to copy old doc flow from the predecessor to the successor. Therefore, in this condition DOC_FLOW is not called by CRM_COPY_BADI.

Related Articles