Skip to Content
0
Former Member
Nov 15, 2011 at 05:21 AM

Issue with defaulting Business Partner Role while BP Creation

291 Views

Hi,

I am having a simple requirement that while creating any contacts, the Business Partner role and authorization group will be defaulted.

Now 1st was trying to wrtite code in the enhancement spot : CRM_UIU_BP_ENHANCEMENT --> badi CRM_BP_UIU_SAVE --> Method ON_SAVE_EVENT (Event handler for save event ). But sometimes it is triggered, some times not. When it it triggered, transaction is giving a dump.

Again, I tried to write code in badi BUPA_GENERAL_UPDATE. There also, I am getting the same error " The COMMIT WORK processing must not be interrupted. "

I am writing this code in the method :

*Call this BAPI to fill the memory
    CALL FUNCTION 'BAPI_BUPA_CENTRAL_CHANGE'
      EXPORTING
        businesspartner = ls_but000-client.


  CALL FUNCTION 'BUP_MEMORY_BUT000_GET'
    EXPORTING
      iv_partner      = ls_but000-partner
    IMPORTING
      es_but000       = ls_bus000_upd
    EXCEPTIONS
      not_found       = 1
      parameter_error = 2
      OTHERS          = 3.

  IF ls_bus000_upd-augrp IS INITIAL.
    ls_bus000_upd-augrp = '9000'.

  ENDIF.
*
*   Populate new BUT000 data
  CALL FUNCTION 'BUP_MEMORY_BUT000_FILL'
    EXPORTING
      is_but000       = ls_bus000_upd
    EXCEPTIONS
      parameter_error = 1
      OTHERS          = 2.

I can't understand why this dump is coming? Please help if there is any other way to defaulting roles..