Check selected column values are same

Hi,

How can we check whether the column values of the selected rows are same?

For e.g.i have a form which has 10 customer transactions,and i’m selecting 4 out of 10.And when i select a button it should check whether the “customer name”(column) for the selected columns are same.

Thanks,

Rajee

For example:

MultiSelectionHelper selection = …
MyTable t = selection.getFirst();
str firstValue = t.Value;

while (t)
{
    if (t.Value != firstValue)
    {
        return false;
    }
    t = selection.getNext();
}
return true;

Thanks Martin!! It works fine…

Below is the code which i used

public boolean checkSelectedVendorSame()

{

CustTrans mytable

MultiSelectionHelper helper = MultiSelectionHelper::construct();

str customer;

boolean ret = true;

;

helper.parmDatasource(mytable_ds);

mytable = helper.getFirst();

customer = mytable.CustAccount;

while(mytable)

{

if(mytable.CustAccount != customer)

{

ret = checkFailed(’@INA2121’);

break;

}

mytable = helper.getNext();

}

return ret;

}