分类: Web开发
2013-04-22 18:45:08
1. CRM_BUPA_FRG0140_CHANGE : Update BP Sales Office
DATA: l_wa_sales_area TYPE crmt_bus_sales_area,
l_wa_data TYPE crmt_bus_set0140,
l_wa_datax TYPE crmt_bus_set0140x,
l_i_return TYPE bus_bapiret2_t, " BAPI return
l_error TYPE bu_boolean. " Boolean type
**Assign data for district
l_wa_data-district = l_wa_i_apr_sales_off-district.
* append l_wa_data to l_i_data.
l_wa_datax-district = c_check.
* append l_wa_datax to l_i_datax.
* Update sales District
CALL FUNCTION 'CRM_BUPA_FRG0140_CHANGE'
EXPORTING
iv_partner_guid = p_l_wa_but000_100_scr2536-partner_guid
is_sales_area = l_wa_sales_area
is_data = l_wa_data
is_datax = l_wa_datax
iv_x_save = c_check "'X'
IMPORTING
et_return = l_i_return
ev_error = l_error.
2. CRM_MKTBP_ASSIGN_ATTRIBUT_TAB : Update Marketing attribute of BP
CONSTANTS: c_attr_set TYPE crmt_prof_template VALUE 'NEW_SET_0000000361',
c_objtyp TYPE tabelle VALUE 'BUT000'. "Object type
DATA: l_i_guid TYPE STANDARD TABLE OF crmt_mktbp_partner_tab
INITIAL SIZE 0, "holds partner and its guid.
i_attr_set1 TYPE STANDARD TABLE OF crmt_mktpfchr_attribute_line
INITIAL SIZE 0. "Holds attribute name and its value.
CALL FUNCTION 'CRM_MKTBP_ASSIGN_ATTRIBUT_TAB'
EXPORTING
iv_attribute_set = c_attr_set
iv_commit = c_check
iv_obtyp = c_objtyp
iv_write_ale = c_check
TABLES
it_partner = l_i_guid
et_return = l_i_return
it_attributes = i_attr_set1.
3. CRM_BUPA_IL_GET_BP_SALES_AREAS: Get Sales Area of BP.
DATA: p_i_sales_area TYPE crmt_bsp_sales_area_bp_t.
* Get sales area
CALL FUNCTION 'CRM_BUPA_IL_GET_BP_SALES_AREAS'
EXPORTING
iv_partner_guid = p_wa_but000_100-partner_guid "Partner Guid
IMPORTING
et_sales_areas = p_i_sales_area.
4. CRM_BUPA_FRG0140_GET_DETAIL: Get Sales Office of BP
DATA: l_wa_sales_area TYPE crmt_bus_sales_area,
l_wa_data TYPE crmt_bus_set0140.
* Get sales office
CALL FUNCTION 'CRM_BUPA_FRG0140_GET_DETAIL'
EXPORTING
iv_partner_guid = p_wa_but000_100-partner_guid "partner guid
is_sales_area = l_wa_sales_area "Sales area
IMPORTING
es_data = l_wa_data
et_return = l_wa_return
ev_error = l_error.
5. BAPI_BUPA_FRG0040_GETDETAIL: Get Account Group of BP
DATA: l_data TYPE bapibus1006040_salesclass,
l_i_return TYPE STANDARD TABLE OF bapiret2 INITIAL SIZE 0.
CALL FUNCTION 'BAPI_BUPA_FRG0040_GETDETAIL'
EXPORTING
businesspartner = p_wa_but000_100-partner "Business Partner
IMPORTING
data = l_data
TABLES
return = l_i_return.
6. CRM_MKTBP_DEL_ATTR_BP_LIST: Delete marketing attribute value of BP
CONSTANTS: c_attr_set TYPE crmt_prof_template VALUE 'NEW_SET_0000000361'.
DATA: p_c_att TYPE crmt_mktprof_keys-atnam,
l_i_guid TYPE STANDARD TABLE OF crmt_mktbp_partner_tab
INITIAL SIZE 0.
CALL FUNCTION 'CRM_MKTBP_DEL_ATTR_BP_LIST'
EXPORTING
* IV_TEST = ' '
iv_attribute_set = c_attr_set
iv_attribut = p_c_att
* IV_MSA = ' '
* IMPORTING
* EV_COUNT =
TABLES
it_partner = l_i_guid
* ET_RETURN =
* IT_ATTRSET_DEFAULTS =