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

how ro send error message from BADI to BAPI

Former Member
0 Likes
543

i have a BADI which is triggered from a BAPI.This BADI method has only importing and changing parameters.How can i send error message to BAPI.Please reply at the earliest.

High points can be expected.

i have a BADI which is triggered from a BAPI.This BADI method has only importing and changing parameters.How can i send error message to BAPI.Please reply at the earliest.

High points can be expected.

3 REPLIES 3
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
475

Hi Arshi,

look up "Exception Handling". You can start with http://help.sap.com/saphelp_nw70/helpdata/EN/cf/f2bbc8142c11d3b93a0000e8353423/frameset.htm

There are also several blogs that demonstrate exception handling as well.

Cheers

Graham Robbo

Read only

Former Member
0 Likes
475

thanks got it

Read only

uwe_schieferstein
Active Contributor
0 Likes
475

Hello Arshi

The answers could be more specific if you were more verbose:

Which BAPI and Which BAdI?

I assume both are standard (not custom objects). I would not expect that BAdI methods have exceptions (either standard or class-based). If so then you can use the normal mechnisms to raise such an exception:


MESSAGE ...
       RAISING <name of exception>.  " classic

RAISE EXCEPTION TYPE <name of exception class>
  ...

More likely the method may have a (CHANGING) parameter like CH_FAILED (see BAdI ME_PROCESS_PO_CUST: interface IF_EX_ME_PROCESS_PO_CUST, method CHECK):


CH_FAILED = 'X'.  " error in BAdI method

Regards

Uwe