Requirement: I need to display the status per SO Line – which lines are still on open order, picked, packed or invoiced (we invoice per sales line).
Problem: One of my enum values is not passing – nothing fancy, just as simple assignment from view to temporary table. The enum value does seems to be “NOT being saved into the temp table”. What am I missing here? I hope someone can help.
On my temp table, the column has enum type of XXX_APG_ECOStatus(acquired from SalesLineStatus on an AOT view)
The enum contains these elements.
When retrieving the search result, ECOStatus (or Sales Line Status) does not yield.
I checked my temp table, the value is not indeed existing.
I am sure I set my datasource correctly.
I went to check by breaking point every affected line; I even made another column and a variable to make sure and see the data. Everything is fine. Both ecoResultTempTable.ECOStatus & ecoResultTempTable.SalesLineStatus are not being used or reassigned new values after these lines.
Nothing is fancy on my code – just a very simple straightforward assignment.
This issue also persists on other elements of the enum – not just “Open Order”.
What I already did but was NOT successful:
Full code below.
void clicked(){
XXXX_APG_ECOView ecoView;
XXXX_APG_ECOTempTable ecoResultTempTable;
XXXX_APG_ECOStatusType ecoStatus; /*temporary for debugging*/
;
if(XXXX_APG_ECOTempTable::ValidateFroToDates(lsdFrom, lsdTo)){
ttsBegin;
while select
SalesId
,CustAccount
,SalesName
,SoCreatedDate
,SalesStatus
,SalesConfirmStatus
,ShippingDateRequested
,RecId
,CostMatrix
,LCNo
,NCODate
,Expiry1
,Expiry2
,Expiry3
,NCO
,RefNo
,Packaging
,Brand
,CasesPerFCL
,ProductStatus
,LabelStatus
,CartonStatus
,configId
,PaymentTerm
,PaymTermId
,BGColor
,FGColor
,ItemId
,CanSize
,InventDimId
,ItemBOMId
,Media
,NetWeight
,PCW
,DrainedWeight
,SALT
,FLAKES
,OBR
,Tins
,DlvTerm
,LSDLatest
,LSD2
,LSD3
,Destination
,Freight
,ShippingNominations
,PackId
,PackQty
,PackDate
,InvoiceId
,InvoiceDate
,InvoiceQty
,PickQtySum
,PickLatestDate
,SalesOrderRecId
,SalesLineStatus
from ecoView
order by LSDLatest asc
where(
ecoView.LSDLatest >= lsdFrom /*declared from classdeclaration*/
&& ecoView.LSDLatest <= lsdTo /*declared from classdeclaration*/
) //end of where clause
{
/*Sales Header START*/
ecoResultTempTable.SalesId = ecoView.SalesId;
ecoResultTempTable.SORecId = ecoView.SalesOrderRecId;
ecoResultTempTable.CustAccount = ecoView.CustAccount;
ecoResultTempTable.SalesName = ecoView.SalesName;
ecoResultTempTable.SoCreatedDate = ecoView.SoCreatedDate;
ecoResultTempTable.SalesStatus = ecoView.SalesStatus;
ecoResultTempTable.SalesConfirmStatus = ecoView.SalesConfirmStatus;
ecoResultTempTable.ShippingDateRequested = ecoView.ShippingDateRequested;
/*Sales Header END*/
/*Sales Line START*/
/*General Setup START*/
ecoResultTempTable.CostMatrix = ecoView.CostMatrix;
ecoResultTempTable.LCNo = ecoView.LCNo;
ecoResultTempTable.NCODate = ecoView.NCODate;
ecoResultTempTable.Expiry1 = ecoView.Expiry1;
ecoResultTempTable.Expiry2 = ecoView.Expiry2;
ecoResultTempTable.Expiry3 = ecoView.Expiry3;
ecoResultTempTable.NCO = ecoView.NCO;
ecoResultTempTable.RefNo = ecoView.RefNo;
ecoResultTempTable.Packaging = ecoView.Packaging;
ecoResultTempTable.Brand = ecoView.Brand;
ecoResultTempTable.SalesQty = ecoView.CasesPerFCL;
ecoResultTempTable.ProductStatus = ecoView.ProductStatus;
ecoResultTempTable.LabelStatus = ecoView.LabelStatus;
ecoResultTempTable.CartonStatus = ecoView.CartonStatus;
ecoResultTempTable.Buyer = ecoView.configId;
ecoResultTempTable.PaymentTermName = ecoView.PaymentTerm;
ecoResultTempTable.PaymTermId = ecoView.PaymTermId;
ecoResultTempTable.BGColor = ecoView.BGColor;
ecoResultTempTable.FGColor = ecoView.FGColor;
ecoStatus = ecoView.SalesLineStatus;
ecoResultTempTable.ECOStatus = ecoStatus;
ecoResultTempTable.SalesLineStatus = ecoStatus;
/*General Setup END*/
/*Buyer specs START*/
ecoResultTempTable.ItemId = ecoView.ItemId;
ecoResultTempTable.CanSize = ecoView.CanSize;
ecoResultTempTable.InventDimId = ecoView.InventDimId;
ecoResultTempTable.BOMId = ecoView.ItemBOMId;
ecoResultTempTable.Media = ecoView.Media;
ecoResultTempTable.NetWeight = ecoView.NetWeight;
ecoResultTempTable.PCW = ecoView.PCW;
ecoResultTempTable.DrainedWeight = ecoView.DrainedWeight;
ecoResultTempTable.Salt = ecoView.SALT;
ecoResultTempTable.Flakes = ecoView.FLAKES;
ecoResultTempTable.OBR = ecoView.OBR;
ecoResultTempTable.Tins = ecoView.Tins;
/*Buyer specs END*/
/*Pick START*/
//TO-DO
/*Pick END*/
/*Ship START*/
ecoResultTempTable.DlvTerm = ecoView.DlvTerm;
ecoResultTempTable.LSDLatest = ecoView.LSDLatest;
ecoResultTempTable.LSD2 = ecoView.LSD2;
ecoResultTempTable.LSD3 = ecoView.LSD3;
ecoResultTempTable.Destination = ecoView.Destination;
ecoResultTempTable.Freight = ecoView.Freight;
ecoResultTempTable.ShippingNominations = ecoView.ShippingNominations;
/*Ship END*/
/*Invoice START*/
//TO-DO
/*Invoice END*/
/*Sales Line END*/
ecoResultTempTable.insert();
}
ttsCommit;
XXXX_APG_ECOTempTable_1_ds.research();
}//if statement end
}//click method end
*This post is locked for comments
Hi André, as promised. I was able to resolve this issue by recreating my destination table.
Hi André,
Thanks for stopping by.
- Does the view actually provide the correct value in the table browser?
>>>Yes, the view provides the correct value (as seen on the breakpoint) including the values across other columns. Just this single column that I am having trouble with.
- After the x++ compilation, also perform a full CIL build and eventually also a restart of the AOS (after the CIL build).
>>>>This will be my last resort as this means a downtime.
I'll try to re-create my destination table and revert back.
Hi Kashiru,
There are two things you can check here:
- Does the view actually provide the correct value in the table browser?
- After the x++ compilation, also perform a full CIL build and eventually also a restart of the AOS (after the CIL build).
I also synchronized and recompiled and still no luck.
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
48
Zain Mehmood
6
Moderator