Hi All,
I'm trying to write a BPM to retrieve information from part table and
put this information in a quoteline's UD field when the line has
changed. It works for standard lines but I'm having a hard time
figuring out how to update the lines that are kit component when it's
the parent line that's marked as changed. Basically, when the line's
kitflag is 'P' and has changed , I need to iterate a second time
through the ttQuoteLine table to find and update the lines related to
this line. Here's what I have so far:
/*Retrieve and calculate Part Weight for a quote line */update child
line
define buffer bQuoteDtl for ttQuoteDtl.
For Each ttQuoteDtl where (ttQuoteDtl.RowMod = 'a' or ttQuoteDtl.RowMod
= 'u') no-lock.
CASE true:
when ttQuoteDtl.KitFlag = '' or ttQuoteDtl.KitFlag = 'C' then do:
Find first Part where Part.Company = ttQuoteDtl.Company and
Part.PartNum = ttQuoteDtl.PartNum No-lock.
If available Part then
assign ttQuoteDtl.number06 = Part.NetWeight *
ttQuoteDtl.SellingExpectedQty.
end.
when ttQuoteDtl.KitFlag = 'P' then do:
For each bQuoteDtl where bQuoteDtl .KitFlag = 'C' and bQuoteDtl
.KitParentLine = ttQuoteDtl.KitParentLine no-lock.
Find first Part where Part.Company = bQuoteDtl .Company and
Part.PartNum = bQuoteDtl .PartNum No-lock.
If available Part then
[missing part here]
end.
end.
end CASE.
end.
Am I right trying to use a buffer as an alias on the temp table in order
to iterate on the same table another time ?
I'm still pretty new to ABL so chances are good that I'm off the track
here...
Christian
I'm trying to write a BPM to retrieve information from part table and
put this information in a quoteline's UD field when the line has
changed. It works for standard lines but I'm having a hard time
figuring out how to update the lines that are kit component when it's
the parent line that's marked as changed. Basically, when the line's
kitflag is 'P' and has changed , I need to iterate a second time
through the ttQuoteLine table to find and update the lines related to
this line. Here's what I have so far:
/*Retrieve and calculate Part Weight for a quote line */update child
line
define buffer bQuoteDtl for ttQuoteDtl.
For Each ttQuoteDtl where (ttQuoteDtl.RowMod = 'a' or ttQuoteDtl.RowMod
= 'u') no-lock.
CASE true:
when ttQuoteDtl.KitFlag = '' or ttQuoteDtl.KitFlag = 'C' then do:
Find first Part where Part.Company = ttQuoteDtl.Company and
Part.PartNum = ttQuoteDtl.PartNum No-lock.
If available Part then
assign ttQuoteDtl.number06 = Part.NetWeight *
ttQuoteDtl.SellingExpectedQty.
end.
when ttQuoteDtl.KitFlag = 'P' then do:
For each bQuoteDtl where bQuoteDtl .KitFlag = 'C' and bQuoteDtl
.KitParentLine = ttQuoteDtl.KitParentLine no-lock.
Find first Part where Part.Company = bQuoteDtl .Company and
Part.PartNum = bQuoteDtl .PartNum No-lock.
If available Part then
[missing part here]
end.
end.
end CASE.
end.
Am I right trying to use a buffer as an alias on the temp table in order
to iterate on the same table another time ?
I'm still pretty new to ABL so chances are good that I'm off the track
here...
Christian