cancel
Showing results for 
Search instead for 
Did you mean: 

cannot modify xxx because it is mapped and there is no active NodeElement

Former Member
0 Kudos

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,

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Solve it

Former Member
0 Kudos

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,

Former Member
0 Kudos

Hi Victor,

Try removing this line from your code and execute the BAPI.

input.setMaterial_Evg(new Bapimgvmatnr());

Regards,

Murtuza

Former Member
0 Kudos

Dont´t work...

former_member751941
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Appear an error in the nodeOutput... say that it´s undefined

Former Member
0 Kudos

.

Message was edited by:

Victor Capi

former_member751941
Active Contributor
0 Kudos

Hi Victor,

check the model node structure.according to that put the Output node name.

Regards,

Mithu

Former Member
0 Kudos

Hi, in this post: , in the page 3, you can see my steps...

Thanks,

PD: have you got googletalk?