on 09-19-2007 1:04 PM
Hi, i´m doing a simple application.
I write in a input field, and retorn the rows of the table of r3 that same equals to the inputfield...
My problem is, when i write in the input field, appear an error:
com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(SearchView): cannot modify Material because it is mapped and there is no active NodeElement to take the value
The problem is in this method:
public void wdDoInit()
{
//@@begin wdDoInit()
Bapi_Material_Getbatches_Input input = new Bapi_Material_Getbatches_Input();
wdContext.nodeBapi_Material_Input().bind(input);
input.setMaterial_Evg(new Bapimgvmatnr());
//@@end
}
If i write the previous, when i write in the inputfield and press search appear the error, but if i substitute the bold line by this:
input.setMaterial("201311630A08000011");
when i press search appear the rows with the material 201311630A08000011.
What am i doing wrong?
Thanks,
Solve it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I find the solution.
I create a new element attribute in the context in customcontroller, and in the property value in searchview i write this attribute.
I delete all wddoinit in customcontroller, and in the method executeBapi_Material_Input:
public void executeBapi_Material_Input( )
{
//@@begin executeBapi_Material_Input()
Bapi_Material_Getbatches_Input input = new Bapi_Material_Getbatches_Input();
wdContext.nodeBapi_Material_Input().bind(input);
input.setMaterial(wdContext.currentContextElement().getValue1());
try {
wdContext.currentBapi_Material_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (Exception e) {
e.printStackTrace();
}
//@@end
}
Now work fine...
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
Try removing this line from your code and execute the BAPI.
input.setMaterial_Evg(new Bapimgvmatnr());
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
1> Use the code in side the implementation of action of search button.
IWDMessageManager msg = wdComponentAPI.getMessageManager();
try {
Bapi_Material_Getbatches_Input input = new Bapi_Material_Getbatches_Input();
wdContext.nodeBapi_Material_Input().bind(input);
input.setMaterial("201311630A08000011");
wdContext.currentBapi_Material_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (Exception e) {
// TODO Auto-generated catch block
msg.reportSuccess(e.getMessage());
e.printStackTrace();
}
msg.reportSuccess("Output size : "+wdContext.nodeOutput().size());
To see the result you have to take a table in the View Layout by using apply template table with context Model node.
II> If you want to take the value of Material as input instead of hard coding then create a context attribute say (MatAttr).Design View layout like
Material Number (Level) : MatAttr(InputField) SerachButton
Table Layout
Material Vendor Plant Expiry date
Write the code inside implementation of searchButton.
IWDMessageManager msg = wdComponentAPI.getMessageManager();
try {
Bapi_Material_Getbatches_Input input = new Bapi_Material_Getbatches_Input();
wdContext.nodeBapi_Material_Input().bind(input);
input.setMaterial(wdContext.currentContextElement().getMatAttr());
wdContext.currentBapi_Material_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (Exception e) {
// TODO Auto-generated catch block
msg.reportSuccess(e.getMessage());
e.printStackTrace();
}
msg.reportSuccess("Output size : "+wdContext.nodeOutput().size());
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.