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_CHANGE

Former Member
0 Kudos
286

Dear Expert,

My requirement is change the Sales Activity (From "VBKA" Table) status by using the BAPI "BAPI_BPCONTACT_CHANGE", But i am unable to change the Status by this Bapi.

Please sugest if this bapi is not for status change.

Thanks in Advance.

4 REPLIES 4

Former Member
0 Kudos
116

Hi,

These are sale activity related Bapi

BAPI_BPCONTACT_ADD_TO_ASGN BAPI Partner Sales Activity ddToAssigned BAPI_BPCONTACT_CHANGE BAPI Change Partner Sales Activity BAPI_BPCONTACT_CREATEFROMDATA BAPI Partner Sales Activity Create from Data BAPI_BPCONTACT_CREATEWITHDIA BAPI Partner Sales Activity - Create from Data Dialog BAPI_BPCONTACT_DELETE BAPI Delete Partner Sales Activity BAPI_BPCONTACT_GETDETAIL BAPI Partner Sales Activity - Get Details BAPI_BPCONTACT_GETLIST BAPI Partner Sales Activity - Get List BAPI_BPCONTACT_REMOVEFROM_ASGN BAPI Partner Sales Activity RemoveFromAssigned

BAPI_BPCONTACT_REPLICATE BAPI Partner Sales Activity Replicate BAPI_BPCONTACT_REPLICATECHANGE BAPI Partner Sales Activity Replicate Changed Objects

BAPI_BPCONTACT_SAVEFROMMEMORY BAPI Partner Sales Activity - Save from Memory

BAPI_BPCONTACT_SETTOACTIVE BAPI Partner Sales Activity - Set simulated to active

Regards,

Raj.

hardyp180
Active Contributor
0 Kudos
116

Hello

In order to create or change a sales activity you need to make three function calls in a row as follows:-

  • Off we go!

CALL FUNCTION 'BAPI_BPCONTACT_CREATEFROMDATA'

EXPORTING

sender = l_bapi_sender

TABLES

generaldata = lt_general_data

businesspartner = lt_business_partner

text = lt_text

return = lt_return.

  • Tell the system we honestly want to make this change, it's not just a joke.

CALL FUNCTION 'BAPI_BPCONTACT_SAVEFROMMEMORY'

TABLES

salesactivityidout = lt_salesactivityidout

return = lt_return2.

  • And now we we say we REALLY REALLY want to make this change, we want this SO MUCH

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Former Member
0 Kudos
116

Can somebody tell me something about this issue please? I've the same problem when i try to change the status and I don't find anything about.


Regards.

0 Kudos
116

To apply the change you need to call :

               BAPI_BPCONTACT_SAVEFROMMEMORY

between   BAPI_BPCONTACT_CHANGE

and          BAPI_TRANSACTION_COMMIT

My exemple routine to update status of contacts :


FORM TRT_BAPI.

  DATA : LV_SYS     TYPE BAPI_SENDER,

         LS_DATA    TYPE BAPI_BUS1037_VBKAKOM_UPD,

         LT_DATA    TYPE STANDARD TABLE OF BAPI_BUS1037_VBKAKOM_UPD,

         LS_DATAX   TYPE BAPI_BUS1037_VBKAKOM_UPDX,

         LT_DATAX   TYPE STANDARD TABLE OF BAPI_BUS1037_VBKAKOM_UPDX,

         LS_OUT     TYPE BAPI_VBKA_BOIDREF,

         LT_OUT     TYPE STANDARD TABLE OF BAPI_VBKA_BOIDREF,

         LT_RETURN  TYPE STANDARD TABLE OF BAPIRET2.

  DATA : LT_TABLE TYPE REF TO CL_SALV_TABLE.

  LOOP AT T_VBKA.

    CLEAR LS_DATA.

    LS_DATA-DOC_NUMBER = T_VBKA-VBELN.

    LS_DATA-STATE = P_KTAST. " Nouveau statut

    APPEND LS_DATA TO LT_DATA.

    CLEAR LS_DATAX.

    LS_DATAX-DOC_NUMBER = T_VBKA-VBELN.

    LS_DATAX-STATE = 'X'.

    APPEND LS_DATAX TO LT_DATAX.

    CLEAR LS_OUT.

    LS_OUT-DOC_NUMBER = T_VBKA-VBELN.

    APPEND LS_OUT TO LT_OUT.

  ENDLOOP.

  CALL FUNCTION 'BAPI_BPCONTACT_CHANGE'

     EXPORTING

        SENDER                      = LV_SYS

*       TESTRUN                     = ' '

*       RTF_ITF                     = ' '

      TABLES

        GENERALDATA                 = LT_DATA

        GENERALDATAX                = LT_DATAX

*       BUSINESSPARTNER             =

*       BUSINESSPARTNERX            =

*       PARTNERADDRESS              =

*       TEXT                        =

*       TEXTX                       =

*       OBJECT_REFERENCE_LIST       =

        RETURN                      = LT_RETURN

      EXCEPTIONS

        OTHERS                      = 1.

  REFRESH LT_RETURN.

  " Copie de la mémoire

  CALL FUNCTION 'BAPI_BPCONTACT_SAVEFROMMEMORY'

   TABLES

     SALESACTIVITYIDOUT       = LT_OUT

     RETURN                   = LT_RETURN

   EXCEPTIONS

     OTHERS                      = 1.

  " Application des changements

  IF sy-subrc EQ 0.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

*     EXPORTING

*       WAIT          = 'X'

*     IMPORTING

*       RETURN        = LT_RETURN2

     EXCEPTIONS

       OTHERS                      = 1.

* Affiche des retours en ALV

*     CALL METHOD CL_SALV_TABLE=>factory(

*       IMPORTING

*         R_SALV_TABLE = LT_TABLE

*       CHANGING

*         T_TABLE = LT_RETURN ).

*     LT_TABLE->display( ).

  ENDIF.

ENDFORM.

It's work for me,

Cordially