SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Create contract account automaticly after creating BP

l_molenaar
Participant
0 Kudos

Hallo all,

We want to create the contract account automaticly after create the business partner.

So after entering the data in FPP1 and pressing save we want to automaticly create the contract account based on the sample of the contract account type/category.

Creating the contract account using bapi: BAPI_CTRACCOUNT_EASYCREATE isn't the problem, the problem is that we don't know where to add the code.

Could someone please help me where to tell where the best place will be to add the creating of the contract account?

Thanks a lot in advance,

Greetings Lukas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

There are 3 user-exits that get called during BP creation which could possibly be used for CA creation.

EMDBP001  IS-U: Business Partner: Duplicate Check

EMDBP002  IS-U: business partner: data conversion BP -> SD custom

EMDBP005  IS-U: Business Partner - Concession Card

View solution in original post

3 REPLIES 3

Former Member
0 Kudos

There are 3 user-exits that get called during BP creation which could possibly be used for CA creation.

EMDBP001  IS-U: Business Partner: Duplicate Check

EMDBP002  IS-U: business partner: data conversion BP -> SD custom

EMDBP005  IS-U: Business Partner - Concession Card

william_eastman
Advisor
Advisor
0 Kudos

Lukas:

There are other ways to approach this.  You could use FOP with an initial screen.  You could use the MDG and provide a front end to enter the required data.

regards,

bill.

l_molenaar
Participant
0 Kudos

  Hello All,

In the end i've found so called 'BDT Events' that is triggered using table: TBZ1F.

Here i've added the following record:

OBJCN           BUSS

ZTPKT           DSAVE

OBJAP           BUPA

POSNR           9000001

FNAME           ZFICA_CONTRACT_CREATE

APPLI            MKK

Basicly what i do in this Z function module is the following

* Get the Bp's

    CALL FUNCTION 'BUP_BUPA_BUT000_GET'
      TABLES
        et_but000 = lt_but000.

*  Get the assigned roles

    CALL FUNCTION 'BUP_BUPA_BPROLES_GET'
      TABLES
        t_bproles = lt_roles.

     READ TABLE lt_roles TRANSPORTING NO FIELDS WITH KEY role = 'MKK'.
    CHECK sy-subrc IS INITIAL.
    READ TABLE lt_roles TRANSPORTING NO FIELDS WITH KEY role = 'ZSPON'.
    CHECK sy-subrc IS INITIAL.

* Create the contract account (in background due to error's in online processing)

     CALL FUNCTION 'BAPI_CTRACCOUNT_EASYCREATE'
      IN BACKGROUND TASK
      EXPORTING
        ctraccreateinfo    = ls_ctraccreateinfo
        ctracdetail        = ls_ctracdetail
      IMPORTING
        contractaccount    = e_vkont
      TABLES
        ctracpartnerdetail = lt_ctracpartnerdetail
        return             = et_return.

I hope this might help others as wel!

Thanks a lot for your help.

Greetings Lukas