Skip to Content
author's profile photo Former Member
Former Member

IC Manager Transporting Stuff (CRM 2007)

Hi,

Would like to ask on how can to transfer stuff like rules/policies, mail forms, alerts and IDI rules to from one box to another. Example dev -> QC -> prod?

Regards,

Marc

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Oct 15, 2012 at 06:14 PM

    Hi Marc,

    1. Mail form

    use program CRM_PML_MAIL_FORM_TRANSPORT, you need to create destination RFC first. Also you can only transport one mail form one time. I created a LSMW to transport more mail forms.

    2. alert

    tcode CRMD_IC_TRANS_ALERT

    3. IDI rule

    CRMD_ERMS_TRANS_RULE

    4. rule/policies

    please try CRM_FDT_TRANS. not 100% sure.

    Thanks,

    ZJ Kong

    Add a comment
    10|10000 characters needed characters exceeded

    • below is the method transport:

      METHOD transport.

      * *******************************************************************
      * This method transports a mail form from a source to a target system
      * via an RFC-Create call
      *
      * Steps:
      * 1. Check authorization
      * 2. Perform consistency check (customizing settings in source and
      * target system)
      * 3. Serialize mail form (read all parts of a mail form)
      * 4. Create in target system via RFC call
      *********************************************************************


      DATA:
      ls_check_data TYPE crms_pml_transp_check_data,
      lr_log TYPE REF TO cl_crm_pml_log,
      ls_adm TYPE crmt_pml_adm,
      lt_descriptions TYPE crmt_pml_descr_tab,
      lt_el_descriptions TYPE crmt_pml_descr_tab,
      lt_el_adm TYPE crmt_pml_el_adm_tab,
      lt_attachment TYPE crmt_pml_el_attachment_tab,
      lt_subject TYPE crmt_pml_el_subject_tab,
      lt_text TYPE crmt_pml_el_text_tab,
      lt_condition TYPE crmt_pml_el_condition_tab,
      lt_plist TYPE crmt_pml_plist_tab,
      lt_plist_t TYPE crmt_pml_plist_t_tab,
      lt_url_cat TYPE crmt_pml_url_cat_tab,
      lt_picture_cm TYPE crmt_pml_cm_data,
      lt_attachment_cm TYPE crmt_pml_cm_data,
      lt_loios TYPE skwf_ios,
      ls_pic_key TYPE sibflporb,
      ls_picture_cm TYPE crms_pml_cm_data,
      ls_attachment_cm TYPE crms_pml_cm_data,
      ls_attach_bo TYPE sibflporb,
      lt_doc_key TYPE skwf_ios,
      lt_attach_prop TYPE sdokproptys,
      lt_picture_prop TYPE sdokproptys,
      lt_messages TYPE bapiret2_t,
      ls_message TYPE bapiret2,
      lv_msg TYPE bapi_msg,
      lv_message TYPE bapi_msg,
      lv_authcheck_result TYPE crmt_boolean,
      lv_error TYPE crmt_boolean,
      lv_runtime_start TYPE i,
      lv_runtime_end TYPE i.

      FIELD-SYMBOLS:
      <fs_el_adm> TYPE crmt_pml_el_adm,
      <fs_attachment> TYPE crmt_pml_el_attachment,
      <fs_attach_id> TYPE skwf_io,
      <fs_property> TYPE sdokpropty,
      <fs_loio> TYPE skwf_io.

      CONSTANTS:
      lc_component TYPE dlvunit VALUE 'BBPCRM',
      lc_mail TYPE sibftypeid VALUE 'CRM_MAIL',
      lc_mail_n TYPE sibftypeid VALUE 'CRM_MAIL_N',
      lc_bo TYPE sibfcatid VALUE 'BO',
      lc_filename TYPE string VALUE 'FILE_NAME',
      lc_filesize TYPE string VALUE 'FILE_SIZE',
      lc_mimetype TYPE string VALUE 'MIME_TYPE',
      lc_extension TYPE string VALUE 'EXTENSION'.





      * Initialization ====================================================

      ev_check_failed = abap_false.
      lv_error = abap_false.
      ev_runtime = 0.

      * Prepare logging
      lr_log = cl_crm_pml_log=>get_instance( iv_guid = iv_mail_form_guid ).
      ls_message = cl_crm_pml_log=>create_bapi_message(
      iv_msgno = 158
      iv_msgid = cl_crm_pml_message=>gc_pml_msgcl
      iv_msgty = cl_crm_pml_message=>gc_info ).
      lr_log->add_bapi_message( is_message = ls_message ).
      lr_log->save( ).

      * Prepare performance measurement
      GET RUN TIME FIELD lv_runtime_start.


      * authority check for 'TRANSPORT' ===================================

      cl_crm_pml_mail_form_api=>check_authority(
      EXPORTING
      iv_transport = abap_true
      IMPORTING
      ev_allowed = lv_authcheck_result
      et_messages = et_messages ).

      * 'transport' allowed?
      IF lv_authcheck_result = abap_false.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      * Check consistency and mail form ID via RFC call ===================

      * get adminstrative data --------------------------------------------

      cl_crm_pml_mail_form_api=>read_adm_single(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      es_mail_adm = ls_adm
      et_messages = lt_messages
      EXCEPTIONS
      not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.

      * Release infos -------------------------------------------------------

      CALL FUNCTION 'DELIVERY_GET_COMPONENT_RELEASE'
      EXPORTING
      iv_compname = lc_component
      IMPORTING
      ev_compvers = ls_check_data-release
      ev_patchlvl = ls_check_data-extrelease
      EXCEPTIONS
      comp_not_found = 1
      OTHERS = 2.
      IF sy-subrc <> 0.
      * warning will be created during RFC check
      ENDIF.

      * Attribute contexts --------------------------------------------------

      SELECT *
      FROM crmc_im_scen
      INTO CORRESPONDING FIELDS OF TABLE ls_check_data-context_data. "#EC CI_NOWHERE

      * URL categories ------------------------------------------------------

      SELECT *
      FROM crmc_im_cat
      INTO CORRESPONDING FIELDS OF TABLE ls_check_data-url_cat_data. "#EC CI_NOWHERE

      * CHM content types ----------------------------------------------------

      cl_crm_chm_content_type=>crmc_chm_ctype_read_all(
      IMPORTING
      et_crmc_chm_ctype = ls_check_data-chm_ctype_data ).

      * Perform check ---------------------------------------------------------

      CALL FUNCTION 'CRM_PML_MAIL_FORM_TRANSPORT' DESTINATION iv_rfc_dest
      EXPORTING
      iv_check_only = abap_true
      iv_replace = iv_replace
      is_check_data = ls_check_data
      is_adm = ls_adm
      IMPORTING
      ev_check_failed = ev_check_failed
      ev_error = lv_error
      et_messages = et_messages
      EXCEPTIONS
      system_failure = 1 MESSAGE lv_msg
      communication_failure = 2 MESSAGE lv_msg
      OTHERS = 3.
      IF sy-subrc <> 0 OR lv_error = abap_true.
      IF lv_msg IS NOT INITIAL.
      cl_crm_pml_message=>create_message(
      EXPORTING
      iv_msgid = cl_crm_pml_message=>gc_pml_msgcl
      iv_msgty = cl_crm_pml_message=>gc_error
      iv_msgno = 157
      iv_msgv1 = lv_msg(50)
      iv_msgtxt = lv_msg
      IMPORTING
      ev_message = ls_message ).
      APPEND ls_message TO et_messages.
      ENDIF.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      IF iv_check_only = abap_true.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RETURN.
      ENDIF.



      * Serialize mail form ===============================================


      * get mail form descriptions ----------------------------------------

      cl_crm_pml_mail_form_api=>read_description(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_description = lt_descriptions
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get element data --------------------------------------------------

      cl_crm_pml_mail_form_api=>read_elements_adm(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_el_adm = lt_el_adm
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get element descriptions ------------------------------------------

      LOOP AT lt_el_adm ASSIGNING <fs_el_adm>.

      cl_crm_pml_mail_form_api=>read_description(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      iv_el_guid = <fs_el_adm>-el_guid
      IMPORTING
      et_description = lt_el_descriptions
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_el_descriptions TO lt_descriptions.
      APPEND LINES OF lt_messages TO et_messages.

      ENDLOOP.


      * get attachments ---------------------------------------------------

      cl_crm_pml_mail_form_api=>read_attachment(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_attachment = lt_attachment
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get subject contents ----------------------------------------------

      cl_crm_pml_mail_form_api=>read_subject(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_subject = lt_subject
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get text contents -------------------------------------------------

      cl_crm_pml_mail_form_api=>read_text(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      iv_with_pic_conversion = abap_false
      IMPORTING
      et_text = lt_text
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get conditions ----------------------------------------------------

      cl_crm_pml_mail_form_api=>read_condition(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_conds = lt_condition
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      wrong_parameters = 2
      not_read = 3
      OTHERS = 4 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get product list data ---------------------------------------------

      cl_crm_pml_mail_form_api=>read_plist(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_plist_t = lt_plist_t
      et_plist = lt_plist
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get URL data ------------------------------------------------------

      cl_crm_pml_mail_form_api=>read_url_cat(
      EXPORTING
      iv_mail_guid = iv_mail_form_guid
      IMPORTING
      et_url_cats = lt_url_cat
      et_messages = lt_messages
      EXCEPTIONS
      mail_not_found = 1
      not_read = 2
      OTHERS = 3 ).
      IF sy-subrc <> 0.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * get CM data -------------------------------------------------------

      * pictures

      * get all picture keys for mail form
      ls_pic_key-instid = iv_mail_form_guid.
      ls_pic_key-typeid = lc_mail.
      ls_pic_key-catid = lc_bo.

      cl_crm_documents=>get_info(
      EXPORTING
      business_object = ls_pic_key
      IMPORTING
      loios = lt_loios ).

      * retrieve content from CM
      LOOP AT lt_loios ASSIGNING <fs_loio>.

      CLEAR ls_picture_cm.
      ls_picture_cm-ref_object = iv_mail_form_guid.
      MOVE-CORRESPONDING <fs_loio> TO ls_picture_cm-key.

      cl_crm_pml_mail_form_exec=>get_attachment_doc_content(
      EXPORTING
      is_attach_id = <fs_loio>
      IMPORTING
      et_properties = lt_picture_prop
      et_attach_ascii = ls_picture_cm-content_text
      et_attach_bin = ls_picture_cm-content_bin ).

      READ TABLE lt_picture_prop WITH KEY name = lc_filename
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_picture_cm-description = <fs_property>-value.
      ENDIF.
      READ TABLE lt_picture_prop WITH KEY name = lc_filesize
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_picture_cm-size = <fs_property>-value.
      ENDIF.
      READ TABLE lt_picture_prop WITH KEY name = lc_mimetype
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_picture_cm-mimetype = <fs_property>-value.
      ENDIF.
      READ TABLE lt_picture_prop WITH KEY name = lc_extension
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_picture_cm-extension = <fs_property>-value.
      ENDIF.

      APPEND ls_picture_cm TO lt_picture_cm.

      ENDLOOP.


      * attachments

      LOOP AT lt_attachment ASSIGNING <fs_attachment>.

      ls_attach_bo-instid = <fs_attachment>-cm_instid.
      ls_attach_bo-typeid = <fs_attachment>-cm_typeid.
      ls_attach_bo-catid = <fs_attachment>-cm_catid.

      CALL METHOD cl_crm_documents=>get_info
      EXPORTING
      business_object = ls_attach_bo
      IMPORTING
      loios = lt_doc_key.

      READ TABLE lt_doc_key INDEX 1 ASSIGNING <fs_attach_id>.

      * get content + metadata
      IF sy-subrc = 0.

      CLEAR ls_attachment_cm.
      ls_attachment_cm-ref_object = <fs_attachment>-el_guid.
      MOVE-CORRESPONDING <fs_attach_id> TO ls_attachment_cm-key.

      cl_crm_pml_mail_form_exec=>get_attachment_doc_content(
      EXPORTING
      is_attach_id = <fs_attach_id>
      IMPORTING
      et_properties = lt_attach_prop
      et_attach_ascii = ls_attachment_cm-content_text
      et_attach_bin = ls_attachment_cm-content_bin ).

      READ TABLE lt_attach_prop WITH KEY name = lc_filename
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_attachment_cm-description = <fs_property>-value.
      ENDIF.
      READ TABLE lt_attach_prop WITH KEY name = lc_filesize
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_attachment_cm-size = <fs_property>-value.
      ENDIF.
      READ TABLE lt_attach_prop WITH KEY name = lc_mimetype
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_attachment_cm-mimetype = <fs_property>-value.
      ENDIF.
      READ TABLE lt_attach_prop WITH KEY name = lc_extension
      ASSIGNING <fs_property>.
      IF sy-subrc = 0.
      ls_attachment_cm-extension = <fs_property>-value.
      ENDIF.


      APPEND ls_attachment_cm TO lt_attachment_cm.

      ELSE.

      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.

      ENDIF.

      ENDLOOP.



      * Transport via RFC =================================================

      CALL FUNCTION 'CRM_PML_MAIL_FORM_TRANSPORT' DESTINATION iv_rfc_dest
      EXPORTING
      iv_check_only = abap_false
      iv_replace = iv_replace
      is_adm = ls_adm
      it_description = lt_descriptions
      it_el_adm = lt_el_adm
      it_attachment = lt_attachment
      it_subject = lt_subject
      it_text = lt_text
      it_condition = lt_condition
      it_plist = lt_plist
      it_plist_t = lt_plist_t
      it_url = lt_url_cat
      it_picture_cm = lt_picture_cm
      it_attachment_cm = lt_attachment_cm
      IMPORTING
      ev_check_failed = ev_check_failed
      ev_error = lv_error
      et_messages = lt_messages
      EXCEPTIONS
      system_failure = 1 MESSAGE lv_msg
      communication_failure = 2 MESSAGE lv_msg
      OTHERS = 3.
      IF sy-subrc <> 0 OR lv_error = abap_true.
      IF lv_msg IS NOT INITIAL.
      cl_crm_pml_message=>create_message(
      EXPORTING
      iv_msgid = cl_crm_pml_message=>gc_pml_msgcl
      iv_msgty = cl_crm_pml_message=>gc_error
      iv_msgno = 157
      iv_msgv1 = lv_msg(50)
      iv_msgtxt = lv_msg
      IMPORTING
      ev_message = ls_message ).
      APPEND ls_message TO et_messages.
      ENDIF.
      APPEND LINES OF lt_messages TO et_messages.
      lr_log->add_bapi_messages( it_messages = et_messages ).
      lr_log->save( ).
      RAISE not_transported.
      ENDIF.

      APPEND LINES OF lt_messages TO et_messages.


      * Performance measurement
      GET RUN TIME FIELD lv_runtime_end.
      ev_runtime = ( lv_runtime_end - lv_runtime_start ) / 1000.

      * Save log
      lr_log->add_bapi_messages( it_messages = et_messages ).
      CLEAR lv_msg.
      MESSAGE ID cl_crm_pml_mail_form_api=>gc_msg_id
      TYPE cl_crm_pml_message=>gc_info
      NUMBER 156 WITH ls_adm-mail_id ev_runtime
      INTO lv_msg.
      lr_log->add_sy_message( iv_detail_level = cl_crm_pml_log=>gc_log_all ).
      lr_log->save( ).

      ENDMETHOD.

      Hope this will work for you!

      Thanks,

      ZJ Kong

  • Posted on Oct 25, 2013 at 04:33 PM

    Hello,

    I’ve just published this blog with some collected info on
    transporting Mail Forms.

    http://scn.sap.com/people/john.burton/blog/2013/10/25/using-the-new-crm-70-ehp1-mail-form-transport-feature

    Best regards,

    John

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.