Skip to Content
0
Oct 23, 2019 at 06:10 PM

How to display ODATA read Exception via callback

113 Views

Hello All,

When I try to do a odata.read with the below code with right date and company code in the ODATA with the right path( PostingPeriodSet(Ccode='XXX',postdate='20201024') it works fine .

var oModel = that.getView().getModel();
oModel.read("/" + sObjectPath, {
                                        success: function(oData) {
						this.getView().byId("input0").bindElement({
							path: ("/" + sObjectPath),
							events: {}
						});
					},
					error: function(oError) {
						MessageToast.show("oError");
					}
				});

But when a wrong date is posted ODATA will raise an exception which I am not sure how to display it through call back function in the application .

Support would be of great help .

Exception : The Exception is raised as below

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>F5/201</code>
<message xml:lang="en">
Posting period is not open. Diagnosis Period of fiscal year is not open for posting for the variant of posting period . System Response Processing cannot be continued. Procedure The error can have several causes. In order to eliminate the error, proceed as follows: Check whether the posting date was entered correctly. The system determines the posting period by means of the date. Check whether the required posting period is open for posting for the variant of posting period and account type . Make sure that the period is open for posting. To do this, specify a period interval in which the required period for the variant of posting period and account type is contained. You make these settings in Customizing of Financial Accounting (New) under Financial Accounting Global Settings (New) -> Ledgers -> Fiscal Year and Posting Periods - > Posting Periods -> Open and Close Posting Periods.
</message>

<innererror>
<application>
<component_id/>
<service_namespace>/SAP/</service_namespace>
<service_id>ZMF_STD_JV_SRV</service_id>
<service_version>0001</service_version>

</application>


<transactionid>15A491832E480080E005D7A6F9661BDC</transactionid>
<timestamp>20191023132926.8153270</timestamp>
<Error_Resolution>
<SAP_Transaction>
For backend administrators: run transaction /IWFND/ERROR_LOG on SAP 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>/IWBEP/CX_MGW_BUSI_EXCEPTION</code>
<message>Posting period is not open</message>
<propertyref/>
<severity>error</severity>
<target/>

</errordetail>



</errordetails>



</innererror>



</error>