How to fetch the result based on Itemid into temp table

I've a itemid filter in my form based on this itemid I'm inserting records in temptable..

Here my code is

public void executeQuery()
{
    str 50 getitemid,getitem;
    ;
                        getitem=StringEdit.text();
        select bmv where bmv.ItemId == getitem && bmv.Active == NoYes::Yes;

        if (bmv.RecId)
        {
            getitemid= bmv.ItemId;
            while select bmlines join prodtable join trans join invent  where bmlines.BOMId == bmv.BOMId
            && trans.ItemId==invent.ItemId && prodtable.InventRefId==trans.SalesId
            && (trans.ItemId==prodtable.ItemId && prodTable.BOMId==bmlines.BOMId
            && trans.DeliveryDate>=FromDate.dateValue()
            && trans.DeliveryDate<= ToDate.dateValue())
            {
                tmpprodtable.ItemId             = bmlines.ItemId;
                tmpprodtable.ParentId           = getitemid;// "GM-961-006";
                tmpprodTable.ProdId             =   prodtable.ProdId;
                tmpprodtable.SalesId            =   trans.SalesId;
                tmpprodtable.Name =bmlines.itemNameGrid();
                tmpprodTable.BOMConsump         =   prodjournalbom.BOMConsump;
                tmpprodtable.InventLocationId   = inventdim.InventLocationId;
                tmpprodtable.DeliveryDate       =   trans.DeliveryDate;
                tmpprodtable.PackingSlipId      =   trans.PackingSlipId;
                tmpprodtable.Revision       =   inventdim.InventColorId;
                tmpprodtable.InventTransId  =   prodbom.InventTransId;
                tmpprodtable.BOMQty         =   prodbom.BOMQty;
                       //tmpprodtable.
                tmpprodtable.BOMId          =   bomTable.BOMId;
                tmpprodtable.QtySched       =   prodtable.QtySched;
                        tmpprodtable.QtyBOMCalc     =   prodbom.BOMQty * prodtable.QtySched;
                        tmpprodtable.Variance       =   tmpprodtable.QtyBOMCalc -   tmpprodtable.BOMConsump;
                        tmpprodtable.fDate          =   trans.DeliveryDate;
                        tmpprodtable.tDate          =   trans.DeliveryDate;
                       // tmpprodtable.Name           =  InventTable::find(bmlines.ItemId).ItemName;
                        tmpprodtable.UnitId         =   prodbom.UnitId;
                        tmpprodTable.insert();
                if (bmlines.BOMQtySerie==0)
                {
                    tmpprodtable.TotalOrdQty = _totalOrdQty * (bmlines.BOMQty / 1);
                    tmpprodtable.RequiredQty = _salesQty * (bmlines.BOMQty / 1);
                }
                else
                {
                    tmpprodtable.TotalOrdQty = _totalOrdQty * (bmlines.BOMQty / bmlines.BOMQtySerie);
                    tmpprodtable.RequiredQty = _salesQty * (bmlines.BOMQty / bmlines.BOMQtySerie);
                }
                info(strfmt("%1|%2|%3|%4 %5 %6",tmpprodtable.ItemId,trans.SalesId,bmlines.itemNameGrid(),tmpprodtable.ParentId,tmpprodTable.ProdId,tmpprodTable.Variance));
            }
        }
    super();
}

when i debug the code its not going through the loop, how can I pas the itemid from filter to my select statement.

Parents Reply Children
No Data
Related
Recommended