Get top level refID in planned production orders explosion tab


I have created a new field in between Number and reference type in the below screenshot and I am trying to display the topLevel reference itemId. 

In order to achieve it, I am trying to get the top level refId. Please see the below screenshot for better understanding.

I tried with the following steps,

Created a new field in the table ReqTrans -> Created a display method with the following code to get the ToplevelRefID

public static display PoolId displayPool(ReqTrans _this)
        PoolId           poolId;
        ReqPO            reqPO;

        switch (_this.RefType)
            case ReqRefType::BOMLine :
            case ReqRefType::BOMPlannedOrder :
                poolId = ReqPO::find(_this.PlanVersion,_this.RefId).ItemId;

        return poolId;

I have used switch case cos I have other scenarios also dont mind that.

Please help me to achieve this.


  • ReqTransCov has that relation between issue and receipt ReqTans. \Data Dictionary\Tables\ReqTrans\Methods\selectCov
    Something like this, ReqTrans::findRecId(reqTransChild.selectCov().IssueRecId).RefId; // reqTransChild is your current reqTrans
Reply Children