cancel
Showing results for 
Search instead for 
Did you mean: 

Change OVS input fields ( ESS source code)

Former Member
0 Kudos

Hello,

This is the first time that I work with Web Dynpro Java, I need to add two new fields to OVS. I am working with the ESS (esstrasap~com application) I am triying to modify in the component FCTraCostAssignament the customer controller OVSCostCenter.

I added two fields within the context of OVSCostCenter (GMU and JOB). Within the function initOVS attempt to give them a value for my helper to appear in the fields with these defaults.

Inside initOVS method I modify the source with the following code:

wdContext.currentQueryInElement().setGmu("017");

wdContext.currentQueryInElement().setJob("110");

WDAttributeInfo[] attributeInfos = new IWDAttributeInfo[1];

attributeInfos[0] = attributeInfo;

WDValueServices.addOVSExtension("CC",attributeInfos,wdContext.nodeQueryIn(),wdContext.nodeQueryOut(),new CostCenterContextNotificationListener(attributeInfo.getName()));

There is also a method getQueryInputFields which builds fields through the “QueryIn” context node, that is the source:

//@@begin getQueryInputFields()

if (queryInputList != null)

return queryInputList;

queryInputList = new ArrayList();

Iterator it = wdContext.nodeQueryIn().getNodeInfo().iterateAttributes();

while (it.hasNext()) {

IWDAttributeInfo ai = (IWDAttributeInfo) it.next();

if (ai.getSimpleType() != null && ai.getSimpleType().getBuiltInType().equals("string")) {

queryInputList.add(ai.getName());

}

}

return queryInputList;

I tried to do everything above but can not appear to me the two new fields. I have read OVS documentation… but I don’t find the solution.

Can anyone help me?

Thanks in advance and regards.

Accepted Solutions (1)

Accepted Solutions (1)

former_member751941
Active Contributor
0 Kudos

Hi Ricardo,

Make sure you have initialized the OVS input nodes.

Check this thread.

Regards,

Mithu

Former Member
0 Kudos

hi Mithu,

public void initOVS( com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfo attributeInfo, com.sap.tc.webdynpro.progmodel.api.IWDNode fieldControlNode )

{

//@@begin initOVS()

if (this.fieldControlNode != null) {

return;

}

this.fieldControlNode = fieldControlNode;

//Map enabled fields of CostAssignment context to QueryInput-Node

IWDNodeElement fceElement = getFieldControlElement("COMP_CODE");

if (((Boolean) fceElement.getAttributeValue("Visible")).booleanValue()&& ((Boolean) fceElement.getAttributeValue("Input")).booleanValue()) {

wdContext.nodeQueryIn().getNodeInfo().addMappedAttribute("CompCode",".OVSCostCenter.CostAssignment.Comp_Code");

mappedAttributes.add("Comp_Code");

}

fceElement = getFieldControlElement("CO_AREA");

if (((Boolean) fceElement.getAttributeValue("Visible")).booleanValue()&& ((Boolean) fceElement.getAttributeValue("Input")).booleanValue()) {

wdContext.nodeQueryIn().getNodeInfo().addMappedAttribute("Co_Area",".OVSCostCenter.CostAssignment.Co_Area");

mappedAttributes.add("Co_Area");

}

wdContext.currentQueryInElement().setRowCount((short) 50);

// TODO Ricardo

wdContext.currentQueryInElement().setGmu("");

wdContext.currentQueryInElement().setJob("");

// TODO Ricardo

IWDAttributeInfo[] attributeInfos = new IWDAttributeInfo[1];

attributeInfos[0] = attributeInfo;

WDValueServices.addOVSExtension("CC",attributeInfos,wdContext.nodeQueryIn(),wdContext.nodeQueryOut(),new CostCenterContextNotificationListener(attributeInfo.getName()));

//@@end

}

Regards,

Ricardo

Answers (1)

Answers (1)

Former Member
0 Kudos

Can anyone help me?

When you create a OVS help search, where exactly add you the input text values for search?

We have try to modify the attributes and query in on the OVS and we don't have any change when we run the application

thanks in advance

Ricardo