Split PO Suggestion

We have orders that carry flow downs from customers that I need to send to suppliers. I am attempting to use the PegDmdMst table to split the PO suggestion. The query runs and the data gets updated, but the write doesn't happen or I can't find in the table.

What is the proper sequence to create a new record, copy original and change the index, then write new record? This is a data directive on PegSupMst

My latest attempt is below.

Thanks

Greg Payne




define buffer SugPODtl_new for SugPODtl.


For each PegLink fields ( SupplySeq DemandSeq PartNum ) where ttPegSupMst.Company = PegLink.Company and ttPegSupMst.Plant = PegLink.Plant and ttPegSupMst.SupplySeq = PegLink.SupplySeq,
each PegDmdMst fields ( DemandOrdNum DemandType DemandQty WarehouseCode CheckBox01 CheckBox02 CheckBox03 CheckBox04 CheckBox05 ShortChar01 ShortChar02 )
where PegDmdMst.Company = PegLink.Company and PegDmdMst.Plant = PegLink.Plant and PegLink.DemandSeq = PegDmdMst.DemandSeq and PegDmdMst.DemandType = 'J'.

Message " DEBUG - In Add new suggestion - Current Seq " + string(PegLink.DemandSeq) + " PartNum " + PegLink.PartNum.



/* Find Last SugPODtl where PegDmdMst.Company = SugPODtl.Company and PegDmdMst.Plant = SugPODtl.Plant using SugNum. */
Assign SugPODtlSeq = SugPODtlSeq + 1. /* Find Last Suggestion Number and increment */

Message " DEBUG New SugPODtl Sequence " + string(SugPODtlSeq).

Find SugPODtl where PegDmdMst.Company = SugPODtl.Company and
PegDmdMst.Plant = SugPODtl.Plant and PegLink.SupplySeq = SugPODtl.SugNum. /* Get Original Suggestion record */

Create SugPODtl_new. /* Create Temp SugPODtl Buffer */
BUFFER-COPY SugPODtl TO SugPODtl_new. /* Copy Original suggestion to New */

Assign SugPODtl_new.SugNum = SugPODtlSeq. /* Assign new Suggestion Number */

Assign SugPODtl_new.CheckBox01 = PegDmdMst.CheckBox01. /* Specialty Metals ( Buy America ) */ /* Assign Flowdowns for this demand */
Assign SugPODtl_new.CheckBox02 = PegDmdMst.CheckBox02. /* ITAR Required */
Assign SugPODtl_new.CheckBox03 = PegDmdMst.CheckBox03. /* DFAR Required */
Assign SugPODtl_new.CheckBox04 = PegDmdMst.CheckBox04. /* ROHS Requested */
Assign SugPODtl_new.CheckBox05 = PegDmdMst.CheckBox05. /* REACH Compliance Requested */

Assign SugPODtl_new.ShortChar01 = PegDmdMst.ShortChar01. /* DPAS Rating */
Assign SugPODtl_new.ShortChar02 = PegDmdMst.ShortChar02. /* Contact Number */
Assign SugPODtl_new.Character01 = string(PegDmdMst.DemandOrdNum). /* Job Number */



Assign SugPODtl_new.RelQty = PegDmdMst.DemandQty. /* Assign Quantity from this Demand */
Assign SugPODtl_new.XRelQty = PegDmdMst.DemandQty.

Message "DEBUG - Add SugPODtl " + SugPODtl_new.PartNum + string(SugPODtl_new.sugnum) + string(SugPODtl_new.RelQty).
Message "DEBUG - Ratings " + SugPODtl_new.ShortChar05.

/* Release SugPODtl_new. */ /* Write Record */
BUFFER-COPY SugPODtl_new TO SugPODtl.
End.

End.

________________________________
CONFIDENTIALITY NOTICE

The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at 727-578-6280 and immediately delete the communication.

"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."


[Non-text portions of this message have been removed]