Eric Lehti
VIP Member
On December 31 we want to change Payment Terms for one customer and its many children.
Terms will be 'Net 30 days' for all existing open sales orders and all future orders.
In the example below, F4211 records are always purged to Sales History (F42119) during Sales Update (DREAM writer P42800 processing option 16).
Export from F0150 "Address Organization Structure Master" all the children belonging to this parent (WHERE MAPA8 = parentNbr) to work file CHILD.
INSERT one row into CHILD table, SET MAAN8 = parentNbr. The CHILD table is now ready for the next steps.
Determine from F0014 "Payment Terms" which code exists for 'Net 30 Days'. The value 'N30' is "Net 30 Days".
To change payment terms for all future orders, run this SQL statement:
update f0301 SET A5TRAR='N30' where A5AN8 in (select MAAN8 from CHILD)
To change payment terms on all existing open orders, run these SQL statements:
update f4201 SET SHPTC ='N30' where SHAN8 in (select MAAN8 from CHILD)
update f4211 SET SDPTC ='N30' where SDAN8 in (select MAAN8 from CHILD)
Forgotten anything?
Terms will be 'Net 30 days' for all existing open sales orders and all future orders.
In the example below, F4211 records are always purged to Sales History (F42119) during Sales Update (DREAM writer P42800 processing option 16).
Export from F0150 "Address Organization Structure Master" all the children belonging to this parent (WHERE MAPA8 = parentNbr) to work file CHILD.
INSERT one row into CHILD table, SET MAAN8 = parentNbr. The CHILD table is now ready for the next steps.
Determine from F0014 "Payment Terms" which code exists for 'Net 30 Days'. The value 'N30' is "Net 30 Days".
To change payment terms for all future orders, run this SQL statement:
update f0301 SET A5TRAR='N30' where A5AN8 in (select MAAN8 from CHILD)
To change payment terms on all existing open orders, run these SQL statements:
update f4201 SET SHPTC ='N30' where SHAN8 in (select MAAN8 from CHILD)
update f4211 SET SDPTC ='N30' where SDAN8 in (select MAAN8 from CHILD)
Forgotten anything?