Skip to Content

Full Response message even during an error structure

Hello All,

When a bapi receives a bad request it returns an error  return structure and also other response tables. When the same bapi is exposed as odata service it only returns the error message.

The is the response from BAPI exposed via PI.

<REJECTED/>

  <RETURN>

  <TYPE>E</TYPE>

  <ID>ZBAPI</ID>

  <NUMBER>016</NUMBER>

  <MESSAGE>Error message </MESSAGE>

  <LOG_NO/>

  <LOG_MSG_NO>000000</LOG_MSG_NO>

  <MESSAGE_V1/>

  <MESSAGE_V2/>

  <MESSAGE_V3/>

  <MESSAGE_V4/>

  </RETURN>

  <AWARD_DESC>

  <item>

  <SALESDOCUMENT>1234</SALESDOCUMENT>

  <ITM_NUMBER>001000</ITM_NUMBER>

  <LANGU>E</LANGU>

  <AW_DESCRIPTION>clock</AW_DESCRIPTION>

  </item>

  </AWARD_DESC>

  <AWARD_INFO>

  <item>

  <SALESDOCUMENT>1234</SALESDOCUMENT>

  <ITM_NUMBER>001000</ITM_NUMBER>

  <SHIP_DATE>0000-00-00</SHIP_DATE>

  <SCHED_DATE>2014-12-11</SCHED_DATE>

  <CARRIER/>

  <TRACKNUM/>

  <ZZMFGSTAGE/>

  <ZZSELCODE>009</ZZSELCODE>

  <AWARD_DESC>clock</AWARD_DESC>

  </item>

  </AWARD_INFO>

The same BAPI when called as an odata service

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code>SY/530</code>

<message xml:lang="en">

Purchase order has been created, must call purchasing to change

</message>

<innererror>

<transactionid>54A769B51AE2C753E10000000A64D168</transactionid>

<timestamp>20150112231744.3776590</timestamp>

<Error_Resolution>

<SAP_Transaction>

Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details

</SAP_Transaction>

<SAP_Note>

See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)

</SAP_Note>

</Error_Resolution>

<errordetails>

<errordetail>

<code>ZBAPI/016</code>

<message>

Purchase order has been created, must call purchasing to change

</message>

<propertyref/>

<severity>error</severity>

</errordetail>

<errordetail>

<code>ZBAPI/016</code>

<message>

Purchase order has been created, must call purchasing to change

</message>

<propertyref/>

<severity>error</severity>

</errordetail>

<errordetail>

<code>/IWBEP/CX_SD_GEN_DPC_BUSINS</code>

<message>

Purchase order has been created, must call purchasing to change.

</message>

<propertyref/>

<severity>error</severity>

</errordetail>

</errordetails>

</innererror>

</error>

It skips the AWARD_DES and AWARD_INFO table.

This happens only when there is a return structure. If there is no return structure it gives a proper response. Is there a way to receive a response as the one returned via PI.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 13, 2015 at 05:25 PM

    Hello Rahul,

    If its s POST Operation,

    You need to add AWARD_DES and AWARD_INFO  as different entities in the GW Model as well.

    Now Create Association & Navigation between the Header Entity and AWARD_DES, AWARD_INFO entities with cardinality 1 to N.

    Also Create Association & Navigation between the Header Entity and the entity created for the Error Table with cardinality 1 to N.

    Implement Create_Deep_Entity method in DPC_EXT class.

    Create a Deep Structure and fill all the table details including the error messages & send back response to GW.

    This way you can see all the details including error table in the response.


    Have a look at here to get an idea and implement your scenario accordingly :


    Step by Step development for CREATE_DEEP_ENTITY operation


    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded