on 10-03-2005 4:50 PM
Hi All,
1. I have two views in my application.
2. The first view has some fields for searching a certain item.
3. I call a BAPI for this search. The search result gets populated in the fields of the bottom view.
4. I can update the fields i the bottom view, and the update works perfectly.
5. Now if after update, I press the search button again from the top view, the bottom view displays the values before updation. Which is the point of botheration for me. I am executing the search BAPI again, then why the old values are getting populated? If I refresh the whole page and start searching from scratch then proper updated values are displayed.
What I feel somewhere the values before updation are getting cached, which I cant figure out. Can anybody help.
Thanks in advance
Regards,
Shubhadip
Hi Ghosh,
Each and Everytime , just before Execution of the Bapi,You have to invalidate your Node.Otherwise the nodeand Attribute will contain the old Values.
Try this.If Its not working I'll try to help you in someother way.
Thankx,
Karthick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ghosh,
That depends on the binding of your input.
You just tell me how you are binding your input to your Bapi?
After Changing your input (for updation) Are you setting it to the same node and Are you binding the Latest Value as input or the old Values are there in the input?Check these things.
Thankx,
Karthick
Hi Karthik,
in the first view I execute the BAPI and in the second view I show the results. In the second view I also submit the modified data via another BAPI.
As I execute and display result of same BAPI in two different views I have bound the same model node to both of these views. Let me give you some sample code for understanding what have I done.
In the first BAPI's search action handler I have written:
Zsr_Packnr_Validate_Components_Input input = new Zsr_Packnr_Validate_Components_Input();
wdContext.nodeZsr_Packnr_Validate_Components_Input().bind(input);
input.addT_Version(new Zsr_Packnr_Field_Values());
input.addT_Zsr_Genbr(new Zsr_Packnr_Field_Values());
input.setZsr_Gmc(globalMaterialCode);
input.setZsr_Mrc(mrc);
input.setZsr_Ctry(country);
input.setZsr_Dc(distributionChannel);
input.setZsr_Div(commercialSegment);
wdContext.nodeOutput_Validate().invalidate(); //as u suggested
wdContext.currentZsr_Packnr_Validate_Components_InputElement().modelObject().execute();
wdContext.nodeOutput_Validate().invalidate();
In the second BAPI I just display the output node from the same Model context node (its mapped to the second view too).
But as I said whenever I update some values in the result set and submit it the data gets submitted properly. But when I press the search button again, the previous set of data gets populated, not the just updated data.
If anybody has some idea on why the second time search BAPI execution still shows the previous set of result it will be a great help to me.
Thanks for all your help.
Shubhadip
Hi Ghosh,
1.I think from View you are directly connecting to the Model Node,which is not the correct way.
2.your Model Node should Bound with the model Seperately.
3.And The same Structure of Model Node,You should Have the Value node in Different Name.
4..Then Copy From Model Node to value Node by Using WDCopyService.copyCorresponding(elemSrc,elemDest) method.
5.While copying from model Node to Value Node you have to Invalidate your Value Node.
6.Your view must always bind with the Value nodes and attributes.
7.Actually this is the proper way of executing the Bapi.
8.And No need to invalidate the output node after executing the Bapi as you did.
9.bcaz you bind your view to the model node and if you are invalidating after bapi execution how the output value will be remaining?
Regards,
Karthick
Hi Ghosh,
Sample code for copying from model node to Value node.
int sizeAccAss = wdContext.nodeE_Activity_Table().size();
wdContext.nodeOutput_Project_GetInfo().invalidate();
wdComponentAPI.getMessageManager().reportSuccess("sizeAccAss - " + sizeAccAss);
for (int i = 0; i < sizeAccAss; i++){
wdContext.nodeE_Activity_Table().setLeadSelection(i);
elemSrc = wdContext.currentE_Activity_TableElement();//model
elemDest = wdContext.createOutput_Project_GetInfoElement();// value
WDCopyService.copyCorresponding(elemSrc, elemDest);
wdContext.nodeOutput_Project_GetInfo().addElement(elemDest);
wdComponentAPI.getMessageManager().reportSuccess("network " + i + " " + wdContext.currentOutput_Project_GetInfoElement().getNetwork());
}
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.