How To Mark Business Partner For Deletion with BUPA_CENTRAL_CHANGE

In order to mark a business partner for deletion, the BUPA_CENTRAL_CHANGE BAPI is used

Simply provide the necessarry variables and call the BAPI

  DATA: lt_return TYPE STANDARD TABLE OF bapiret2,
        ls_data   TYPE bapibus1006_central,
        ls_datax  TYPE bapibus1006_central_x.


  ls_data-centralarchivingflag  = 'X'.
  ls_datax-centralarchivingflag = 'X'.

  CALL FUNCTION 'BUPA_CENTRAL_CHANGE'
    EXPORTING
      iv_partner = iv_partner
      is_data    = ls_data
      is_data_x  = ls_datax
    TABLES
      et_return  = lt_return.

And commit yoru work if no error is returned from the BAPI

  IF lt_return IS INITIAL.
    CALL FUNCTION 'CRM_STATUS_UPDATE_ON_COMMIT'.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.

    CALL FUNCTION 'CRM_STATUS_BUFFER_REFRESH'.
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  ENDIF.

In order to unmark the deletion, simply provide the central archiving flag with a space

  ls_data-centralarchivingflag  = space.
  ls_datax-centralarchivingflag = 'X'.

 

ABOUT Furkan Sönmez

www.linkedin.com/profile/view?id=122521475

RELATED POSTS

COMMENTS

comments powered by Disqus