DATA s_centr TYPE bapibus1006_central.
DATA s_org TYPE bapibus1006_central_organ.
DATA s_adress TYPE bapibus1006_address.
DATA t_tele LIKE bapiadtel OCCURS 0 WITH HEADER LINE.
DATA t_fax LIKE bapiadfax OCCURS 0 WITH HEADER LINE.
DATA t_tele1 LIKE bapiadtel OCCURS 0 WITH HEADER LINE.
DATA t_fax1 LIKE bapiadfax OCCURS 0 WITH HEADER LINE.
IF s_bp IS NOT INITIAL.
CLEAR: s_org,s_adress,s_centr.
REFRESH: t_tele,t_tele1,t_fax,t_fax1.
CLEAR: t_tele,t_tele1,t_fax,t_fax1.
s_centr-searchterm1 = s_bp-bu_sort1.
s_org-name1 = s_bp-name_org1.
s_org-name3 = s_bp-manager.
s_org-name4 = s_bp-buyer.
s_adress-street = s_bp-street .
s_adress-postl_cod1 = s_bp-post_code1.
s_adress-country = s_bp-country.
s_adress-region = s_bp-region.
s_adress-city = s_bp-city1.
t_tele-country = s_bp-country.
t_tele-telephone = s_bp-tel_number.
t_tele-r_3_user = '1'.
APPEND t_tele.
t_tele-telephone = s_bp-mob_number.
t_tele-r_3_user = '3'.
APPEND t_tele.
t_tele1-country = s_bp-country.
t_tele1-telephone = s_bp-fax_number.
APPEND t_tele1.
t_fax-country = s_bp-country.
t_fax-fax = s_bp-b_tel.
APPEND t_fax.
t_fax1-country = s_bp-country.
t_fax1-fax = s_bp-fox.
APPEND t_fax1.
CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
EXPORTING
partnercategory = '2'
centraldata = s_centr
partnergroup = s_bp-bu_group
centraldataorganization = s_org
addressdata = s_adress
IMPORTING
businesspartner = partner
TABLES
telefondata = t_tele
faxdata = t_fax
telefondatanonaddress = t_tele1
faxdatanonaddress = t_fax1.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. "可以写在loop里面
ENDIF.
关系
SELECT partner2 reltyp
INTO (f_part-low , f_part-high)
FROM but050
WHERE partner1 = partner1 AND reltyp = reltype-low .
f_part-sign = 'I' .
f_part-option = 'EQ' .
APPEND f_part .
CLEAR: f_part .
ENDSELECT .
IF sign_t = 'X' . " 批量维护合作伙伴关系--T
CALL FUNCTION 'BURS_RELATION_MAINTAIN_DI'
EXPORTING
iv_aktyp = '01'
iv_partner1 = f_part-low
iv_partner2 = partner2
iv_date_to = '99991231'
iv_reltyp = rltype.
ELSEIF sign_f = 'X' . " 批量维护合作伙伴关系--F
CALL FUNCTION 'BURS_RELATION_MAINTAIN_DI'
EXPORTING
iv_aktyp = '01'
iv_partner1 = partner2
iv_partner2 = f_part-low
iv_date_to = '99991231'
iv_reltyp = rltype.
阅读(1150) | 评论(0) | 转发(0) |