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

BAPI_BPCONTACT_DELETE Start processing of reference object

Former Member
0 Likes
676

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

2 REPLIES 2
Read only

0 Likes
621

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)

Read only

0 Likes
621

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.