使用代码获得所有适用于创建的transaction type
  TEZNKK3IfmPf 7天前 19 0
Created by Jerry Wang on Feb 17, 2015

使用代码获得如下process type popup dialog里的entry:
使用代码获得所有适用于创建的transaction type
执行如下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

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 7天前 0

暂无评论

TEZNKK3IfmPf