cancel
Showing results for 
Search instead for 
Did you mean: 

Different behaviour of BAPI's inside BADI when triggered from WEB UI and SAP GUI

Former Member
0 Kudos

Hi All,

Requirement:

When ever a new bank account is added to a BP then I need to set the previously added bank account's valid to date to sy-datum -1 and add the new bank account on business agreement present on BP.

My Solution:

1. Use BUPA_BANK_CALLBACK FM to get the added bank data inside BADI BUPA_BANK_UPDATE~CHANGE_BEFORE_UPDATE method as it gets called from both WEB UI and GUI.

2. change old banks valid to date using FM: BAPI_BUPA_BANKDETAIL_CHANGE.

3. add the bank to the business agreement by calling FM BAPI_BUPA_FRG0130_CHANGE in update task, Why update task? because if I use the same FM without update task then it throws an error that the bank id I am trying to assign to business agreement doesn't exist.

Problem:

My approach works fine in case of GUI but when same BADI is triggered from WEB UI the BAPI's I have used inside this BADI give different result than what they gave when ran from GUI side.

1. BUPA_BANK_CALLBACK FM gives all the bank account in old table and all the bank accounts along with new bank a/c added in new table while when executed from GUI side BUPA_BANK_CALLBACK gives no result in old table and only newly added account in new table. This can be the case because when called from WEB UI BOL buffer is loaded and FM picks from buffer.

2. FM BAPI_BUPA_FRG0130_CHANGE gives error that the BP is locked by me.

3. FM: BAPI_BUPA_BANKDETAIL_CHANGE gives error( no specific error just that error occurred while call to this FM ) while changing bank validity when called from WEB UI but not when called from GUI.

Please suggest why same FM's behave in a different manned when called from WEB UI and GUI inside a BADI.

Thanks in advance.

Vijay

Accepted Solutions (0)

Answers (1)

Answers (1)

nicolas_busson
Active Contributor
0 Kudos

Hi Vijay,

Are you running CRM standalone? Because if not, what will happen if a bank account is added in ECC? Are you planning to code the same kind of automatic updates? (because that would mean a lot of troubles when Bdocs will be created in both systems at the same time).

So maybe, if you didn't do so already, could you suggest to your end users to use the IC_PAYMENT webui component (or something equivalent for non-ic business roles): this is a component where you can display/add/delete bank accounts for a given BP, and use checkboxes to flag those business agreements where it should be used as payment or refund. And the good news: the system will handle the case where the bank account is used in a BuAg from another partner ("alternative" payer case).

What do you think?

Best regards

Nicolas.