Skip to Content

How to display ODATA read Exception via callback

Hello All,

When I try to do a 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();"/" + sObjectPath, {
                                        success: function(oData) {
							path: ("/" + sObjectPath),
							events: {}
					error: function(oError) {"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="">
<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.



For backend administrators: run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details

See SAP Note 1797736 for error analysis (


<message>Posting period is not open</message>




Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 25, 2019 at 06:16 AM

    Hi Prasanna Kumar S,

    Try with the following code:

    error: function (oError) {
            var sErrMsg = "Error"				
    	if (oError.responseText) {
    		if (, "{\"error\":")) 
    		sErrMsg = JSON.parse(oError.responseText).error.message.value;					



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2019 at 07:56 AM

    Hi Prasanna Kumar S

    The below code is incorrect."oError");

    It will obviously will show the message "oError" as you placed that object inside the string and it will be treated as a string.

    So what can u do?

    As the oError is a object, Put a debugger there and see what's inside oError object and then show that message.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.