生活随笔
收集整理的這篇文章主要介紹了
使用代码获得所有适用于创建的transaction type
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Created by Jerry Wang on Feb 17, 2015
使用代碼獲得如下process type popup dialog里的entry:
執行如下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_crmTYPE 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(EXPORTINGiv_bus_category = lv_bus_categoryiv_quotation_only = spaceiv_template_only = spaceiv_activity_screen_type = spaceiv_mixed_quot_order = spaceIMPORTINGet_proc_types = lt_proc_typesCHANGINGcr_proc_types = lr_proc_types_crm ).
* Quotation
lv_quotations_only = abap_true.
lr_access->get_proctypes_for_create(EXPORTINGiv_bus_category = lv_bus_categoryiv_quotation_only = lv_quotations_onlyiv_template_only = spaceiv_activity_screen_type = spaceiv_mixed_quot_order = spaceIMPORTINGet_proc_types = lt_proc_typesCHANGINGcr_proc_types = lr_proc_types_crm ).
* Service
CLEAR lv_quotations_only.
lr_access->get_proctypes_for_create(EXPORTINGiv_bus_category = gc_object_type-serviceiv_quotation_only = spaceiv_template_only = spaceiv_activity_screen_type = spaceiv_mixed_quot_order = spaceIMPORTINGet_proc_types = lt_proc_typesCHANGINGcr_proc_types = lr_proc_types_crm ).
* Service Quotation
lv_quotations_only = abap_true.
lr_access->get_proctypes_for_create(EXPORTINGiv_bus_category = gc_object_type-serviceiv_quotation_only = lv_quotations_onlyiv_template_only = spaceiv_activity_screen_type = spaceiv_mixed_quot_order = spaceIMPORTINGet_proc_types = lt_proc_typesCHANGINGcr_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_erpEXPORTINGiv_tran_grp = cl_crm_uiu_erp_order_tools=>gc_erp_trvog_salesorderiv_filter_profile = abap_trueCHANGINGcr_proc_types = lr_proc_types_crm.
CALL METHOD cl_crm_uiu_erp_order_tools=>get_proc_types_for_create_erpEXPORTINGiv_tran_grp = cl_crm_uiu_erp_order_tools=>gc_erp_trvog_quotationiv_filter_profile = abap_trueCHANGINGcr_proc_types = lr_proc_types_crm.
CALL METHOD cl_crm_uiu_erp_order_tools=>get_proc_types_for_create_erpEXPORTINGiv_tran_grp = cl_crm_uiu_erp_order_tools=>gc_erp_trvog_contractiv_filter_profile = abap_trueCHANGINGcr_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的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。