How to get pegging reference number for planned order

Hi

 When I open planned order form  MasterPlanning -->Common-->Planned order..it is opening below form.

 

in the pegging tab there two reference number for planned order.

I want find out those two records for that particular planned order.

I have checked in ReqPo and ReqTrans Tables and when I go with existing relation I am getting same record in both tables.

Please let me know if anybody knows how to find the pegging reference number for particular planned order.

  • Hi,

    I just put this code to end of ReqTransPo form's init method:

    if (curUserId() == "metin.em")
           info(reqtrans_ds.query().dataSourceNo(1).toString());

    it gives me:

    SELECT FIRSTFAST * FROM ReqPO(ReqPO) ORDER BY ReqPO.RefId ASC WHERE ((NOT (Qty = 0))) JOIN FIRSTFAST *
    FROM ReqPlanVersion(ReqPlanVersion) ON ReqPO.PlanVersion = ReqPlanVersion.RecId AND ((Active = 1)) JOIN * FROM ReqPlan(ReqPlan)
    ON ReqPlanVersion.ReqPlanId = ReqPlan.ReqPlanId AND ReqPlanVersion.ReqPlanDataAreaId = ReqPlan.dataAreaId AND ReqPlanVersion.ReqPlanId
    = ReqPlan.ReqPlanId AND ReqPlanVersion.ReqPlanDataAreaId = ReqPlan.dataAreaId JOIN FIRSTFAST INDEXISHINT * FROM ReqTrans(ReqTrans)
    USING INDEX RefIdx ON ReqPO.PlanVersion = ReqTrans.PlanVersion AND ReqPO.RefType = ReqTrans.RefType AND ReqPO.RefId = ReqTrans.RefId
    JOIN FIRSTFAST INDEXISHINT * FROM InventDim(InventDim) USING INDEX DimIdIdx ON ReqTrans.CovInventDimId = InventDim.inventDimId
    WHERE (((getActiveMasterPlanVersionByPlanId("Master"))))

    So I wrote this code part:

      ReqPO reqPO;
       ReqPlanVersion reqPlanVersion;
       ReqPlan reqPlan;
       ReqTrans reqTrans;
       while select reqPO
               where reqPO.RefId == "MP000045613"
           join reqPlanVersion
               where reqPlanVersion.RecId == reqPO.PlanVersion
           join reqPlan
               where reqPlan.ReqPlanId == reqPlanVersion.ReqPlanId &&
                     reqPlanVersion.ReqPlanDataAreaId == reqPlan.dataAreaId &&
                     reqPlanVersion.ReqPlanId == reqPlan.ReqPlanId
           join reqTrans
               where reqPO.PlanVersion == ReqTrans.PlanVersion &&
               reqPO.RefType == ReqTrans.RefType &&
               ReqPO.RefId == ReqTrans.RefId
       {
           info(reqTrans.refid);
       }
Related
Recommended