Skip to Content

Filter the export parameter values in RFC

Hi,

I have made a RFC call by passing Input Parameter to pull output data from the SAP R/3 System. The call was successful and I can able to display this in a table using Java webdynpro.

Is it possible to filter the output values returned by the RFC based on some condition.

For example, I passed role name as an input parameter and got list of users assigned to that role along with their profile details such as user group, name, email, country etc...,

After receiving all output values, I want to check if the user belongs to a specific group , say Group XYZ. If so , then delete that user from the table.

How can I do this?

Regards,

Eben Joyson.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 28, 2013 at 10:34 AM

    Hi Eben

    Sorry for the misunderstanding but why can't you loop over the context node and remove any element that doesn't meet the criteria?

    for(int i; i < node.size; i++)

    {

         element = node.getElementAt(i);

         if(!element.getRole.equals("roleA"))

         {

              node.removeElement(element);

         }

    }

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2013 at 04:25 AM

    Dear Eben,

    Please go through the these steps

    Create one context attribute "TableFilter" directly under Root context as below:

    Change the type of the "TableFilter" attribute to java class TableFilter. 

    Go to the properties of the  table columns: Bind the Attr1 of FilterTestNode to FilterValue property of the Column1 and Bind the Attr2 of FilterTestNode to FilterValue property of the Column2.

    In the actions tab create one action as "Filter" and write the below code in that action:

    1. wdContext.currentContextElement().getTableFilter().filter(wdContext.nodeSourceTestNode(),wdContext.nodeTestNode());

    In wdDoModifyView() method write the below code:

    if (firstTime) {

    //Here in the below line of code, "Table" is the ID of the UI element table.

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

    1. wdContext.currentContextElement().setTableFilter( new TableFilter(tableFilter, wdThis.wdGetFilterAction(), wdContext.nodeSourceTestNode(), null));

    }

    Table Filter.JAVA : http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=341542375

    How to Implement a Web Dynpro for Java Table with Sorting and Filtering Capabilities:

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0cf0997-2e08-2d10-b08e-964a2c04c47a?QuickLink=index&overridelayout=true&48636209916991

    And check this link

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60d5b593-ba83-2910-28a9-a7a7c7f5996f?QuickLink=index&overridelayout=true&11802570146719

    Hope this helps!!

    Regards

    Vijay K

    Add comment
    10|10000 characters needed characters exceeded