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_BPCONTACT_DELETE

0 Kudos

Hi !

I want to delete BPCONTACT using BAPI but i was a problem in the first BAPI which i called :

BAPI BAPI_BPCONTACT_DELETE :


CALL FUNCTION 'BAPI_BPCONTACT_DELETE'
     EXPORTING
       SENDER                = LV_SYS
*      TESTRUN               = 'X'
     TABLES
       SALESACTIVITYID       = LT_DATA
       RETURN                      = LT_RETURN
     EXCEPTIONS
       OTHERS                      = 1.


LT_DATA :

      SYS                  OBJTYP        DOC_NUMBER

1    T68CLNT100      BCONTACT    2346794736

2    T68CLNT100      BCONTACT    2346794722

After execution the table LT_RETURN is empty. I don't know why !

LT_DATA-DOC_NUMBER existing in talbe VBKA. When i put a non-existing LT_DATA-DOC_NUMBER LT_RETURN is still empty.

Can you help me ? Thanks you !

1 ACCEPTED SOLUTION

Problem solved !

After debug session on BAPI i find a weird thing :

There is a control on the LT_DATA - OBJECTTYPE fields where it must be equal to a constant.

The constants is gc_this_objecttype declared on L1037TOP.

Value is BUS1037.


So i just make ls_data-OBJECTTYPE = 'BUS1037' on my loop before call BAPI and it's works !


Then you should call BAPI_BPCONTACT_SAVEFROMMEMOR,  BAPI_TRANSACTION_COMMIT.

control on each entry on LT_DATA-OBJECTTYPE equal a constants


2 REPLIES 2

Problem solved !

After debug session on BAPI i find a weird thing :

There is a control on the LT_DATA - OBJECTTYPE fields where it must be equal to a constant.

The constants is gc_this_objecttype declared on L1037TOP.

Value is BUS1037.


So i just make ls_data-OBJECTTYPE = 'BUS1037' on my loop before call BAPI and it's works !


Then you should call BAPI_BPCONTACT_SAVEFROMMEMOR,  BAPI_TRANSACTION_COMMIT.

control on each entry on LT_DATA-OBJECTTYPE equal a constants


0 Kudos

Can I use this function module to delete Vendor contact person?

If yes, where should I pass the vendor number and corresponding contact person number(KNVK-PARNR)?.