cancel
Showing results for 
Search instead for 
Did you mean: 

How/where to add Payment Card during or before or after SAVE (BAdI)

Former Member
0 Kudos

Hello Experts,

We are on CRM 2007.

Our requirement is to add a dummy payment card to a Business Patner during/before/after SAVE.

It should work if we create a Business Partner from either BP transaction or CRM IC Web UI.

Which BAdI can I use to write the code ?

Also, sample code if you have any please

Regards,

Sree

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sree,

Since you want to trigger this operation on the save of a business partner, you need to look for a Business Partner BADI, not a payment card BADI.

The best BADI here is PARTNER_UPDATE. This will be called when a BP is saved - from transaction BP or Web UI, or even other applications - any way.

In general, PARTNER_UPDATE is used to trigger any operation after the save of a BP.e.g : data exchange, synchronization, updates meant to be sent to other applications, etc.

In this case, you can create the payment card within the implementation of PARTNER_UPDATE. Possibly you can use the payment card BAPIs for this, namely BUPA_PCARD_ADD, etc.

Hope this helps you.

Cheers,

Rishu.

Former Member
0 Kudos

Thanks Rishu.

I have already tried this option but not luck neither.

I got the error Business Partner doesn't exist message in BAPI BUPA_PCARD_ADD call

Former Member
0 Kudos

Hi Sree,

How did you get the BP number to which you are trying to add the card ? In change mode, you might know the BP number from before, but in create mode, it will be different..

If you are trying to create the PCARD during CREATION of the BP, you would need to first call the FM BUPA_GENERAL_CALLBACK to get the BUT000 details, which will give you the partner number which exists in memory, but is not yet created on the database.

Using the BP number obtained from the mentioned FM, you can call BUPA_PCARD_ADD.

Another solution :

You can implement the EVENT CREATED of Business Partner object. To have a look at this, look at transaction swo1 (oh - not zero). Give object = BUS1006. Look under 'Events'. These are some events triggered during various points in BP creation / change, etc. - this is also solve the problem.

Cheers,

Rishu.

Former Member
0 Kudos

Hi Rishu,

I have already tried exactly what you said.

In PATNER_UPDATE BAdI, I used BUPA_GENERAL_CALLBACK to get the partner number and tried calling BUPA_PCARD_ADD.

As I said before, I'm getting Business Partner doesn't exists error in FM BUPA_PCARD_ADD call.

If possible can you try from your end too ?

We are trying not to go for EVENTS.

Thanks and Best Regards,

Sree

former_member562530
Active Participant
0 Kudos

Hi Sree,

Please try to implement the BADI BUPA_CCARD_IMPORT, using transaction SE19.

Unfortunately I do not have code examples for you, however it seems to be a quite simple code: all you have to do is fill the exporting parameter "ET_BUT0CC".

I hope it helps.

Best Regards,

Gabriel Santana

Former Member
0 Kudos

Thank you Gabriel.

I will try and come back to you.

Former Member
0 Kudos

Gabriel,

I've created a implementation but it didn't work.

Problem is when I put a breakpoint, control doesn't even stop in my implementation though it is active.

Former Member
0 Kudos

Hello Forum, can any one help me here ?

former_member562530
Active Participant
0 Kudos

Hi Sree,

Please check the MF CRM_PAYPLAN_DEFAULT_CCARD_EC, it insert payment card for business partners... You can reuse the code in BADI ORDER_SAVE in order to add payment cards during save BP's.

Regards,

Gabriel Santana

Edited by: Gabriel Santana on Jun 19, 2009 3:24 PM

Former Member
0 Kudos

Thanks Gabriel.

But I doubt this will work for Business Partners as it was meant for transactions related process

former_member562530
Active Participant
0 Kudos

Hi Sree,

Sorry about the mistake... Please try to use the MF BAPI_BUPA_PCARD_ADD.

Regards,

Gabriel