on 01-04-2006 9:26 AM
Hi All ,
How to display the error message coming from R/3 side.
If iam giving input from dynproside, if no Records found in R/3 side how can I display "No records Found"in Dynpro side.
Please help me for this.
Thanks
Nageswara.
Hi BB,
If i understand your question correctly the BAPI already has error message when you execute the BAPI thru ABAP.If you just want to show the BAPI message in WD you can use the MessageManager class and check the below methods and incorporate the logic for the same in your code:-
wdThis.wdGetAPI().getComponent().getMessageManager().reportException();
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess();
For second part you can use the size method to check if the Value Node contains data or not and use the MessageManager class to display the message in WD.
wdContext.nodeXXXX.size()
Regards,
Chintan Virani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Chintan
Thanks for your response.I am writing this on behalf of BHI BHI.
Yes the BAPI has already the error message and we want to display the error when there are no records found for a particular input.
Can you explain me more of where to implement the method
wdContext.nodeXXXX.size()
Is the implementation to be done in the execute method of the BAPI or somewhere esle.
Thanks and regards
kris
Hi BB
If u r calling a bapi, u might have a context that corresponds to the BAPI. the only thing you need to do is to set that error message to the messagemanager parameter after the execute and invalidate methods.
if(wdontext.current<ResultNode>Element() == null)
wdComponentAPI.getMessageManager().reportException(<u>wdContext.current<Bapinode>element.get<messageAtribute></u>);
/* wdComponentAPI.getMessageManager()... */
the message will be diplayed on the dynpro Screen at the bottom.If u wish to get the message at the top- create a message area in the UI.
Regards
DhanyaR Nair
hi
I am calling the BAPI on the action of the submit button only, So after clicking the submit button only I could know whether there are records or not.
So on Action submit only I should write the implementation for the message display" no records found" if no records are returned by the BAPI.
Can you suggest me as what has to be done in regard to do that.
thanks and regards
gopi krishna
hi Armin
Can you explain me more about the syntax for displaying the error messages" No records found" and "records found".
I have implemented the code in the execute method of the BAPI in the custom controller.
int i = wdContext.nodeOutput().size();
if(i <= 0)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportException("NO Records Found",false);
//wdThis.wdFirePlugToOrderStatusResults();
}
else
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Records Found");
}
But it is not working properly.
has anything esle to be added to the code.
Can you guide me how to do the changes in the code.
thanks and regards
gopi krishna
hi Armin
Thanks for your fast response.
I am not able to get over that issue.
The code which I have sent earlier had been implemented in the ExecuteBAPI method and I have called that particular executeBAPI method on the action handler of the submit button. But still it is not working.
Can you have a look at the code I sent you and let me know if anything is wrong in the code.
Action Handler method I am calling this executeBAPI
wdThis.wdGetLHPOrderStatusCustController().executeZ_Vf_CustomerResults();
And in the custom controller I have implemented the executeBAPI method as:
int i = wdContext.nodeOutput().size();
// if(i <= 0)
// {
// wdThis.wdGetAPI().getComponent().getMessageManager().reportException("NO Records Found",false);
// //wdThis.wdFirePlugToOrderStatusResults();
// }
// else
// {
// wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Records Found");
// }
Can you please tell me the exact syntax to be implemented and where.
thanks and regards
gopi krishna
hi Armin
I am calling the invalidate methid after execute method:
wdContext.currentZ_Vf_Customer_Orderstatus_List_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
If you have any code sample for the displaying of the messages, it would be of great help if u can post me that.
thanks
gopi krishna
hi Armin
I have implemented the following code as suggested by you but still it seems that I am not able to get the expected results.Even though there are no results in the BAPI it is firing to the next screen and displaying "records found" when there are no records displayed.
I am using the following code.
try
{
// Calls remote function module Customer OrderList
wdContext.currentZ_Vf_Customer_Orderstatus_List_InputElement().modelObject().execute();
// Synchronise the data in the context with the data in the model
wdContext.nodeOutput().invalidate();
//if(wdContext.currentOutputElement()== null)
//wdComponentAPI.getMessageManager().reportException(wdContext.currentZ_Vf_Customer_Order_Detail_InputElement().get<messageAtribute>);
int i = wdContext.nodeOutput().size();
if(i == 0)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportException("NO Records Found",false);
//wdThis.wdFirePlugToOrderStatusResults();
}
else
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Records Found");
}
}
catch (Exception ex)
{
// If an exception is thrown, then the stack trace will be printed
ex.printStackTrace();
}
Plase suggest me as to what has to be done.
thanks and regards
gopi krishna
hi Armin
Yes the wdcontext.nodeOutput() is mapped to the BAPI output node.
I tried to implement the code you have sent to me, but still it is not working.
I have implemented the code in the custom controller, is there anything wrong in this. where this has to be implemented
thanks and regards
gopi
hi Armin
I was able to display the error message if no data was found in the database, but the message is being displayed in the second screen and not on the first screen, when I am clicking on "submit"
I require to display the messages on the first screen itself if there is data available and it should not go to the second screen.
Can you guide me in this.
thanks
gopi krishna
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.