cancel
Showing results for 
Search instead for 
Did you mean: 

Rolling back Business Partner creation

Former Member
0 Kudos

Have a need when a business partner is created that the first name and last name do not already exist in the system of another partner. If it does, want to:

1) Pop up a warning message and

2) Prevent the data from being saved on the database.

Warning message I figure can be popped up in a function module of the event DCHCK. But I cannot figure a way how to rollback the partner creation.

Can anyone please advise on this?

Cheers,

Tony.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anthony,

For your requirement you will have to implement the "BUPA_GENERAL_UPDATE" BAdI. The method CHANGE_BEFORE_UPDATE of this BAdI has the BP GUID.

Using this GUID use appropriate function module to extact the current BP first name & Last name. Then search for the same in the database and use function module calls to do the further processing as required.

Let me know if this helps.

Jash.

Former Member
0 Kudos

Hi Jash,

Would it be safe to use a ROLLBACK WORK in the function module? I cannot see any flag or other way of letting the system handle the rollback because the interface does not pass any paramenters back.

Cheers,

Tony.

Former Member
0 Kudos

Hello Tony,

Unless you do a Commit Work the BP will not be created in the system.

After the BP creation Function Module use Commit Work, Only when, no errors and warnings are retunred.

In our programming we have done the same way. In case of error we do an exit from code, after populating appropriate error message.

Hope this helps.

Regards,

Kapil

Former Member
0 Kudos

Hi Kapil,

Thanks for the advice, but we are using transaction BP to create the partner, not a function module.

Cheers,

Tony.