04-27-2010 4:58 AM
Hi Experts,
I have two SAP systems A and B. An ABAP program in system A calls Function module in System B.
System B returns any error with message id, class and variables in the event of any invalid data.
How to handle this returned error message in system A when the message class exists only in system B.
One way is to create a copy of this message class along with all the messages in system A.
But the function module in system B calls many BAPIs which in turn may return messages from many different message classes. So making a copy of so many message classes in System A means creating so many custom objects.
Is there any better way to handle this without creating the message classes in System A?
Thanks & Regards
Gopal
Edited by: gopalkrishna baliga on Apr 27, 2010 6:28 AM
04-27-2010 5:49 AM
Hi Gopal,
As per my understanding your function module can retrun any number of error messages and it may have varied descriptions.It would be difficult to handle each of these error individually.
One of the methods can be..use the raise exception otion whenever any error is encountered if you want to do in the shortedt way.
you can catch all th set of error in soem exceptions and then use the same.
Handling each error individually in the source system would be difficult if these errors do not exisit in the source system at all.
04-27-2010 6:27 AM
Hello,
In which structure is the RFC returning the messages & is this a custom RFC ?
If the messages are returned via BAPIRET1 (you can check other BAPIRET* structures in SE11) they have the field MESSAGE which will store the message text.
If the RFC is custom you can add the FM 'BALW_BAPIRETURN_GET1' to convert the messages into BAPIRET1 structure.
BR,
Suhas