Skip to Content
avatar image
Former Member

find value in table from interface in offline form

Hello,

Here is my issue :

I have a dropdown with values that are dynamically defined from SAP through the interface. The table for the interface is defined like this :

MATNR MAKTX CATEGORY

123456 material 1 8

646788 material 2 3

689865 material 3 4

I would like to show a popup if the category of the material is 4.

In the event "change" of the dropdown, I would like to get the category from the table but I don't know how to do that.

I know that I can get the value of maktx with xfa.event.prevText but I would prefer get the matnr value. And then I don't know how to read the table to get the category.

Please help me ! thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 30, 2009 at 04:41 PM

    //Javascript! Data is stored in Table MATTAB

    // MATNR is source Field, CAT is target field

    //get the value -->

    var selection = this.boundItem(xfa.event.newText);

    //then search in the table mattab (dataview --> table MATTAB, repeating node DATA,Colums matnr, maktx, category) -->

    var nodMatnr = xfa.resolveNodes("xfa.record.MATTAB.DATA[*].matnr");

    var nodCat = xfa.resolveNodes("xfa.record.MATTAB.DATA[*].category");

    //target Fieldname in Form = MAKTX in same subform

    for ( var i = 0; i < nodMatnr.length; i++ ){

    if (nodMatnr.item(i).value == selection){

    CAT.rawValue = nodCat.item(i).value);

    } //if

    } //for

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Chintan Virani

      Thanks again, but when i write :

      xfa.host.messageBox(nodCat.item(1).value, "test", 2);

      I can see the value of the first line, so I think that it found the node...

      EDIT : Sorry, it's working.

      Edited by: Louis-Arnaud Bouquin on Oct 7, 2009 12:12 PM