on 01-28-2015 4:56 AM
Hi,
I have a calculation view which is exposed through an odata. I have used exception handling for handling a user defined error.
I have attached a snippet of the code
DECLARE CUSTOMCONDITION CONDITION FOR SQL_ERROR_CODE 10001;/* Custom Error Code = 10001*/
DECLARE EXIT HANDLER FOR CUSTOMCONDITION RESIGNAL;
a=SELECT 'a' AS ID FROM DUMMY;
CALL "storedprocedure"(
:a,
😛
);
IF :b= 0 THEN
SIGNAL CUSTOMCONDITION SET MESSAGE_TEXT = 'NOT AUTHORIZED';
END IF;
When i expose this through an odata the error that is displayed is
How can i display the message 'NOT AUTHORIZED' as set in the calculation view.
Do I need to make some changes in the calculation view or the odata
Is it possible to show the message
Thanks,
Shruthi
Hi Shruthi,
You dont have to use semicolon(:) for b here,
ie, IF b= 0 THEN, this will be sufficient.
Let me know if you are still facing the issue..
Regards,
Safiyu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Safiyu,
You are right,the semicolon isn't needed.
However my issue is slightly different.
When i execute the calculation view through sql console,I get the correct error message
ie
When i expose this through the odata the error message that i get is
However i would like to display the message 'NOT AUTHORIZED' in the odata.
Is there any way to do this in the odata?
Thanks,
Shruthi
Hi Shruthi,
Go through these similar threads.
http://scn.sap.com/thread/3513929
Hope it helps,
Regards,
Safiyu
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.