Exception Document for Return Tables
Return tables consist of one or more rows that have the same structure as a return structure. If the return table contains at least one message of type E (error) or A (abort), an exception business document is returned to the client that has the structure of a collection exception. This exception is named BapiError or BapiAbort depending on whether the most critical message in the return table is of type E or A.
The collection exception is identified by a standardized message which is similar for all return tables. The messages of the return table are displayed within the <Collection> element of the collection exception, which is a sub-element of the <Attributes> element.
Each single message of type E or A is displayed as an exception that is grouped within the <Collection> element in the form of a table. Single messages are displayed as exceptions in an exception table in accordance with the specification Serialization of ABAP Data in XML. Consequently, each exception is encapsulated in an <item> element that contains the exception data.
If, despite the error messages, the return table contains additional messages of type S, I, or W, these messages are displayed in a table of row type BAPIRET2 within a <Status> element, which is a sub-element of the <Attributes> element.
If a BAPI return table contains error messages, the following XML-elements comprise the resulting exception business document:
XML Element | Corresponding Information from the Return Parameter |
<Name> | „BapiError", if value of field TYPE is „E". „BapiAbort", if value of field TYPE is „A". |
<Message> (0..1) <ID> <Number> <Text> | The three sub-elements contain a generic message that is used for all return tables (for example: "During the execution of the BAPI one or more errors occurred"). |
<Attributes> <Collection> <item> <Name>…</Name> <Message>…</Message> <Attributes> (optional) ... </Attributes> </item> <item> (optional) ... </item> ... </Collection> | XML representation of each error message within the return table. Within the <item> elements, the data of a single return message is displayed as a serialized exception object. |
<Status> (optional) <item> <ID> (optional) <TYPE> (optional) <NUMBER> (optional) <MESSAGE> (optional) <MESSAGE_V1> (optional) <MESSAGE_V2> (optional) <MESSAGE_V3> (optional) <MESSAGE_V4> (optional) <LOG_NO> (optional) <LOG_MSG_NO> (optional) <PARAMETER> (optional) <ROW> (optional) <FIELD> (optional) <SYSTEM> (optional) </item> <item> (optional) … </item> … </Status> | The <Status> element contains a serialized table with row type BAPIRET2. Within the <Status> element, all return messages of type S, I, or W that are also returned in the BAPI return parameter are displayed. |