Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Filtering problem with model node

Hi,

I hav created a model and my context structure is like this

Context

--Bapi_material_getlist_input

-


output

-


matnrlist

<list of attributes which are bind to table>

--sourceset

<list of attributes, matnrlist node copied>

--FilterAttributes<1..1 cardinality>

-


Description<attirbute>

Marnrlist is the node wer my data is coming frm r3. i binded this node to table.

I copied matnrlist node to another in the context and renamed it as sourceset

took node filterattributes and attribute description of type string.

After executing model, my node matnrlist will hav list of values.

then after execute model comman, worte the below

wdContext.nodeSourceSet().invalidate();

WDCopyService.copyElements(wdContext.nodeMatnrlist(), wdContext.nodeSourceSet());

setTableSet();

In SetTableSet method, below is the code

WDCopyService.copyElements(wdContext.nodeSourceSet(), wdContext.nodeMatnrlist());

In Action filter, below is the code

wdContext.currentContextElement().getTableFilter().filter( wdContext.nodeSourceSet(), wdContext.nodeMatnrlist());

In domodifyview, below is the code

if (firstTime)

{

IWDTable table = (IWDTable)view.getElement("Table");

wdContext.currentContextElement().setTableFilter( new TableFilter( table, wdThis.wdGetFilterAction(), (IWDNode)wdContext.nodeSourceSet(), null ) );

}

but when i execute my application, i m having list of values in my table with filter field

whatever i write and press enter button in the filter field, i m getting below error,

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Material_GetList.Bapi_Material_Getlist_Input.Output.Matnrlist): value node is created without a reference

kindly put some light on this...

Former Member
Former Member replied

Hi,

I cannot answer your question on node filtering.

I usually copy the nodeelements explicitely. This always gives me total control.

Other advantages:

- You can create smaller elements in your value nodes (don't copy what you don't need)

- You can give more meaningful names to attributes in your value elements

- You can analyse and/or consolidate during copying elements.

example:

INode sourceNode = ....;
INode targetNode = ....;

for (int i=0, i<sourceNode.size(); i++) {

IElement sourceElement = sourceNode.get<Name>elementAt(i);
if (check if element must be copied)  {
IElement targetElement = targetNode.create<Name>Element();

targetElement.set<Some>value(sourceElement.get<Corresponding>Value());
.. fill other properties

targetNode.addElement(targetElement);
}

}

Good luck, Roelof

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question