on 09-27-2006 5:09 PM
Hello everyone,
I'm having problems trying to refresh a table with values that come from a SAP Remote function.
On my Init i do something like this:
wdContext.currentZ_Function_InputElement().setParam(param);
wdThis.wdGetFunctionController().executeZ_Function_Input();
Result: node wdcontext.nodeOutput().size() with elements = 5 (example)
The function controller is a simple "template->aplly->service controller->SAP model"
During initialization everything works fine.
But then, i process 2 of the lines outputed to the table (using another SAP function), and call this same function again.
I know that those 2 lines will not appear (i tried the sap function in R3 to verify) and that should be the right result.
Instead, the nodeOutput still returns exactly the same 5 elements. If i reinitialize the application, the calling of the SAP function returns the right result (3 elements). So, the problem must be some "invalidation" that i must do before calling the function again.
Can anyone help? (i hope i explained this right...)
Thank in advance,
Nuno Santos
Hi Nuno,
Call wdcontext.nodeOutput().invalidate() just after execute().
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
I allready tried doing that, but the problem persists. After calling the function for the second time, it returns the same elements as if none of them has been processed before.
Also, when i create a custom controller using the "apply->service controller", Netweaver automatically puts the invalidate method after the execute. Nevertheless, i tried "double invalidating", by doing the same in the code of my view, when i call the controler. Still the problem persists.
Any ideas? Thank you all.
Hi everyone,
Solved the problem on my own. In fact, it is not a web dynpro problem. What happens is that the rfc function executed in SAP R/3 needs some time to commit work on it's database. So, all i had to do was add a Thread.sleep(2000) for 2 seconds, and now everything works perfectly. I hope this helps your problem too, Karla.
Greetings to all of you,
Nuno Santos
Thanks for your reply Nuno,
I tried it the same way you wrote, but it unfortunatelly doesn't work for my case. It's actually the same you do, but the other way arround. I have a table and want to insert some lines. When I press "save" and go back to the table they wont show up. I have to refresh the Webdynpro for them to show up. The slepp() command didnt change anything to that.
How did you exactly call the Bapi the second time? Just calling the doInit() once more? Or anything different?
Thanks,
Christian
We solved the problem as well, but the sleep() did not work for us. The problem was much more complex. We were trying to create/update a record and then display a summary with the updated results. Our problem was that we had 1 model tied to the BAPI for create/update and a separate model tied to the BAPI to pull our summary. We were doing a buffer refresh after our create/update, but the buffer refresh was only occurring on our inputs. What we did was redefine our model to contain both the BAPI for create/update and the BAPI to pull our summary info. Once we did this, it fixed our problem because the buffer refresh occurred for everything within that model.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.