How To Copy Document With CRM Actions

Here is a simple code to demonstrate how to copy a document using CRM actions.

In the action method we implemented, we first declare the variables we are going to use

  DATA: lc_action_execute   TYPE REF TO cl_action_execute.

  DATA: lv_guid_ref         TYPE crmt_object_guid,
        lv_actionname       TYPE ppfdtt,
        lv_actiontext       TYPE ppfdttt.

 

Next we get the information of the reference document using action object

  CREATE OBJECT lc_action_execute.

*  get parameter from reference object
*  ------------------------------------------------------------------
  CALL METHOD lc_action_execute->get_ref_object
    EXPORTING
      io_appl_object = io_appl_object
      ip_action      = ip_action
      ip_preview     = ip_preview
      ii_container   = ii_container
    IMPORTING
      ev_guid_ref    = lv_guid_ref
      ev_actionname  = lv_actionname
      ev_actiontext  = lv_actiontext.

 

Then we prepare action text

*  prepare text for copy
*  ------------------------------------------------------------------
  CALL METHOD lc_action_execute->prepare_actiontext
    EXPORTING
      iv_guid_ref   = lv_guid_ref
      iv_actionname = lv_actionname.

 

Finally we are ready to copy the reference document

*  copy document
*  ------------------------------------------------------------------
  CALL METHOD lc_action_execute->copy_document
    EXPORTING
      io_appl_object     = io_appl_object
      ip_application_log = ip_application_log
      ip_action          = ip_action
      ip_preview         = ip_preview
      ii_container       = ii_container
      iv_actiontext      = lv_actiontext
    IMPORTING
      rp_status          = rp_status.

 

ABOUT Furkan Sönmez

www.linkedin.com/profile/view?id=122521475

RELATED POSTS

COMMENTS

comments powered by Disqus