1.自建物料,默认包装字段位于子单据头上:
2.在单据转换里配置这样的公式:
3.下推报错:
4.跟踪SQL发现语句是这样生成的(红色标注的是提示列名无效的字段):
[code]SELECT t0.FID fid,
t0.FBILLNO fbillno,
t1.FENTRYID fentity_fentryid,
t1.FSEQ fentity_fseq,
t0.FCONTACTID fcontactid,
t0_L.FREMARK fremark,
t0.FOWNERID fbatchownerid,
t0.FWHID fbatchwhid,
t1.FMATERIALID fmaterialid,
t1.FLOCID flocid,
t1.FLOTNO flotno,
t1.FPEODUCEDATE fproducedate,
t1.FEXPPERIOD fexpperiod,
t1.FSERIALNO fserialno,
t1.FDIRECTIONFORQTY fdirectionforqty,
t1.FDIMENSIONID fdimensionid,
t1.FMIRRORMTLID fmirrormtlid,
t1.FAUXPROPID fauxpropid,
t1.FOWNERID fownerid,
t1.FEXPUNIT fexpunit,
t1.FEXPIRYDATE fexpirydate,
t1.FCTY fcty,
t1.FDIRECTIONFORCTY fdirectionforcty,
t1.FMPUID fmpuid,
t1.FAVGCTY favgcty,
t1.FWHID fwhid,
t1_W.FORIGINFORMID foriginformid,
t1_W.FORIGINBILLNO foriginbillno,
t1.FTRACKNO ftrackno,
t1.FWRAPNO fwrapno,
t1_W.FORIGINTRACKNO forigintrackno,
t1_W.FORIGINWRAPNO foriginwrapno,
st117.FISEMPTYPACKAGE f32,
st124_L.FNAME f33,
t1.FPACKAGEID fpackageid,
st125_L.FNAME f35,
st126_L.FNAME f36
FROM BAH_T_WMS_INNOTICE t0 LEFT OUTER
JOIN BAH_T_WMS_INNOTICEENTRY t1
ON t0.FID = t1.FID
INNER JOIN
(SELECT 100048 as FId) sp
ON sp.FId = t1.FENTRYID LEFT OUTER
JOIN BAH_T_WMS_INNOTICEENTRY_W t1_W
ON t1.FENTRYID = t1_W.FENTRYID LEFT OUTER
JOIN BAH_T_WMS_INNOTICE_L t0_L
ON (t0.FID = t0_L.FID
AND t0_L.FLocaleId = 2052) LEFT OUTER
JOIN BAH_T_BD_MATERIAL st11
ON t1.FMATERIALID = st11.FID LEFT OUTER
JOIN BAH_T_BD_PACKAGE st117
ON t1.FPACKAGEID = st117.FID LEFT OUTER
JOIN BAH_V_BD_UNIT_L st124_L
ON (st117.FMOSTUNITID = st124_L.FID
AND st124_L.FLocaleId = 2052) LEFT OUTER
JOIN BAH_T_BD_PACKAGE_L st125_L
ON (st117.FPACKAGEID = st125_L.FID
AND st125_L.FLocaleId = 2052) LEFT OUTER
JOIN BAH_V_BD_UNIT_L st126_L
ON (st117.FMAINUNITID = st126_L.FID
AND st126_L.FLocaleId = 2052) LEFT OUTER
JOIN BAH_T_BD_MATWAREHOUSE st127
ON t1.FMATERIALID = st127.FID
WHERE ((t0.FBILLTYPEID = '58ec68754781ae'
AND t0.FDOCUMENTSTATUS = 'C')
AND (((st127.FENABLECAPACITY <> 1)
AND (t1.FMQTY >= t1_W.FJOINMQTY))
OR (st127.FENABLECAPACITY = 1
AND (t1.FCTY >= t1_W.FJOINCTY))))
ORDER BY st11.FNUMBER ASC, t1.FDIMENSIONID ASC, t1.FAUXPROPID ASC, t1.FPACKAGEID ASC[/code]5.个人猜测,这是一个bug。感觉是在解析表达式FMaterialId.FPackageId时,错误地映射到了单据上的字段,导致关联出错。而且在整个SQL语句中并未发现从物料主表关联物料子单据头。
推荐阅读