on 08-06-2007 12:10 PM
Hi All,
I am facing the issue with the new data comming from R3. I have some data in my view, I have to save those records in R3. I am doing the same, but I am failing to get the saved records comming from R3 when I refresh the page or application the new values are displaying.
Here are the steps I have followed to save the records
1) In wdDoInit of controller I am binding the model node
2) in execute method I am executing the "retrieve records bapi" to get the records
3)In view I am displaying those records. I have updated the records. I am calling "save records bapi" to save the records.
4) to refresh the new data again I am executing the "retrieve records bapi" method. But it is diplsaying the old data only.
My question is how to refresh the data comming from R3.
Hi,
When creating new RFC_input use WDModelScopeType.TASK_SCOPE in the constructor.
Aviad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here is my code
1) code in wdDoInit
IWDComponent component = wdThis.wdGetAPI().getComponent();
try {
model = (ABC) WDModelFactory.getModelInstance(
ABC.class,
WDModelScopeType.TASK_SCOPE);
} catch (Exception e) {
}
wdContext.nodeSample_Bapi_Input().bind(
(Y_Sample_Bapi_Input) model.createModelObject( Y_Sample_Bapi_Input.class));
2) code in retrieve records method
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
wdContext.currentSample_Bapi_InputElement().setI_Uname("user1");
wdContext.currentSample_Bapi_InputElement().modelObject().execute();
wdContext.nodeSample_Bapi_Output().invalidate();
wdContext.nodeSample_Bapi_Output().nodeTab_Data().invalidate();
} catch (WDDynamicRFCExecuteException e) {
manager.reportException(e.getMessage(), false);
}
3) code in save method
Y_Update_Sample_Bapi_Input input = new Y_Update_Sample_Bapi_Input();
wdContext.nodeUpdate_Sample_Input().bind(input);
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
input.setI_Uname("user1");
input.setCountry(wdContext.currentSample_Bapi_Inputelement.getCountry());
input.execute();
wdContext.nodeUpdate_International_Output().invalidate();
wdContext.nodeUpdate_International_Output().nodeE_Return().invalidate();
}catch (WDDynamicRFCExecuteException e) {
manager.reportException(e.getMessage(), true);
}
I want to update the country. In my view I am displaying the countries in dropdown list, I can select country from the lsi I will update. When I refresh the page I am retrieve the updated country.
try the following coding:
1. in the other section
Y_Update_Sample_Bapi_Input RFCUpdate = new Y_Update_Sample_Bapi_Input(WDModelScopeType.TASK_SCOPE);
2. in wdDoInit
wdContext.nodeSample_Bapi_Input().bind(RFCUpdate);
3. In retrieve method
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
RFCUpdate.setI_Uname("user1");
RFCUpdate.execute();
wdContext.nodeSample_Bapi_Output().invalidate();
wdContext.nodeSample_Bapi_Output().nodeTab_Data().invalidate();
} catch (WDDynamicRFCExecuteException e) {
manager.reportException(e.getMessage(), false);
}
4. In the save method
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
RFCUpdate.setI_Uname("user1");
RFCUpdate.setCountry(wdContext.currentSample_Bapi_Inputelement.getCountry());
RFCUpdate.execute();
wdContext.nodeUpdate_International_Output().invalidate();
wdContext.nodeUpdate_International_Output().nodeE_Return().invalidate();
}catch (WDDynamicRFCExecuteException e) {
manager.reportException(e.getMessage(), true);
}
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.