cancel
Showing results for 
Search instead for 
Did you mean: 

MappedAttributeInfo(APPView.Node): must not modify the datatyp

Former Member
0 Kudos

Hi,

I used DropDownByKey element (DDLPROJE) and mapped it a contex element(PROJE).

I tryed to fill PROJE with code below.No problem on compile, but when i run, it gets error below on line bold in code.

How can i solve this problem?

Thanks.

error

com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(FAALIYETappYeniView.PROJE): must not modify the datatype of a mapped attribute

code

IWDAttributeInfo attInf =

wdContext.getNodeInfo().getAttribute(

wdContext.currentContextElement().PROJE);

ISimpleTypeModifiable stm = attInf.getModifiableSimpleType();

IModifiableSimpleValueSet svs = stm.getSVServices().getModifiableSimpleValueSet();

try {

InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/SAPEPTDB");

Connection con = ds.getConnection();

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery("select PROJE from ZHF_PROJE");

svs.put("", "");

while (rs.next()) {

svs.put(rs.getString("PROJE"), rs.getString("PROJE"));

}

con.close();

} catch (Exception e) {

wdContext.currentContextElement().setMESAJ(e.toString());

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I asked as different problem

Former Member
0 Kudos

You have to modify the datatype of the mapping origin i.e. the attribute in the component or custom controller to which you have mapped.

Armin

Former Member
0 Kudos

Hi,

My aim is to clear and fill with new values the content of PROJE context element.

I have another DrppDownByKey element has values inside.Whenever it changes DDLPROJE must filled with new values.

I used string type both context element and database table.I did not understand why type problem?

Thanks.

Former Member
0 Kudos

Hi,

I guess you did as below.

You have created the context attribute PROJE in View Context as well as in Controller Context.

And then you have changed the type of PROJE attribute in View Context by binding it to some Simple type.

After that you have mapped this attribute to the PROJE attribute in Controller context.

That is why it is giving that error.

If my guess is correct:

Then delete the context mapping - by right click on the PROJE attribute in the View Controller.

Now in Comp Controller change the type of PROJE attribtue by binding the simple type.

And now do the mapping between the attribtues.

Regards,

Charan

Former Member
0 Kudos

Please read my previous answer again.

Armin

Former Member
0 Kudos

Hi,

It is not clear enought.

Change to which type?

Former Member
0 Kudos

With "modify the data type" I did not mean to change the type but to change the value set (as your code already does). But you have to change the value set at the origin of the mapping, e.g. in the component controller.

Armin