RFC BAPI Call from BODS not returning E_MESSAGE_TABLE

I am attempting to create a project definition (which I know will error due to the fact that it already exists) via an RFC BAPI call from Data Services. There are two bits of information that should be returned from the call. One is the “RETURN” export parameter; the other is the E_MESSAGE_TABLE—this contains the specific error details. When I call the BAPI via SE37 in SAP ECC I receive the RETURN information as well as the specific error messages contained within the E_MESSAGE_TABLE. The two screenshots displaying the SE37 return information are the first three screenshots below.

When I attempt to call the identical BAPI with the same exact data, I do not get the error details in the E_MESSAGE_TABLE (I have unnested this table in a query immediately after the query in which I call the BAPI), I only get one record which has NULL values for each of the fields in that table. I am not attempting to return the “RETURN” parameter but it still shows up in the “Error” tab of the job monitor. I think the fact that the job is experiencing this RETURN error is the causing the SAP-BODS connection to fail and thus is not loading the E_MESSAGE_TABLE. See screenshots 4-7.

When I try to create a project definition which I know will succeed (it has working data), the E_MESSAGE_TABLE is populated as expected with all of the individual success messages. See screenshot 8.

Edit: I can’t add more than 3 screenshots per post and it will not let me reply to my own message.
3.jpg
2.jpg
1.jpg


Flyers103187 (BOB member since 2012-05-09)

I have seen this behaviour, but have not found a clue why this is happening.

Some BAPI’s return an error in the BODS error log, some BAPI’s give decent output in a table.

I.e. BAPI_IBAN_CREATE also writes to the error log. With this BAPI the load continues even when there were errors. So 100 IBAN’s offered to SAP via the BAPI and I have 2 errors, then 98 are loaded.


Johannes Vink :netherlands: (BOB member since 2012-03-20)

I believe the root cause of the difference is if the SAP function module does throw an exception or not.
If there is an exception the error is returned by the RFC library with no other data, from SAPGUI you bypass the RFC library and there you will see both.

Per definition all exceptions in BAPIs should be caught and returned as informational entries somehow, and that is, by return parameters.


Werner Daehn :de: (BOB member since 2004-12-17)

I figured it out. I had to remove all of the “import RETURN” code in the BAPI. Once that was off, BODS stopped receiving and error and the connection to SAP would continue even when messages were posted to the E_MESSAGE_TABLE.

I figured it out by looking at another BAPI, BAPI_INSPECTIONPLAN_CREATE, which DID post all error messages to the table. This BAPI did not have the “import RETURN” functionality so it was not throwing and exception.


Flyers103187 (BOB member since 2012-05-09)