2015 May 26 12:53 PM
Hi all
I wrote a function module that wraps the BAPI_BPCONTACT_DELETE function module that looks like:
function zsd_delete_contact.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(SENDER) LIKE BAPI_SENDER STRUCTURE BAPI_SENDER
*" VALUE(TESTRUN) LIKE BAPI_VBKA_MISC-TESTRUN DEFAULT SPACE
*" TABLES
*" SALESACTIVITYID STRUCTURE BAPI_VBKA_BOID
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
*"----------------------------------------------------------------------
data ls_return type bapiret2.
call function 'BAPI_BPCONTACT_DELETE'
exporting
sender = sender
testrun = testrun
tables
salesactivityid = salesactivityid
return = return.
" If errors occur
read table return into ls_return
with key type = 'E'.
if sy-subrc = 0.
return.
endif.
call function 'BAPI_BPCONTACT_SAVEFROMMEMORY'
tables
return = return.
" If errors occur
read table return into ls_return
with key type = 'E'.
if sy-subrc = 0.
return.
endif.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
importing
return = ls_return.
append ls_return to return.
endfunction.Then when I try to delete a contact, then I've got the message:
What am I doing wrong?
Thanks
2016 Jul 20 2:05 PM
Hello !
What is your value of OBJECTTYPE in salesactivityid entries ?
Can you try to set salesactivityid-OBJECTTYPE = 'BUS1037' for each entries ?
I see 2015 post entry but maybe can help for others ! (ps: sorry for my english)
2020 Sep 15 7:53 PM
Can I use this function module BAPI_BPCONTACT_DELETE to delete a vendor contact person?
If yes, in the SALESACTIVITYID-DOC_NUMBER should I pass the Partner number(KNVK-PARNR) ?
I did the same by passing PARNR and nothing happened. please help me.