cancel
Showing results for 
Search instead for 
Did you mean: 

Full Response message even during an error structure

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

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 :



Regards,

Ashwin