Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

issuing error message from BAdI during BDT processing

Former Member
0 Likes
1,705

Hello there,

I am issuing an error message from a BAdI in the CRM (v4.0, WAS 6.20) Business Partner (BP) transaction. The error message is displayed fine, but when the message is displayed more than once the application fails with a short dump.

Runtime Errors         ITAB_DUPLICATE_KEY
       Occurred on     14.03.2008 at 12:00:21


There is already a line with the same key.


Error in ABAP application program.

The current ABAP program "CL_GEOOBJECTCONTAINER=========CP" had to be
 terminated because one of the
statements could not be executed.

If I change this to warning or info message then the application works as expected. However the requirement is that this is displayed as error.

I am using BAdI BUPA_GENERAL_UPDATE method CHANGE_BEFORE_UPDATE. I suspect this has something to do with the fact that I am not displaying my message as part of normal BDT processing, but instead interrupt the processing with my own message. I have also checked numerous events from the BDT as an alternative, but the downside is that I can not access any of the global declarations, as I need BP number or GUID so I can perform my checks. I can create my own custom FM inside its own function group, but that won't give me access to any of the globals. The BAdI has to be triggered after the SAVE button has been pressed.

So my 2 options are:

1. find a BAdI that's processed earlier on in the SAVE processing that works with an error message - does anyone know of any?

2. find a way to get the BDT working so I can issue an error without subsequent short dump. I've tried experimenting with FM BUS_MESSAGE_STORE, which is used by other BDT transactions, but this always results in the message being displayed with a Cancel button, which then simply ends the BP transaction. Has anyone on here manged to get BDT working for only an additional message (no new fields or screens.... I have read the BDT documentation and the cookbook!!)

Kind regards,

Michael

Edited by: Michael Koch on Mar 17, 2008 2:49 PM

Edited by: Michael Koch on Mar 17, 2008 2:53 PM

1 REPLY 1
Read only

Former Member
0 Likes
1,069

I managed to resolve the issue myself by grabbing the partner number from higher up in the call stack. Like this:

https://forums.sdn.sap.com/click.jspa?searchID=9822609&messageID=4908829

So I am now using a custom Z* function module that's defined in the BDT event for checking the field contents in the BP transaction (FM ZBUP_BUPA_EVENT_DCHCK, to be processed right after BUP_BUPA_EVENT_DCHCK - assign it in area menu BUPT). From there I am triggering my error message and this doesn't make transaction BP short dump anymore.

Regards,

M

Edited by: Michael Koch on Mar 17, 2008 5:04 PM