Someone told me to change the BUFFER-COPY and just put each field I want to copy…that is working
If available PC_cid2 Then Do:
Message "DEBUG UPdate Part Cost for " + PartCost.PartNum.
PC_cid2.AvgMaterialCOst = PartCost.AvgMaterialCOst.
PC_cid2.LastMaterialCOst = PartCost.LastMaterialCOst.
and the rest of the cost here
End.
Miguel A. Santillan
Compass Manufacturing Systems
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 17, 2016 12:43 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
The find needs pc_id2
find PC_cid2 where PartCost.Company = PC_cid2.Company and PartCost.PartNum = PC_cid2.partnum and
PC_cid2.CostID = 'DEM' no-error.
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 17, 2016 3:32 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
Here is the log…
(Procedure: 'UpdatePre7_A1 bo/UD15/UD15.p' Line:6606) DEBUG Adding Part Cost record for TC-240-SM
[16/02/17@11:31:45.130-0800] P-002164 T-005360 1 AS -- ** PC_cid2 already exists with Company "CCI" Part "TC-240-SM" Costing ID "1". (132)
[16/02/17@11:31:45.130-0800] P-002164 T-005360 1 AS -- ** ABL Debug-Alert Stack Trace
Here is the current code: (Note the different Messages in the code….I never see the first message.) Doesn’t look like it is FINDing any data through the first loop FIND.
define buffer PC_cid2 for PartCost.
For each ttUD15 where (ttUD15.rowmod = 'A' or ttUD15.rowmod = 'U') and ttUD15.Company = cur-comp.
For Each PartCost where PartCost.Company = cur-comp and PartCost.CostID = '1'.
find PC_cid2 where PartCost.Company = PC_cid2.Company and PartCost.PartNum = PC_cid2.partnum and PartCost.CostID = 'DEM' no-error.
If available PC_cid2 Then Do:
Message "DEBUG UPdate Part Cost for " + PartCost.PartNum.
BUFFER-COPY PartCost TO PC_cid2. /* all values or just set the cost you want to update */
PC_cid2.CostID = 'DEM'.
End.
If Not available PC_cid2 then do:
Message "DEBUG Adding Part Cost record for " + PartCost.PartNum.
Create PC_cid2.
BUFFER-COPY PartCost TO PC_cid2.
PC_Cid2.CostID = 'DEM'.
Release PC_cid2.
End.
End. /*PartCost*/
End. /* End for each UD15 */
Miguel A. Santillan
Compass Manufacturing Systems
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 17, 2016 11:26 AM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
Ok, I think I see the issue. We are setting the original table not the new one.
PartCost.CostID = 'DEM'. Should be pc_cid2.CostID=’DEM’.
Change in both places.
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 17, 2016 2:05 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
Thanks, but I don’t think the BPM is writing anything at all from DEM to 1. I also put the Message line before the BufferCopy in hopes to see something in the log, but I don’t see any messages.
Example:
#10 ETL SS |
DEM |
0 |
0.05 |
#10 LCK SS |
DEM |
0 |
0.05 |
#10 STR EX TOOTH SS |
DEM |
0 |
0.07422 |
#10-32-3/16-PPH-ZP |
DEM |
0 |
0 |
#10-ETL-STL-ZNC |
DEM |
0 |
0.0453 |
#10-FENDER-SS |
DEM |
0 |
#N/A |
#10-FLAT-SS |
DEM |
0 |
0.03 |
#10-FLT-0.50X.048-SS |
DEM |
0 |
0.0336 |
The 3rd column is the DEM values, the 4th column is the Cost ID 1 Values. #n/A is the lookup with no results. As you can see the values from DEM are not being copied over.
SERVER Log
/17@10:46:50.225-0800] P-005456 T-005220 3 AS AS requestID= NULL
[16/02/17@10:46:50.227-0800] P-005456 T-005220 1 AS -- (Procedure: 'as/activate.p' Line:490) Incoming call from CCCAEPI04:2
[16/02/17@10:46:50.227-0800] P-005456 T-005220 2 AS AS -- TRACE: SINGLE-RUN Procedure 'bo/UD15/Sink.p:GetRows' START (14244)
[16/02/17@10:46:50.227-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\bo\UD15\Sink.r ID=10
[16/02/17@10:46:50.227-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\bo\UD15\Sink.r ID=10
[16/02/17@10:46:50.228-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\bpmExec\LiveBPM\bo\UD15\UD15.r ID=10
[16/02/17@10:46:50.228-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\bpmExec\LiveBPM\bo\UD15\UD15.r ID=10
[16/02/17@10:46:50.231-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\bo\UD15\UD15.r ID=10
[16/02/17@10:46:50.231-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\bo\UD15\UD15.r ID=10
[16/02/17@10:46:50.232-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmWSSecurity.r ID=10
[16/02/17@10:46:50.232-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmWSSecurity.r ID=10
[16/02/17@10:46:50.232-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmRPC.r ID=10
[16/02/17@10:46:50.233-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmRPC.r ID=10
[16/02/17@10:46:50.233-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\Bpm\Protocol.r ID=10
[16/02/17@10:46:50.233-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\Bpm\Protocol.r ID=10
[16/02/17@10:46:50.233-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\Bpm\AsyncCall.r ID=10
[16/02/17@10:46:50.234-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\Bpm\AsyncCall.r ID=10
[16/02/17@10:46:50.234-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmAsync.r ID=10
[16/02/17@10:46:50.234-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmAsync.r ID=10
[16/02/17@10:46:50.235-0800] P-005456 T-005220 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmWorkflowAsync.r ID=10
[16/02/17@10:46:50.235-0800] P-005456 T-005220 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmWorkflowAsync.r ID=10
[16/02/17@10:46:50.239-0800] P-005456 T-005220 3 AS AS -- TRACE: SINGLE-RUN Procedure END SUCCESS. (14265)
[16/02/17@10:46:55.040-0800] P-007476 T-004452 3 AS AS requestID= NULL
[16/02/17@10:46:55.042-0800] P-007476 T-004452 1 AS -- (Procedure: 'as/activate.p' Line:490) Incoming call from CCCAEPI04:2
[16/02/17@10:46:55.042-0800] P-007476 T-004452 2 AS AS -- TRACE: SINGLE-RUN Procedure 'bo/UD15/Sink.p:Update' START (14244)
[16/02/17@10:46:55.042-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\bo\UD15\Sink.r ID=10
[16/02/17@10:46:55.042-0800] P-007476 T-004452 2 AS FILEID Close ID=10
[16/02/17@10:46:55.042-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\bpmExec\LiveBPM\bo\UD15\UD15.r ID=10
[16/02/17@10:46:55.043-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\bpmExec\LiveBPM\bo\UD15\UD15.r ID=10
[16/02/17@10:46:55.045-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\bo\UD15\UD15.r ID=10
[16/02/17@10:46:55.045-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\bo\UD15\UD15.r ID=10
[16/02/17@10:46:55.046-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmWSSecurity.r ID=10
[16/02/17@10:46:55.046-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmWSSecurity.r ID=10
[16/02/17@10:46:55.046-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmRPC.r ID=10
[16/02/17@10:46:55.046-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmRPC.r ID=10
[16/02/17@10:46:55.047-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\Protocol.r ID=10
[16/02/17@10:46:55.047-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\Protocol.r ID=10
[16/02/17@10:46:55.047-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\AsyncCall.r ID=10
[16/02/17@10:46:55.047-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\AsyncCall.r ID=10
[16/02/17@10:46:55.048-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmAsync.r ID=10
[16/02/17@10:46:55.048-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmAsync.r ID=10
[16/02/17@10:46:55.048-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\BpmWorkflowAsync.r ID=10
[16/02/17@10:46:55.048-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\BpmWorkflowAsync.r ID=10
[16/02/17@10:46:55.049-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\Bpm\CheckCallContext.r ID=10
[16/02/17@10:46:55.049-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\Bpm\CheckCallContext.r ID=10
[16/02/17@10:46:55.049-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\bo\BpInstanceCounter\BpInstanceCounter.r ID=10
[16/02/17@10:46:55.049-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\bo\BpInstanceCounter\BpInstanceCounter.r ID=10
[16/02/17@10:46:58.242-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\db\trg\ud15\write.r ID=10
[16/02/17@10:46:58.242-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\db\trg\ud15\write.r ID=10
[16/02/17@10:46:58.243-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\db\repl\ud15\write.r ID=10
[16/02/17@10:46:58.243-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\db\repl\ud15\write.r ID=10
[16/02/17@10:46:58.244-0800] P-007476 T-004452 2 AS FILEID Open D:\Epicor905\Server\db\object\\UD15.r ID=10
[16/02/17@10:46:58.244-0800] P-007476 T-004452 2 AS FILEID Close D:\Epicor905\Server\db\object\\UD15.r ID=10
[16/02/17@10:46:58.246-0800] P-007476 T-004452 3 AS AS -- TRACE: SINGLE-RUN Procedure END SUCCESS. (14265)
[16/02/17@10:47:05.282-0800] P-002164 T-005360 3 AS AS requestID= NULL
[16/02/17@10:47:05.284-0800] P-002164 T-005360 1 AS -- (Procedure: 'as/activate.p' Line:490) Incoming call from CCCAEPI04:2
[16/02/17@10:47:05.284-0800] P-002164 T-005360 2 AS AS -- TRACE: SINGLE-RUN Procedure 'bo/ReportMonitor/Sink.p:GetRowsKeepIdleTime' START (14244)
[16/02/17@10:47:05.287-0800] P-002164 T-005360 3 AS AS -- TRACE: SINGLE-RUN Procedure END SUCCESS. (14265)
[16/02/17@10:47:35.296-0800] P-006604 T-006792 3 AS AS requestID= NULL
[16/02/17@10:47:35.298-0800] P-006604 T-006792 1 AS -- (Procedure: 'as/activate.p' Line:490) Incoming call from CCCAEPI04:2
[16/02/17@10:47:35.299-0800] P-006604 T-006792 2 AS AS -- TRACE: SINGLE-RUN Procedure 'bo/ReportMonitor/Sink.p:GetRowsKeepIdleTime' START (14244)
[16/02/17@10:47:35.302-0800] P-006604 T-006792 3 AS AS -- TRACE: SINGLE-RUN Procedure END SUCCESS. (14265)
When I add the code you told me in RED and run the BPM again…I get this in the server logs.
- Update bo/UD15/Sink.p (D:\Epicor905\Server\bo\UD15\Sink.r) at line 833
[16/02/17@10:57:44.440-0800] P-002164 T-005360 1 AS -- (Procedure: 'UpdatePre7_A1 bo/UD15/UD15.p' Line:6606) DEBUG Adding Part Cost record for #10-FENDER-SS
[16/02/17@10:57:44.440-0800] P-002164 T-005360 1 AS -- ** PC_cid2 already exists with Company "CCI" Part "#10-FENDER-SS " Costing ID "1". (132)
[16/02/17@10:57:44.440-0800] P-002164 T-005360 1 AS -- ** ABL Debug-Alert Stack Trace **
[16/02/17@10:57:44.440-0800] P-002164 T-005360 1 AS -- --> UpdatePre7_A1 bo/UD15/UD15.p (D:\Epicor905\bpmExec\LiveBPM\bo\UD15\UD15.r) at line 6608
[16/02/17@10:57:44.440-0800] P-002164 T-005360 1 AS -- Update bo/UD15/UD15.p (D:\Epicor905\bpmExec\LiveBPM\bo\UD15\UD15.r) at line 6770
Looks like it is looking at Cost ID 1 instead of Cost ID DEM
Miguel A. Santillan
Compass Manufacturing Systems
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 17, 2016 10:35 AM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
Add the section in Red below. It should create PartCost records for parts that don’t have one.
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, February 17, 2016 12:09 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
So it looks like the BPM is kicking off in the server logs, but I did a BAQ and compared values, there are many values in ID 1 that are not in ID Dem eventhough the PN exist in both IDs.
There are about 20k PN with a price difference…but I don’t think it is copying at all.
Is there another way to write this?
Miguel A. Santillan
Compass Manufacturing Systems
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, February 12, 2016 3:38 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
It looks good to me. I would put into test and then check the server log for any errors, then check the data to be sure the costing looks right in test.
From:
vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, February 12, 2016 4:59 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: E9: Plant Cost ID
Thanks Greg, I believe I remember you posted something like this on another issue I had.