Mar 28, 2012

How to display the field values separating by comma?

This simple job displays all the itemnames horizontally separated by comma  of  PO (000386)  lines


static void myTest(Args _args)
{

    PurchLine               PurchLine;
    Str                         itemName;
    boolean                 multipleTrans = false;
    ;
    while select PurchLine
        where PurchLine.purchId  == '000386'
    {
            if (multipleTrans == true)
            {
                itemName += " ,  ";
            }
             itemName += PurchLine.Name;
             multipleTrans = true;
    }
     info(itemName);
}

 O/P :    High End Speaker - ash/14 inches ,  Projection Television Model 01

No comments: