on 09-14-2006 4:38 PM
Hi all,
I have following problem:
In the default view I render data out of a R/3 system in a table. This data is received when the view is loaded (so the BAPI execution takes place in the wdDoInit() method)
Below the table I have a button from which I can create a new entry for the table. Clicking this button will lead the user to a new view where he can enter the required data.
When he then clicks the "Save" button on the second view he is redirected to the initial view.
-> The problem now is that the new entry is not visible in the table unless the user refreshes the browser itself.
Follwoing happens when the user saves the data:
The BAPI for saving the data is executed
The BAPI for showing the table data is executed.
The output of the BAPI showing the table data is invalidated.
I also tried to invalidate the output before executing the showing BAPI and I also tried to invalidate the input of the showing BAPI and execute the wdDoInit method again. That all does not help.
Any idea how to fix this?
regards
René
Hi all,
within SDN they are lots of threads to this topic but none of them helps in my case. No correction of this problem I get from:
- calling wdDoInit()
- resetting view view view.reset()
- resetting context via wdContext.getContext().reset(false)
- invalidating node
- ...
So how to fix this bug?
Is there a possibility to refresh the complete browser out of WebDynpro - so simulating a F5?
regards
René
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
After created New record.
Check This
1.Invalidate the list BAPI node
2.Bind the Input for the List BAPI
3.Invalidate the output node
4. Execute the List Bapi
You can check that the list bapi executeion is take place or not by give the message
wdComponentAPI.getMessageManager().reportSuccess("Inside ListBAPI Execution");
Kind Regards
Mukesh
Hi
If you use the Custom Controler call the execute method only.
Can you get the message of execution?
Check that you bind the result screen in the firePlug
in side the onPlugFromOtherView check the action takes place with the message
wdComponentAPI.getMessageManager().reportSuccess("In side onPlugFromOtherView ");
Check the result screen's inplug(onPlugFromOtherView) is bind with the correct out plug from record inserted.
Kind Regards
Mukesh
Hi Mukesh,
Only calling the execute method of the Custom Controller was my first try.
The message I get. And when I refresh the browser via F5 I also see the newly created record! It's not visible when the first view is called again from inbound plug.
What you mean with "bind the result screen in firePlug" exactly?
In the fireplug I call another BAPI than in the first view. This other BAPI just creates a new entry and has no output. On the first view the list of entries is received from an own BAPI.
regards
René
Hi
You can easily track the error .
remove the unwanted code.
1.After the Create BAPI Executed do you got the message?
2.Inside the onPlugFromOtherView are you got the message?
3.Is the outplug bind with onPlugFromOtherView ?
4.Try to print the list bapi size.(wdContext.node<ListBapiOutput>().size())
Kind Regards
Mukesh
Hi,
the messages I receive and the outplug is bound with onPlugFromOtherView.
The size is after creating the new entry the same but as soon as I refresh the browser the entry is displayed in the table and the size increased.
So why I can see the updated table only when I refresh the page but not when the view is loaded? When refreshing the page no data is created!
regards
René
Hi,
here the code of the wdDoInit() of the first View:
wdThis.wdGetOrgDataCTRLController().executeOrgData();
String objectId = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getObject_Id();
String shortText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getShort_Text();
String longText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getLong_Text();
if (objectId == null) objectId = "";
if (shortText == null) shortText = "";
if (longText == null) longText = "";
wdContext.currentContextElement().setObjectId(objectId);
wdContext.currentContextElement().setShortText(shortText);
wdContext.currentContextElement().setLongText(longText);
wdThis.wdGetOrgDataCTRLController().wdGetContext().currentContextElement().setSobid(objectId);
IWDNodeElement element = wdContext.nodeObjectsdata().getElementAt(0);
wdContext.nodeObjectsdata().removeElement(element);
Here the code of the wdDoInit() of the Custom Controller "OrgDataCTRL":
IWDClientUser clientUser = WDClientUser.forceLoggedInClientUser();
String userId = "";
try{
IUser user = clientUser.getSAPUser();
userId = user.getUniqueID();
}catch(Exception e){
userId = clientUser.getClientUserID();
}
Z_Bapi_Orgunitext_Data_Get_Input bapiInput = new Z_Bapi_Orgunitext_Data_Get_Input();
wdContext.nodeZ_Bapi_Orgunitext_Data_Get_Input().bind(bapiInput);
Date date = new Date(106, 8, 22);
bapiInput.setKeydate(date);
bapiInput.setBname(userId);
Here the code of the save button action in the second view:
Z_Bapi_Rh_Object_Create_Input bapiInput = new Z_Bapi_Rh_Object_Create_Input();
wdThis.wdGetCreateObjectCTRLController().wdGetContext().nodeZ_Bapi_Rh_Object_Create_Input().bind(bapiInput);
String shortText = wdContext.currentContextElement().getShort();
String stext = wdContext.currentContextElement().getStext();
bapiInput.setSobid(wdContext.currentContextElement().getSobid());
bapiInput.setShort(shortText);
bapiInput.setStext(stext);
bapiInput.setBegda(wdContext.currentContextElement().getBegda());
bapiInput.setEndda(wdContext.currentContextElement().getEndda());
wdThis.wdGetCreateObjectCTRLController().executeCreateObject();
wdThis.wdFirePlugSaveObject();
Here the code of the inbound plug in the first view:
wdThis.wdGetOrgDataCTRLController().executeOrgData();
wdDoInit();
Here the code of the execute method within the Custom Controller:
wdContext.nodeOutput().invalidate();
wdDoInit();
try{
wdContext.currentZ_Bapi_Orgunitext_Data_Get_InputElement().modelObject().execute();
}catch(Exception e){
e.printStackTrace();
}
wdContext.nodeOutput().invalidate();
regards
René
Hi
Try this
here the code of the wdDoInit() of the first View:
String objectId = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getObject_Id();
String shortText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getShort_Text();
String longText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getLong_Text();
if (objectId == null) objectId = "";
if (shortText == null) shortText = "";
if (longText == null) longText = "";
wdContext.currentContextElement().setObjectId(objectId);
wdContext.currentContextElement().setShortText(shortText);
wdContext.currentContextElement().setLongText(longText);
wdThis.wdGetOrgDataCTRLController().wdGetContext().currentContextElement().setSobid(objectId);
wdThis.wdGetOrgDataCTRLController().executeOrgData();
Here the code of the inbound plug in the first view:
//wdThis.wdGetOrgDataCTRLController().executeOrgData();
wdDoInit();
Kind Regards
Mukesh
Rene,
U cannot use javascript inside webdynpro.
If u r using this in portal as iView then u can try Eventing to refresh the page.
Fire event in the second view.
WDPortalEventing.fire("<namespace>","Save","");
Subscribe event in the first view.
WDPortalEventing.subscribe("<namespace>","Save",<Define an action in the view and call it>);
Hope this would help,
Regards,
Nagarajan.
HI Rene;
Make method bapiIntialize():
in this method do this:
1.Create a new Instance of the Input node
2.Bind the Input for the List BAPI
Means whatever you do in your wdInit() method write that code in this method:
Now call this method in your wdInit()method and then call it after invalidating your node.
If not solved give me your BapiNode and its attribute.
Regards
Nidhideep
Hi Jurmann,
Are you using "plug" to redirect the view from the second.
then you should call the wdDoInit() method in the onPlugFrom<Outboundplugname>() method which is in the first view.
regards
karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.