on 2014 May 15 9:56 AM
Hi there,
currently we have a scenario where the message come from middleware and pass through PI to POSDM system via RFC.
my target structue is an BAPI .
for some reason if the BAPI execution gets failed on POSDM system then the BAPI should return some exception back to PI system,
can this be achived only by just adding the fault message type (ExchangeFaultData) in Inbound MI, whill this setting sufficient to get any error info from BAPI to PI via rfc, or do we need to do some exception mapping? if so can some one explain/
.
Request clarification before answering.
No it can't be achieved 'just by adding fault' as long as you want to make use as target interface BAPI since BAPI does not allow exceptions.
/Jakub
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jakub,
Normally if we do not want hardcoded exceptions then we use the export parameters of BAPIRETURN in BAPI. They was visible as the checked flag in SXMB_MONI.
But there are certain requirements of the client where they strictly want exception and need to raise a red flag and not the checked flag in MONI. That is where we use exceptions and not export parameters.
Hi Sethuraman,
You will only get those exceptions in the PI which are mapped/created in the BAPI under the exceptions tab. If any of the exception is not listed under the exception tab of BAPI, the will not be get back to PI as a fault message.
So do correct exception mapping for all the exceptions that you want to raise in the BAPI with the help of ABAP guys if it a custom BAPI.
If you are using a standard one, call the same into your custom BAPI and then raise exceptions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Monika,
RFM that pretends to be a BAPI has to follow a few strict rules. Some of them are :
- BAPI is called always synchronously and are always successful i.e. errors are returned in EXPORT parameter (so no matter if BAPI created some document/posting or not is successful!)
- it does not return exceptions!
so you should not advise to make use exceptions ... otherwise it will not be a BAPI
The one of possible solution is to wrap BAPI either using proxy or RFM and then you can propagate exceptions to SAP PI.
/Jakub
Hi Tamilarsan,
Yes, you should to map the exception as well.
Personally, i don't like to work with the exception tab, i prefer to control the functional errors in the RFC with an structure type bapireturn, in the RFC export parameters. Obviously, i need sometimes to wrap the standard function with a Z one.
Regards.
Hi Sethuraman,
First please let me know which output of BAPI you want to use. Whether you are getting something in the exporting parameters like in standard BAPI's we get BAPIRETURN or you have certain hardcoded exceptions i.e. if this is the issue raise this or if that is the issue raise that.
In the first case, no need to use exceptions. Just map the exporting parameters of your BAPI with the Output/Response structure.
In the second case, make a separate message mapping apart from request and response message mapping. In this exception message mapping map the exception parameters of BAPI (source) with the exchange Fault data MT (target). Map the name parameter of BAPI with the fault text of the target MT. Then in operation mapping, you will get three tabs- request, response and fault. Assign the message mapping accordingly.
Hello,
I assume you have modified SAP standard BAPI by adding exception NB. that is not BAPI any more.
The MM an IM you did is ok, however, you need to modify FM to 'throw' exception.
I still encourage you to either make use proxy or RFM that wrap standard SAP BAPI instead the solution you went for ... in future during upgrade it might stop working ...
/Jakub Turmiński
Hi Sethuraman,
Jakub is correct that you should not modify standard BAPI (i.e should not add exceptions in it). I have suggested in the previous posts that if you want to add exceptions, please create a remote function module and then call the standard BAPI in it.
It will work fine and will not event create problems during upgrade.
User | Count |
---|---|
77 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.