Application Development and Automation 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: 
Read only

Delete partners with BAPI_SALESORDER_CHANGE

Former Member
0 Kudos
1,211

I'm able to change and create new partners in a Sales Document...

But I'm not ablr to delete partners.Can any 1 give me clue where I'm doing wrong.

&----


*& Report YCHANGEORDER

*&

&----


*&

*&

&----


report ychangeorder.

tables: bapivbeln, bapicond, bapicondx,

bapisdh1x, bapisditmx.

data: ls_head_x type bapisdh1x,

lt_order_item_x like bapisditmx occurs 1 with header line,

lt_conditions like bapicond occurs 2 with header line,

lt_conditions_x like bapicondx occurs 2 with header line,

lt_bapiparnr like bapiparnr occurs 2 with header line,

lt_bapiparnrc like bapiparnrc occurs 2 with header line,

lt_messages like bapiret2 occurs 5 with header line,

lt_messages1 like bapiret2 occurs 5 with header line.

data: ls_vbup type vbup,

ls_gmbr type gmbr,

ls_messages type bapiret2 .

data: lv_vbeln type bapivbeln-vbeln,

lv_posnr type bapisditmx-itm_number.

lv_vbeln = '0001000340'.

ls_head_x-updateflag = 'U'.

lt_bapiparnr-partn_role = 'ZA'.

lt_bapiparnr-partn_numb = '1018'.

append lt_bapiparnr.

  • ITM_NUMBER

lt_bapiparnrc-document = lv_vbeln.

  • lt_BAPIPARNRC-ITM_NUMBER =

lt_bapiparnrc-updateflag = 'D'.

lt_bapiparnrc-partn_role = 'ZA'.

    • P_NUMB_OLD

  • lt_BAPIPARNRC-P_NUMB_NEW = '1018'.

lt_bapiparnrc-p_numb_old = '0000001018'.

append lt_bapiparnrc.

call function 'BAPI_SALESORDER_CHANGE'

exporting

salesdocument = lv_vbeln

  • ORDER_HEADER_IN =

order_header_inx = ls_head_x

  • SIMULATION =

  • BEHAVE_WHEN_ERROR = ' '

  • INT_NUMBER_ASSIGNMENT = ' '

  • LOGIC_SWITCH =

  • NO_STATUS_BUF_INIT = ' '

tables

return = lt_messages1

  • ORDER_ITEM_IN =

  • ORDER_ITEM_INX =

partners = lt_bapiparnr

partnerchanges = lt_bapiparnrc

  • PARTNERADDRESSES =

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CFGS_BLOB =

  • ORDER_CFGS_VK =

  • ORDER_CFGS_REFINST =

  • SCHEDULE_LINES =

  • SCHEDULE_LINESX =

  • ORDER_TEXT =

  • ORDER_KEYS =

  • CONDITIONS_IN =

  • CONDITIONS_INX =

  • EXTENSIONIN =

.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'

importing

return = ls_messages.

if sy-subrc ne 0.

append ls_messages to lt_messages .

endif.

http://www.sapfans.com/forums/viewtopic.php?t=229289

4 REPLIES 4
Read only

wilbert_sison2
Active Participant
0 Kudos
635

what does the lt_messages1 return?

Read only

Former Member
0 Kudos
635

What partner are you trying to delete?

Can you delete the partner in VA02 during normal, manual entry?

Read only

jayanthi_jayaraman
Active Contributor
0 Kudos
635

Hi,

Here is the sample code.Check this and kindly reward points by clicking the star on the left of reply,if it helps.

http://www.sap4.com/wiki/index.php/BAPI_SALESORDER_CHANGE

Read only

Former Member
0 Kudos
635

Sorry, did not read correct.

Message was edited by: Thomas Schwarz