Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_TRADINGCONTRACT_CHANGE won't delete partner functions

ccorby
Explorer
0 Kudos
202

Provided is an abridged version of my code that hopefully conveys how I am utilizing it. ls_hdr and ls_hdrx remain empty, and both bapis return with sy-subrc = 0.

DATA: im_updkz TYPE updkz,
ls_hdr TYPE bapitcheadc,
ls_hdrx TYPE bapitcheadcx,
lt_partner_changes TYPE TABLE OF bapiparnrc,
lt_return TYPE TABLE OF bapiret2,
lt_return2 LIKE bapiret2.
im_updkz = 'D'.
APPEND VALUE #( document = wa_assoc_asso_tab-bas_docnr_rec
itm_number = wa_assoc_asso_tab-bas_item_rec
partn_role = 'WL'
updateflag = im_updkz
p_numb_old = p_numb_old
address = wa_wl_tab-adrnr ) TO lt_partner_changes.
APPEND VALUE #( document = wa_assoc_asso_tab-bas_docnr_rec
itm_number = wa_assoc_asso_tab-bas_item_rec
partn_role = 'LF'
updateflag = im_updkz
p_numb_old = p_numb_old
address = wa_wl_tab-adrnr ) TO lt_partner_changes.
  CALL FUNCTION 'BAPI_TRADINGCONTRACT_CHANGE'
EXPORTING
TRADINGCONTRACTNO = wa_assoc_asso_tab-bas_docnr_rec
HEADDATAIN = ls_hdr
HEADDATAINX = ls_hdrx
TABLES
PARTNERCHANGES = lt_partner_changes
BUSPARTYIN = lt_bpin
BUSPARTYINX = lt_bpinx
RETURN = lt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = lt_return2.

The return table for bapi_transaction_commit is all 0s, while the return table for bapi_tradingcontract_change contains a single row with the following:
type = S
ID = WB2B

Number = 005

Message = Trading contract is saved

log_msg_no = 000000

message_v1 = trading contract #

parameter = 000000

row = 0

0 REPLIES 0