Chinaunix首页 | 论坛 | 博客
  • 博客访问: 710391
  • 博文数量: 145
  • 博客积分: 3446
  • 博客等级: 中校
  • 技术积分: 1567
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-30 13:58
文章分类

全部博文(145)

文章存档

2021年(1)

2020年(1)

2019年(1)

2018年(6)

2017年(1)

2016年(10)

2015年(12)

2014年(10)

2013年(15)

2012年(33)

2011年(21)

2010年(9)

2009年(18)

2008年(2)

2006年(5)

我的朋友

分类: 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       =

 

阅读(3642) | 评论(0) | 转发(0) |
0

上一篇:创建su01用户的bapi

下一篇:sap crm badi

给主人留下些什么吧!~~