Hi,
If I go through the same scenario from Tutorials - connect to backend using Adaptive RFC, using BAPI_FLIGHT_GETLIST, everything works well. When I try to use different BAPI, e.g. Bapi_Material_Get_Detail, I'm not able to access the data. I don't get any error, just nothing happens when I execute Bapi.
Here are code snippets:
-
- from custom controller:
public void wdDoInit()
{
//@@begin wdDoInit()
Rfc_Customer_Get_Input input = new Rfc_Customer_Get_Input();
wdContext.nodeRfc_Customer_Get_Input().bind(input);
//@@end
}
public void executeRfc_Customer_Get_Input( )
{
//@@begin executeRfc_Customer_Get_Input()
try {
wdContext
.currentRfc_Customer_Get_InputElement()
.modelObject()
.execute();
wdContext.nodeOutput().invalidate();
} catch (Exception ex) {
ex.printStackTrace();
}
//@@end
}
- from view implementation:
public void onActionFilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionFilter(ServerEvent)
wdThis.wdGetCustControllerController().executeRfc_Customer_Get_Input();
//@@end
}
-
One thing I couldn't do is:
input.setDestination_From(new Bapisfldst());
input.setDestination_To(new Bapisfldst());
of course, mapped to fields I'm using, because I don't get any additional model imported, like com.sap.tut.wd.flightlist.model.Bapisfldst from Flight demo app.
I know it's quite generic question, but does someone have an idea where to start looking for a problem?
BR, Ivan
Hi
Did you created proper proxies for model/metadata of your model, check proper mapping from model to coustom controller and then coustom controller to View, once after deploying check Jco connction test it...,
check your code
I hope the corrected code should be as follows
public void wdDoInit()
{
//@@begin wdDoInit()
Bapi_Material_Get_Detail_Input input = new Bapi_Material_Get_DetailInput();
wdContext.Bapi_Material_Get_Detail_Input().bind(input);
//@@end
}
//This is the method your are calling from View
public void executeRfc_Customer_Get_Input( )
{
//@@begin executeRfc_Customer_Get_Input()
try {
wdContext
.Bapi_Material_Get_Detail_InputElement()
.modelObject()
.execute();
wdContext.nodeOutput().invalidate();
} catch (Exception ex) {
ex.printStackTrace();
}
//@@end
}
- from view implementation:
public void onActionFilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionFilter(ServerEvent)
wdThis.wdGetCustControllerController().executeRfc_Customer_Get_Input();
//@@end
}
I Hope This code certainly works....
RK
Add a comment