2013 Jan 28 3:37 PM
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
2013 Jan 28 4:09 PM
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
2013 Jan 28 4:09 PM
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
2013 Jan 28 10:32 PM
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.
2013 Jan 30 7:15 AM
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