on 03-27-2007 10:51 AM
Hi All,
I am developing a WebDynPro application. The application is failry simple.
I am using the bapi BAPI_MATERIAL_GET_DETAIL. I need to enter the Material no and supposed to retrieve the foll.
1. Material Desc
2. Material Group
3. Material Type
I have created a Model.
Have mapped the Model Node to Context of the Views (SearchView, ResultView) and also to Custom Controller.
SLD is configured JCo are tested successfully.
When I am running the application, then on giving the material no 100 and on pressing search I am not able to get any data in the Result View.
What am I missing and how can I debug my application.
Points assured.
Regards
Nikhil Bansal
Hi Nikhil,
Thr may b two scenarios,
Scenario1:
Ur RFC not exceuted .
U can use Message Manager to test ur RFC execution
Scenario2:
1)Ur BAPI not giving the result.
2)Its always good practice to Map the return node also. and u can map them in a seperate table.
I suggest u to concentrate on second scenario and see the result..
Regards,
Ramganesan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
The context of the Custom Controller looks like foll.
Bapi_Material_Get_Detail_Input
-
Output
-
Material_General_Data
-
Matl_Cat
-
Matl_Desc
-
Matl_Group
-
Matl_Type
-
Material
Material General Data has been binded to the Result View context. and Material to the input views context.
Bapi is being executed in the Application after the Search button has been pressed.
Please let me know what is wrong with the application.
Regards
Nikhil Bansal
Hi,
While mapping the component context with model context u can map the
return node also.and Bind these return node with a table . While executing the BAPI. It will display some result incase if ur input is Wrong or u may missed
any mandatory parameter.
Thats y i suggested u to mapp return node also.
Regards,
Ramganesan K.
Hi Nikhil,
Have you tried to execute the BAPI in SAP GUI, is it returning the data there properly, if yes are you able to execute the BAPI properly from WD.
Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil,
Try this:
In component controller
public void wdDoInit()
{
//@@begin wdDoInit()
Bapi_Material_Get_Detail_Input input = new Bapi_Material_Get_Detail_Input();
wdContext.nodeBapi_Material_Get_Detail_Input().bind(input);
//@@end
}
public void executeMaterialDetailBAPI( )
{
//@@begin executeMaterialDetailBAPI()
try {
wdComponentAPI.getMessageManager().reportWarning(wdContext.currentBapi_Material_Get_Detail_InputElement().getMaterial());
wdContext.currentBapi_Material_Get_Detail_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdComponentAPI.getMessageManager().reportSuccess("BAPI executed successfully");
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
wdComponentAPI.getMessageManager().reportException("Unable to execute the BAPI", true);
e.printStackTrace();
}
wdComponentAPI.getMessageManager().reportSuccess("Plug fired successfully");
//@@end
}
In Search View
public void onActionSeachClicked(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSeachClicked(ServerEvent)
wdThis.wdGetBAPIMaterialDetailsCompController().executeMaterialDetailBAPI();
wdThis.wdFirePlugToResultView();
//@@end
}
Regards
Sid
Hi,
BAPI_MATERIAL_GET_DETAILis my function module name and three inputs
BAPI_MATERIAL_GET_DETAIL_INPUT input = new BAPI_MATERIAL_GET_DETAIL_INPUT
();
wdcontext.nodeBAPI_MATERIAL_GET_DETAIL_INPUTElement().bind(input);
After this.
input.setCatogory("Value");
input.setDate("dd/mm/yyyy);
input.setProjId(value);
aftert this.
try{
wdContext.currentBAPI_MATERIAL_GET_DETAIL_INPUTElement().modelObject().execute();
wdContext.nodeOutPut.Invalidate();
}
catch(EX e)
{
e.prstack();
}
Add this code n ur any of custom controller or view init mehtod.
Get the conxt variables into ur View context like context mapping and bind with the output node to table then u will get the data.
If this s the Standarad function module no need to give the authorization otherwise u need to give authorization R/3 side.
Thanks,
Lohi.
Message was edited by:
Lohitha M
Hi ,
First define ExecuteRFC method in controller and in this method execute your RFC
i.e.
try{
wdcontext.currentBAPI_MATERIAL_GET_DETAIL._InputElement().modelobject().execute();
wdcontext.nodeOutput().invalidate();
}
catch(Exception e)
{
}
on click of search button , call controllers ExcuteRFC in onactionSearch Method.
i.e. wdthis.wdget<controller>.ExecuteRFC();
Sunitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.