on 02-07-2005 2:38 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
yes I did everything 'by the book'
- created model,
- created custom controller,
- mapped model to custom controller context,
- created view,
- mapped custom controller context to view context,
- map view context elements to view controls,
- created action in view, method in cust. contr. etc.
and still nothing.
If you have SAP R/3 somewhere near, you can test it on your own with same Bapi?
BR, Ivan
Hi Ivan,
one thing I don't understand with your code: Where do you fill the input parameters of your function module? Its name Rfc_Customer_Get sounds like it needs a customer number or a similar input - if you don't set input parameters and all of them are optional this might be the cause that you see no result (If the input parameter is not optional an error message should occur on execute...).
Regards,
Patric.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.