使用代码获得所有适用于创建的transaction type

Created by Jerry Wang on Feb 17, 2015

使用代码获得如下process type popup dialog里的entry:
使用代码获得所有适用于创建的transaction type_第1张图片
执行如下report:

REPORT z.
INCLUDE: crm_object_types_con.
DATA: lv_title        TYPE string,
      lr_context_node TYPE REF TO cl_bsp_wd_context_node,
      ls_struct_data  TYPE crmst_followup_proc_type,
      ls_struct_ref   TYPE REF TO crmst_followup_proc_type.
DATA: lv_bus_category       TYPE crmt_subobject_category VALUE gc_object_type-sales.
DATA: lt_proc_types         TYPE crmt_followup_proc_type_tab.
DATA: lr_proc_types_crm     TYPE REF TO if_bol_bo_col.
DATA: lv_quotations_only    TYPE crmt_boolean .
DATA: lr_access             TYPE REF TO if_crm_uiu_bt_channel_aspects.
DATA: ls_attribute          TYPE CRMST_FOLLOWUP_PROC_TYPE.
SET PARAMETER ID 'CRM_UI_PROFILE' FIELD 'TPM_PRO'.
CREATE OBJECT lr_proc_types_crm
  TYPE cl_crm_bol_bo_col.
lr_access = cl_crm_uiu_bt_channel_asp_fac=>get_instance( ).
* Sales
CLEAR lv_quotations_only.
lr_access->get_proctypes_for_create(
  EXPORTING
    iv_bus_category         = lv_bus_category
    iv_quotation_only       = space
    iv_template_only        = space
    iv_activity_screen_type = space
    iv_mixed_quot_order     = space
  IMPORTING
    et_proc_types           = lt_proc_types
  CHANGING
    cr_proc_types           = lr_proc_types_crm ).
* Quotation
lv_quotations_only = abap_true.
lr_access->get_proctypes_for_create(
  EXPORTING
    iv_bus_category         = lv_bus_category
    iv_quotation_only       = lv_quotations_only
    iv_template_only        = space
    iv_activity_screen_type = space
    iv_mixed_quot_order     = space
  IMPORTING
    et_proc_types           = lt_proc_types
  CHANGING
    cr_proc_types           = lr_proc_types_crm ).
* Service
CLEAR lv_quotations_only.
lr_access->get_proctypes_for_create(
  EXPORTING
    iv_bus_category         = gc_object_type-service
    iv_quotation_only       = space
    iv_template_only        = space
    iv_activity_screen_type = space
    iv_mixed_quot_order     = space
  IMPORTING
    et_proc_types           = lt_proc_types
  CHANGING
    cr_proc_types           = lr_proc_types_crm ).
* Service Quotation
lv_quotations_only = abap_true.
lr_access->get_proctypes_for_create(
  EXPORTING
    iv_bus_category         = gc_object_type-service
    iv_quotation_only       = lv_quotations_only
    iv_template_only        = space
    iv_activity_screen_type = space
    iv_mixed_quot_order     = space
  IMPORTING
    et_proc_types           = lt_proc_types
  CHANGING
    cr_proc_types           = lr_proc_types_crm ).
****************************************************************************
*     Get the process types of the ERP system
****************************************************************************
CALL METHOD cl_crm_uiu_erp_order_tools=>get_proc_types_for_create_erp
  EXPORTING
    iv_tran_grp       = cl_crm_uiu_erp_order_tools=>gc_erp_trvog_salesorder
    iv_filter_profile = abap_true
  CHANGING
    cr_proc_types     = lr_proc_types_crm.
CALL METHOD cl_crm_uiu_erp_order_tools=>get_proc_types_for_create_erp
  EXPORTING
    iv_tran_grp       = cl_crm_uiu_erp_order_tools=>gc_erp_trvog_quotation
    iv_filter_profile = abap_true
  CHANGING
    cr_proc_types     = lr_proc_types_crm.
CALL METHOD cl_crm_uiu_erp_order_tools=>get_proc_types_for_create_erp
  EXPORTING
    iv_tran_grp       = cl_crm_uiu_erp_order_tools=>gc_erp_trvog_contract
    iv_filter_profile = abap_true
  CHANGING
    cr_proc_types     = lr_proc_types_crm.
DATA(iterator) = lr_proc_types_crm->get_first( ).
WHILE iterator IS NOT INITIAL.
   iterator->get_properties( IMPORTING es_attributes = ls_attribute ).
   WRITE: / 'Type: ' COLOR COL_GROUP, ls_attribute-process_type COLOR COL_NEGATIVE,
   'description: ' COLOR COL_POSITIVE, ls_attribute-proc_type_descr_20 COLOR COL_TOTAL,
   'BOR type: '  COLOR COL_NEGATIVE, ls_attribute-subobject_category COLOR COL_KEY.
   iterator = lr_proc_types_crm->get_next( ).
ENDWHILE.

输出:
使用代码获得所有适用于创建的transaction type_第2张图片

你可能感兴趣的:(CRM)