on 03-28-2007 12:07 PM
Hi All,
I am facing difficulty in getting data using BAPI. I have written small program in Web Dynpro. It uses RFC model and gets data from BAPI_MATERIAL_GET_DETAL. In R/3, I can see the data. However I can not see the same data using Web Dynpro. I have created one view. There is one Action push button, one input field and one table output field in the form. After inserting some value in the input field 'Material No' & on pressing the action bution, data should get populated in table. It is not happening !!!
In wdDoInit I have written following code:
//@@begin wdDoInit()
Bapi_Material_Get_Detail_Input input = new Bapi_Material_Get_Detail_Input();
wdContext.nodeBapi_Material_Get_Detail_Input().bind(input);
//@@end
In Action button I have written following code:
public void onActionclick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionclick(ServerEvent)
try {
// wdContext.
wdContext.currentBapi_Material_Get_Detail_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdComponentAPI.getMessageManager().reportSuccess("Size of Output node "+wdContext.nodeOutput().size());
wdComponentAPI.getMessageManager().reportSuccess("BAPI executed successfully");
} catch (Exception e) {
// TODO Auto-generated catch block
wdComponentAPI.getMessageManager().reportException("BAPI execution failed "+e.getMessage(), true);
e.printStackTrace();
}
//@@end
}
I have imported the BAPI and have done mapping etc correctly. Could you pls let me know the reason why data is not being fetched by the BAPI. Pls note that wdComponentAPI.getMessageManager().reportSuccess("Size of Output node "+wdContext.nodeOutput().size()) returns 1. So, I guess model is fetching data. However the data is not getting displayed.
Can you please help me out.
Regards,
Gaurav
Hi Gaurav,
I hope this piece of code is in Copmonent controller's wdDoInit
//@@begin wdDoInit()
Bapi_Material_Get_Detail_Input input = new Bapi_Material_Get_Detail_Input();
wdContext.nodeBapi_Material_Get_Detail_Input().bind(input);
//@@end
instead of this
wdComponentAPI.getMessageManager().reportSuccess("Size of Output node "+wdContext.nodeOutput().size())
<b>try to print Output Return message().</b> May be you can get closer to the problem
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Ur BAPI is executing well i guess the prob is may b this BAPI required some input parameter which u have to set, i faced the same prob wen i used Bapi_Material_Getlist BAPI, but once i gave the required input, it gave me list of all materials, and regarding ur size of O/P node, it is appearing 1 coz may b u hv sub node in it.
Thanks
Puneet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try to find the size of ur output tablenode I mean under the table do u have more nodes I think so.
Which node u binded to the table find that node size it it returns some values then it works and compare form the R/3 side.
Otherwise u need to give some autorization for the Function module in R/3 end.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.