FUNCTION ZCRM_BP_CRT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(PHONE) TYPE BAPIADTEL-TELEPHONE OPTIONAL
*" REFERENCE(MOBIL) TYPE BAPIADTEL-TELEPHONE OPTIONAL
*" REFERENCE(FIRSTNAME) TYPE BAPIBUS1006_CENTRAL_PERSON-FIRSTNAME
*" OPTIONAL
*" REFERENCE(LASTNAME) TYPE BAPIBUS1006_CENTRAL_PERSON-LASTNAME
*" OPTIONAL
*" REFERENCE(CITY) TYPE BAPIBUS1006_ADDRESS-CITY OPTIONAL
*" REFERENCE(COUNTRY) TYPE BAPIBUS1006_ADDRESS-COUNTRY OPTIONAL
*" REFERENCE(DISTRICT) TYPE AD_CITY2 OPTIONAL
*" REFERENCE(STREET) TYPE BAPIBUS1006_ADDRESS-STREET OPTIONAL
*" REFERENCE(HOUSE_NO) TYPE BAPIBUS1006_ADDRESS-HOUSE_NO OPTIONAL
*" REFERENCE(POSTCODE) TYPE BAPIBUS1006_ADDRESS-POSTL_COD1
*" OPTIONAL
*" REFERENCE(REGION) TYPE BAPIBUS1006_ADDRESS-REGION OPTIONAL
*" REFERENCE(TEL_EXTENS) TYPE AD_TLXTNS OPTIONAL
*" REFERENCE(FAX_NUMBER) TYPE AD_FXNMBR OPTIONAL
*" REFERENCE(FAX_EXTENS) TYPE AD_FXXTNS OPTIONAL
*" REFERENCE(DEFLT_COMM) TYPE AD_COMM OPTIONAL
*" REFERENCE(TITLE_LET) TYPE BU_TITLE_LET OPTIONAL
*" REFERENCE(SMTP_ADDR) TYPE AD_SMTPADR OPTIONAL
*" REFERENCE(BU_TYPE) TYPE BU_TYPE DEFAULT '1'
*" REFERENCE(TITLE) TYPE AD_TITLE OPTIONAL
*" REFERENCE(BU_SORT1) TYPE BU_SORT1 OPTIONAL
*" REFERENCE(TIME_ZONE) TYPE AD_TZONE OPTIONAL
*" REFERENCE(IV_ZA_FLAG) TYPE ZCORDER_GENERAL-ZA_FLAG OPTIONAL
*" REFERENCE(IV_LAND) TYPE LAND1 OPTIONAL
*" REFERENCE(IV_STR_SUPPL1) TYPE AD_STRSPP1 OPTIONAL
*" REFERENCE(IV_STR_SUPPL2) TYPE AD_STRSPP2 OPTIONAL
*" REFERENCE(IV_ZZBUILDING_TYPE) TYPE ZBUILDING_TYPE_E OPTIONAL
*" REFERENCE(IV_ZZMKT_USAGE) TYPE ZMKT_USAGE_E OPTIONAL
*" REFERENCE(IV_FLOOR) TYPE AD_FLOOR OPTIONAL
*" REFERENCE(IV_ZZACCESS_CODE) TYPE ZACCESS_CODE_E OPTIONAL
*" REFERENCE(IV_NAMEORG1) TYPE BU_NAMEOR1 OPTIONAL
*" REFERENCE(SALES_ORG) TYPE CRMT_SALES_ORG OPTIONAL
*" EXPORTING
*" REFERENCE(BP_NUMBER) TYPE BU_PARTNER
*" TABLES
*" RETURN STRUCTURE BAPIRET2
*"---------------------------------------------------------------------- TYPES:BEGIN OF TY_BP_DATA,
PARTNER TYPE BUT000-PARTNER, "0.
SEQNO TYPE NUM10,
PARTNERCATEGORY TYPE BAPIBUS1006_HEAD-PARTN_CAT, "-1
PARTNERROLE TYPE BAPIBUS1006_BPROLES-PARTNERROLE, "角色
PARTN_GRP TYPE BAPIBUS1006_HEAD-PARTN_GRP,
TITLE_KEY TYPE BAPIBUS1006_CENTRAL-TITLE_KEY,
FIRSTNAME TYPE BAPIBUS1006_CENTRAL_PERSON-FIRSTNAME,
LASTNAME TYPE BAPIBUS1006_CENTRAL_PERSON-LASTNAME,
CITY TYPE BAPIBUS1006_ADDRESS-CITY,
COUNTRY TYPE BAPIBUS1006_ADDRESS-COUNTRY, " 4.注册地址-国家
REGION TYPE BAPIBUS1006_ADDRESS-REGION, " 5.注册地址-地区
TELEPHONE TYPE BAPIADTEL-TELEPHONE, "15.电话
MOBIL TYPE BAPIADTEL-TELEPHONE,
E_MAIL TYPE BAPIADSMTP-E_MAIL,
NAME1 TYPE BAPIBUS1006_CENTRAL_ORGAN-NAME1,
NAME2 TYPE BAPIBUS1006_CENTRAL_ORGAN-NAME2,
STREET TYPE BAPIBUS1006_ADDRESS-STREET,
LANGU TYPE BAPIBUS1006_ADDRESS-LANGU,
SALES_ORGANIZATION TYPE BAPIBUS1006_SALES_AREA-SALES_ORGANIZATION, " 19.销售组织标识
DISTRIBUTION_CHANNEL TYPE BAPIBUS1006_SALES_AREA-DISTRIBUTION_CHANNEL, " 20.分销渠道
DIVISION TYPE BAPIBUS1006_SALES_AREA-DIVISION, " 21.部门
SALES_OFFICE TYPE BAPIBUS1006140_ORG-SALES_OFFICE, " 22.销售部门
SALES_GROUP TYPE BAPIBUS1006140_ORG-SALES_GROUP, " 23.销售组
CUST_PRIC_PROC TYPE BAPIBUS1006030_PRICING-CUST_PRIC_PROC, "客户定价程序
END OF TY_BP_DATA. DATA:T_BP_DATA TYPE TABLE OF TY_BP_DATA,
W_BP_DATA LIKE LINE OF T_BP_DATA.
DATA:
LT_BAPIRET2 TYPE TABLE OF BAPIRET2,
LV_PARTNER_GUID TYPE BU_PARTNER_GUID,
LS_EEWB TYPE BUS000_EEW,
LS_EEWB_X TYPE BUS000_EEW_X.
DATA LW_CENTRALDATA TYPE BAPIBUS1006_CENTRAL.
DATA LW_CENTRALDATAPERSON TYPE BAPIBUS1006_CENTRAL_PERSON.
DATA LW_ADDRESSDATA TYPE BAPIBUS1006_ADDRESS.
DATA LT_TELEFONDATA TYPE STANDARD TABLE OF BAPIADTEL WITH HEADER LINE.
DATA LT_FAXDATA TYPE STANDARD TABLE OF BAPIADFAX WITH HEADER LINE.
DATA LT_E_MAILDATA TYPE STANDARD TABLE OF BAPIADSMTP WITH HEADER LINE.
DATA LT_BUSINESSPARTNERROLE TYPE STANDARD TABLE OF BAPIBUS1006_BPROLES WITH HEADER LINE.
DATA LT_RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE.
DATA: L_FAIL TYPE C. DATA LW_CENTRALDATAORGANIZATION TYPE BAPIBUS1006_CENTRAL_ORGAN.
DATA LW_SALES_AREA TYPE BAPIBUS1006_SALES_AREA.
DATA LW_SALES_ORG TYPE BAPIBUS1006140_ORG.
DATA LW_SALES_CLASS TYPE BAPIBUS1006040_SALESCLASS.
DATA LW_SALES_CLASSX TYPE BAPIBUS1006040_SALESCLASSX.
DATA LW_SALES_BILL TYPE BAPIBUS1006030_PRICING.
DATA LW_SALES_SHIPPING TYPE BAPIBUS1006020_SHIPPING. W_BP_DATA-FIRSTNAME = FIRSTNAME.
W_BP_DATA-LASTNAME = LASTNAME.
W_BP_DATA-TELEPHONE = PHONE.
W_BP_DATA-MOBIL = MOBIL.
W_BP_DATA-CITY = CITY.
W_BP_DATA-COUNTRY = COUNTRY. LW_CENTRALDATA-TITLELETTER = TITLE_LET. LW_CENTRALDATA-TITLE_KEY = TITLE."add by dq-yuw 20170920 IF BU_TYPE = ''.
LW_CENTRALDATAPERSON-LASTNAME = W_BP_DATA-LASTNAME.
LW_CENTRALDATAPERSON-FIRSTNAME = W_BP_DATA-FIRSTNAME.
LW_CENTRALDATAPERSON-CORRESPONDLANGUAGE = 'E'.
* lw_centraldata-title_key = title."change by dq-yuw:这里应该是个BUG,创建公司客户也可以有tittle,这里把他放到上面去
ELSEIF BU_TYPE = ''.
"add by dq-yuw 之前本来就错的吧,写反了应该,法国和日本先给他改过来
IF COUNTRY EQ 'JP'"日本创建客户时name org1就是页面上lastname字段
OR COUNTRY EQ 'FR'."
LW_CENTRALDATAORGANIZATION-NAME1 = W_BP_DATA-LASTNAME.
LW_CENTRALDATAORGANIZATION-NAME2 = W_BP_DATA-FIRSTNAME.
ELSE.
LW_CENTRALDATAORGANIZATION-NAME1 = W_BP_DATA-FIRSTNAME.
LW_CENTRALDATAORGANIZATION-NAME2 = W_BP_DATA-LASTNAME.
ENDIF. "法国创建公司客户的时候用页面上的company name
IF COUNTRY EQ 'FR' OR ZCL_CRM_BUFFER=>GV_UI_LOGIN_ORG EQ 'O 50000297'."法国
* CLEAR: lw_centraldataorganization-name1,lw_centraldataorganization-name2. 20171019 需求 取消该逻辑
LW_CENTRALDATAORGANIZATION-NAME1 = IV_NAMEORG1.
LW_CENTRALDATAORGANIZATION-NAME3 = W_BP_DATA-LASTNAME."20171019 需求 Last Name 借用 Org3 字段
ENDIF. LW_ADDRESSDATA-LANGU = 'E'.
LW_CENTRALDATA-SEARCHTERM1 = BU_SORT1.
ENDIF. LW_ADDRESSDATA-COUNTRY = W_BP_DATA-COUNTRY.
LW_ADDRESSDATA-CITY = W_BP_DATA-CITY.
LW_ADDRESSDATA-STREET = STREET.
LW_ADDRESSDATA-STR_SUPPL1 = IV_STR_SUPPL1."add by dq-yuw for japan
LW_ADDRESSDATA-STR_SUPPL2 = IV_STR_SUPPL2."add by dq-yuw for FRANCE
LW_ADDRESSDATA-DISTRICT = DISTRICT.
LW_ADDRESSDATA-HOUSE_NO = HOUSE_NO.
LW_ADDRESSDATA-POSTL_COD1 = POSTCODE.
LW_ADDRESSDATA-REGION = REGION.
LW_ADDRESSDATA-FLOOR = IV_FLOOR."20170718 Add Chenguoguang
LW_ADDRESSDATA-COMM_TYPE = DEFLT_COMM.
LW_ADDRESSDATA-TIME_ZONE = TIME_ZONE. IF W_BP_DATA-TELEPHONE IS NOT INITIAL.
CLEAR LT_TELEFONDATA.
LT_TELEFONDATA-COUNTRY = W_BP_DATA-COUNTRY.
LT_TELEFONDATA-TELEPHONE = W_BP_DATA-TELEPHONE.
LT_TELEFONDATA-R_3_USER = ''.
LT_TELEFONDATA-EXTENSION = TEL_EXTENS.
APPEND LT_TELEFONDATA.
ENDIF. IF W_BP_DATA-MOBIL IS NOT INITIAL.
CLEAR LT_TELEFONDATA.
LT_TELEFONDATA-COUNTRY = W_BP_DATA-COUNTRY.
LT_TELEFONDATA-TELEPHONE = W_BP_DATA-MOBIL.
LT_TELEFONDATA-R_3_USER = ''.
APPEND LT_TELEFONDATA.
ENDIF. IF FAX_NUMBER IS NOT INITIAL. LT_FAXDATA-FAX = FAX_NUMBER.
LT_FAXDATA-EXTENSION = FAX_EXTENS.
APPEND LT_FAXDATA.
ENDIF. IF SMTP_ADDR IS NOT INITIAL.
LT_E_MAILDATA-E_MAIL = SMTP_ADDR.
APPEND LT_E_MAILDATA.
ENDIF. *默认为客户
LW_SALES_CLASS-IS_CUSTOMER = 'X'.
LW_SALES_CLASSX-IS_CUSTOMER = 'X'. *装运
IF COUNTRY = 'ES'.
LW_SALES_SHIPPING-SHIPPING_COND = ''.
ELSE.
LW_SALES_SHIPPING-SHIPPING_COND = ''.
ENDIF.
LW_SALES_SHIPPING-DLV_PRIORITY = . *根据国家信息在表ZBP_SALES里取出相关信息
DATA: IT_BP_SALES TYPE STANDARD TABLE OF ZBP_SALES,
WA_BP_SALES TYPE ZBP_SALES. SELECT SINGLE *
FROM ZBP_SALES
INTO WA_BP_SALES
WHERE COUNTRY = COUNTRY.
* ENDIF.
IF sales_org IS NOT INITIAL."add by ly 20180803
SELECT SINGLE *
FROM ZBP_SALES
INTO WA_BP_SALES
WHERE COUNTRY = COUNTRY
AND SALES_ORG = SALES_ORG.
ENDIF.
"add by dq-yuw request by zhangchi
"集中建单平台创建客户时,根据客户地址中的国家 = ZBP_SALES-COUNTRY & 当前登录用户的销售组织 = ZBP_SALES-SALES_ORG,来查找ZBP_SALES表中的数据,
"以确定创建客户的BP分组和销售组织等数据。
IF ZCL_CRM_ATTRIBUTES=>GV_WEB_UI_LOGON = ABAP_TRUE..
DATA LV_SALES_ORG TYPE CRMT_SALES_ORG. CALL FUNCTION 'Z_GET_SALESORG_BY_USER'
EXPORTING
IV_USER = SY-UNAME
IMPORTING
EV_SALES_ORG = LV_SALES_ORG
* EV_COUNTRY =
* EV_HQ =
.
IF LV_SALES_ORG <> 'O 50000192' AND LV_SALES_ORG <> 'O 50000194'.
SELECT SINGLE *
FROM ZBP_SALES
INTO WA_BP_SALES
WHERE COUNTRY = COUNTRY
AND SALES_ORG = LV_SALES_ORG.
ENDIF.
ENDIF.
* 销售视图
LW_SALES_AREA-SALES_ORGANIZATION = WA_BP_SALES-SALES_ORG.
LW_SALES_AREA-DISTRIBUTION_CHANNEL = WA_BP_SALES-CHANNEL.
* lw_sales_area-division = wa_bp_sales-division.
LW_SALES_ORG-SALES_OFFICE = WA_BP_SALES-SALES_OFFICE.
* lw_sales_org-sales_group = wa_bp_sales-sales_group. * 定价程序
LW_SALES_BILL-PRICE_GROUP = WA_BP_SALES-PRICE_GROUP.
LW_SALES_BILL-CURRENCY = WA_BP_SALES-CURRENCY.
LW_SALES_BILL-CUST_PRIC_PROC = 'X'. CLEAR:L_FAIL.
CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
EXPORTING
PARTNERCATEGORY = BU_TYPE
PARTNERGROUP = WA_BP_SALES-BU_GROUP
* partnergroup = w_bp_data-partn_grp
CENTRALDATAORGANIZATION = LW_CENTRALDATAORGANIZATION
CENTRALDATA = LW_CENTRALDATA
CENTRALDATAPERSON = LW_CENTRALDATAPERSON
ADDRESSDATA = LW_ADDRESSDATA
IMPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
TABLES
TELEFONDATA = LT_TELEFONDATA
FAXDATA = LT_FAXDATA
E_MAILDATA = LT_E_MAILDATA
RETURN = LT_RETURN. LOOP AT LT_RETURN WHERE TYPE = 'A' OR TYPE = 'E'.
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
ENDLOOP.
IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.
CHECK L_FAIL IS INITIAL.
CHECK W_BP_DATA-PARTNER IS NOT INITIAL. BP_NUMBER = W_BP_DATA-PARTNER. *返回创建好的bp号码
CLEAR LT_RETURN.
LT_RETURN-TYPE = 'S'.
LT_RETURN-MESSAGE = W_BP_DATA-PARTNER.
APPEND LT_RETURN TO RETURN[]. *角色
CALL FUNCTION 'BAPI_BUPA_ROLE_ADD_2'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
BUSINESSPARTNERROLE = 'CRM000'
VALIDFROMDATE = ''
VALIDUNTILDATE = ''
TABLES
RETURN = LT_RETURN. LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'. ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.
CHECK L_FAIL IS INITIAL.
*税分类
IF WA_BP_SALES-COUNTRY IS NOT INITIAL AND
WA_BP_SALES-TAX_TYPE IS NOT INITIAL AND
WA_BP_SALES-TAX_GROUP IS NOT INITIAL.
CLEAR L_FAIL.
DATA: L_TAXREGION TYPE BAPIBUS1006_TAX_CLASS-TAXREGION.
CALL FUNCTION 'BAPI_BUTX_FRG0010_ADD'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
TAXCOUNTRY = WA_BP_SALES-COUNTRY
TAXREGION = L_TAXREGION
TAXTYPE = WA_BP_SALES-TAX_TYPE
DATA = WA_BP_SALES-TAX_GROUP
TABLES
RETURN = LT_RETURN.
ENDIF . LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'. ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF. CLEAR L_FAIL. *销售范围
CALL FUNCTION 'BAPI_BUPA_FRG0010_ADD'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
SALES_AREA = LW_SALES_AREA
* DATA =
TABLES
RETURN = LT_RETURN. LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF. CLEAR L_FAIL. *组织
CALL FUNCTION 'BAPI_BUPA_FRG0140_ADD'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
SALES_AREA = LW_SALES_AREA
DATA = LW_SALES_ORG
* DATAX =
TABLES
RETURN = LT_RETURN. LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' . ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF. CLEAR L_FAIL. *开票中的客户定价程序
CALL FUNCTION 'BAPI_BUPA_FRG0030_ADD'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
SALES_AREA = LW_SALES_AREA
DATA = LW_SALES_BILL
TABLES
RETURN = LT_RETURN.
LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
* WAIT UP TO '0.5' SECONDS.
ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF. CLEAR L_FAIL. CALL FUNCTION 'BAPI_BUPA_FRG0040_CREATE'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
DATA = LW_SALES_CLASS
* datax = lw_sales_classx
TABLES
RETURN = LT_RETURN. LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
* WAIT UP TO '0.5' SECONDS.
ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
* CONTINUE.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF. CLEAR L_FAIL. CALL FUNCTION 'BAPI_BUPA_FRG0020_ADD'
EXPORTING
BUSINESSPARTNER = W_BP_DATA-PARTNER
SALES_AREA = LW_SALES_AREA
DATA = LW_SALES_SHIPPING
* datax = lw_sales_classx
TABLES
RETURN = LT_RETURN. LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
* WAIT UP TO '0.5' SECONDS.
ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
* CONTINUE.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF. DEFINE EEW.
IF & is NOT INITIAL.
& = &.
& = 'X'.
ENDIF.
END-OF-DEFINITION.
**&----增强字段(网点)
CLEAR:LS_EEWB_X,LS_EEWB.
SELECT SINGLE PARTNER_GUID
INTO LV_PARTNER_GUID
FROM BUT000
WHERE PARTNER = W_BP_DATA-PARTNER.
IF SY-SUBRC = .
LS_EEWB-PARTNR_GUID = LV_PARTNER_GUID.
EEW IV_ZZBUILDING_TYPE LS_EEWB-ZZBUILDING_TYPE LS_EEWB_X-ZZBUILDING_TYPE.
EEW IV_ZZMKT_USAGE LS_EEWB-ZZMKT_USAGE LS_EEWB_X-ZZMKT_USAGE.
EEW IV_ZZACCESS_CODE LS_EEWB-ZZACCESS_CODE LS_EEWB_X-ZZACCESS_CODE.
REFRESH:LT_RETURN, LT_BAPIRET2.
CALL FUNCTION 'BUPA_CENTRAL_CI_CHANGE'
EXPORTING
IS_BUS000_EEW = LS_EEWB
IS_BUS000_EEW_X = LS_EEWB_X
IMPORTING
ET_RETURN = LT_BAPIRET2.
APPEND LINES OF LT_BAPIRET2 TO LT_RETURN.
LOOP AT LT_RETURN WHERE TYPE = 'E' OR TYPE = 'A' .
L_FAIL = 'X'.
APPEND LT_RETURN TO RETURN[].
CLEAR LT_RETURN.
* WAIT UP TO '0.5' SECONDS.
ENDLOOP. IF L_FAIL = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
* CONTINUE.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.
ENDIF. ENDFUNCTION.

CRM创建BP(END USER)的更多相关文章

  1. CRM创建物料FM2

    这是在佛山好帮手时受启发而研究出来的,创建物料,带单位,类型组 经测试....算了,不说了,有什么限制自己测去...今天心情不好... FUNCTION ZLY_CREATE_PRODUCT_UNIT ...

  2. crm创建报告补充导航

    报告导航实现动态交互体验报告. 通过使用各种类型的操作的,报告允许用户导航到特定的报告.Microsoft Dynamics CRM 记录或其它网站 动态钻取到 Microsoft Dynamics ...

  3. crm创建和编辑全局选项集

    一个选项集就是可包含在一个实体中的某种类型的字段.它定义一组选项.当一个选项集显示在窗口中时,将使用下拉列表控件.当在 Advanced Find 中显示时,则使用选择列表控件.有时,开发者将选项集称 ...

  4. crm创建启用停用用户

    public static readonly string entityName = "systemuser";         public Guid userId = Guid ...

  5. CRM创建物料FM1

    这是在中联混凝土那边搞的.... method create_prd.  data: lt_return type bapiret2_tab,        ls_return like line o ...

  6. crm创建基于fetch自己的自定义报告

    在解决方案资源管理器,右键点击"报表"目录.然后点击"增加了新的报告". 打开"报表向导". 在"欢迎来到报表向导"前, ...

  7. Pytorch自定义创建BP神经网络

    class BPNet(nn.Module): def __init__(self, in_dim, n_hidden_1, n_hidden_2,\ n_hidden_3, n_hidden_4, ...

  8. SAP CRM 为用户创建业务合作伙伴并分配到组织单位

    想要在SAP CRM的前台完成一些操作,需要登录的用户在系统中存在对应的业务合作伙伴才可以,某些情况下,还需要被分配到正确的公司.部门.职位.下面是相关的操作步骤. 本文假定读者已经拥有一个开发帐号. ...

  9. CRM BP函数

    REPORT ZCRM_BP_TEST. """""""""""""& ...

随机推荐

  1. Hadoop 故障整理

    1.关于DataNode 错误信息解析 错误内容 java.io.IOException: Incompatible clusterIDs -b89c-43f90751214b; datanode c ...

  2. Ubuntu 安装第三方工具

    1. pycharm  安装(链接:https://pan.baidu.com/s/1fIp-AhBmnPvqYW40140RLw     提取码:ukkv ) 1.运行以下命令安装 sh pycha ...

  3. php 当前日期加一天和指定日期加一天

    1.给当前时间加一天?一小时? <?phpecho "今天:",date('Y-m-d H:i:s'),"<br>";echo "明 ...

  4. Overture小课堂之如何演绎钢琴滑音

    在我们学习钢琴和学习使用Overture时,要学习如何弹奏和使用滑音.那么我们先来看看什么是滑音,如何使用钢琴演绎,在Overture里滑音又在哪里呢? 滑音,在音乐术语中通常指一种装饰音和演奏指法. ...

  5. 2018年—2019年第二学期第四周C#学习个人总结

    第五章面向对象高级包括:5.1类的继承中有5.1.1继承的概念:一是在现实生活中,继承一般指的是子女继承父辈的财产;在C#,类的继承是指在一个现有类的基础上去构建一个新的类,构建出来的新类被称作子类, ...

  6. python脚本练习之编译安装python

    练习 py-shelll #coding=utf-8 import os,sys if os.getuid() == 0: pass else: print('当前用户不是root,请以root用户执 ...

  7. linux服务基础(一)之CentOS6编译安装httpd2.4

    安装http-2.4 Http依赖于apr-1.4+,apr-util-1.4+ CentOS6上默认是apr-1.3,apr-util1.3 先编译安装apr-1.5,apr-util-1.5 开始 ...

  8. [java]配置java环境

    为vscode配置Java环境 安装JDK 首先你需要安装一个JDK,这次我们以JDK1.8.0为例进行我们的笔记. 为JDK添加环境变量 你需要将JDK添加进环境变量,一般这一步安装过程中会自动为你 ...

  9. linux 添加环境变量

    You have to edit three files to set a permanent environment variable as follow: ~/.bashrc When you o ...

  10. 【python 3】 集合方法操作汇总

    基本数据类型 : set 集合(set)特点 : 无序 不能重复(自动去重) 用 {} 或 set()函数 来表示集合 空集合 : set() 1 name = {"江户部柯南", ...