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: 

Deleting contract accts to delete Business partner using BUP_BUPA_DELETE

Former Member
0 Kudos
215

Hi,

I am trying to delete business partner data in one of the clients.

Function module used is BUP_BUPA_DELETE.

Still some Business partners do not get deleted. I tried to do analysis and found following:

Internally the function module uses:

FORM event_dele1 tables    it_tbz1f       structure tbz1f
                           it_val         structure bus0range
                           iT_DIF_VAL     structure bus0ranged
                           ct_delete      structure bussdelyes
                           ct_not_delete  structure bussdelno
                           et_results     type bapiret2_t
                 using     iv_with_log    type boole_d
                           iv_log         type balloghndl
                           iv_xdele       type boole_d
                           iv_diff0       type boole_d
                 changing  ev_fatal_error type xflag.

*------ Lokale Datendeklarationen --------------------------------------
  DATA: LT_DELETE     LIKE GT_DELETE OCCURS 0 WITH HEADER LINE,
        LT_NOT_DELETE LIKE GT_NOT_DELETE OCCURS 0 WITH HEADER LINE,
        ls_result     type bapiret2,
        lt_return     type standard table of bus_return,
        ls_return     type bus_return.

  clear et_results.

LOOP AT it_TBZ1F WHERE ZTPKT = 'DELE1'.
    CHECK NOT it_TBZ1F-FNAME IS INITIAL.
    REFRESH LT_DELETE.
    REFRESH LT_NOT_DELETE.

    CALL FUNCTION it_TBZ1F-FNAME
      EXPORTING
        I_XDELE         = iv_xDELE      " Archivierkennzeichen
        I_GENEDATA      = iV_DIFF0   " allgemeine Daten
      TABLES
        T_GT_VAL        = iT_VAL
        T_GT_DIF_VAL    = iT_DIF_VAL
        T_GT_DELETE     = LT_DELETE
        T_GT_NOT_DELETE = LT_NOT_DELETE.


    LOOP AT LT_DELETE.
      cT_DELETE = LT_DELETE.
      APPEND cT_DELETE.
    ENDLOOP.

    LOOP AT LT_NOT_DELETE.
      cT_NOT_DELETE = LT_NOT_DELETE.
      APPEND cT_NOT_DELETE.
      move-corresponding lt_not_delete to ls_result.
      append ls_result to et_results.
      if iv_with_log is not initial.
        move-corresponding lt_not_delete to ls_return.
        append ls_return to lt_return.
      endif.
    ENDLOOP.

Now as soon as it_TBZ1F-FNAME = FICA_GPART_EVENT_DELE1., the LT_NOT_DELETE table gets populated with LT_NOT_DELETE-Text = Contract Accts with this Partner Still Exist.

How can I delete contract accounts, so that I can delete the BP related to above Business partners ?

1 REPLY 1

Former Member
0 Kudos
126

How do I delete contract account (transaction to view contract account is CAA2) ?