[英]BUT051 table is not updated with BUR_BUPR_BUT051_COLLECT
I'm trying to update DB Table BUT051
by using function module BUR_BUPR_BUT051_COLLECT
.我正在尝试使用 function 模块
BUR_BUPR_BUT051_COLLECT
BUT051
The problem is that it doesn't update at all.问题是它根本不更新。
Here's part of my code I'm currently using to update BUT051
.这是我目前用来更新
BUT051
的部分代码。 Note: The field I'm trying to update is BUT051~PARTNER1
.注意:我要更新的字段是
BUT051~PARTNER1
。
FORM update_but051.
"--------------------------------------------------------------------"
" TABLES
"--------------------------------------------------------------------"
DATA: lt_but051 TYPE TABLE OF but051.
"--------------------------------------------------------------------"
" STRUCTURES
"--------------------------------------------------------------------"
DATA: ls_but051 TYPE but051.
REFRESH: lt_but051.
CLEAR: ls_but051.
" Getting all relationships of the given accounts/partners
SELECT * FROM but051 INTO TABLE lt_but051 WHERE partner1 IN lt_partners_so.
" Replacing all partners(field `partner1`) with the master partner.
ls_but051-partner1 = p_mstcln.
MODIFY lt_but051 FROM ls_but051 TRANSPORTING partner1 WHERE partner1 <> p_mstcln.
CLEAR: ls_but051.
LOOP AT lt_but051 INTO ls_but051.
CALL FUNCTION 'BUR_BUPR_BUT051_COLLECT'
EXPORTING
i_subname = 'BUT051'
i_but051 = ls_but051.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ENDFORM.
Few notes on this code:关于这段代码的几点说明:
p_mstcln
is a parameter of type c(10)
, this is the new partner number.p_mstcln
是c(10)
类型的参数,这是新的合作伙伴编号。lt_partners_so
is a table of partners all of which need to be replaced by p_mstcln
in but051
.lt_partners_so
是一个伙伴表,所有这些都需要替换为p_mstcln
中的but051
。 Am I using the right function?我使用的是正确的 function 吗?
Is there another Function Module that does what I want to(updating the field partner1
in but051
)?是否还有另一个 Function 模块可以执行我想要的操作(更新
but051
中的字段partner1
)?
BUT051 is a table for Business Partner relationships and SAP has a special note for this: BUT051 是业务伙伴关系表,SAP 对此有特别说明:
2594686 - Mass update relationships for BP 2594686 - BP 的大规模更新关系
which advises to use the following Function Modules for updating relationships:建议使用以下 Function 模块来更新关系:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.