|
Bonnie, You have noticed like we did the calculation is wrong if you only count working days as ship days. MAPICS has taken an APAR to fix it but it winds it way all through COM data entry, pick lists, etc, anywhere the mfg date or ship date needs to be calculated off the promise date. It even impacts available to promise which takes into account the ship lead time for promise calculations. If you need to create and API you just need to use the MBAQRES3 (all days in calendar) and MBAQRES4 (work days in calendar) files. Set a limit into either and count backwards by the ship lead time. Here is the Calendar file: AQHFST AQHGST Calendar Calendar Day of Calendar Create ID date week day status date 00 1010629 6 + 1001107 00 1010630 7 - 1001107 00 1010631 1001107 00 1010701 1 - 1001107 00 1010702 2 + 1001107 00 1010703 3 + 1001107 There are two routines in every program: *================================================================ * RTV: Sub Calendar Days - Calendar Day * *================================================================ It finds the starting day then reads the first equal record by cal id. * Establish starting position C KPSOC SETLLFAQREE9 * C KRSOC READEFAQREE9 90* C *IN90 IFEQ '1' It then looks for the first non-blank day, which in this test is only something like 2/30/02, an invalid date. C *IN90 DOWEQ'0' * USER: Process Data record * CASE: DB1.Calendar day status is No day C AQHGST IFEQ *BLANK *IF C ELSE It then runs the following routine to find the closest working day *================================================================ * RTV: Sub Work Days - Calendar Day * *================================================================ I made the following 2 line change and everything works spiffy now... I changed the first field to be the day of the week NE blank and the second to ensure that we only counted work days. After the change the second routine is superflous since the first will always return the correct date and does not need to be adjusted. * KONRAD MOD FOR CALENDAR DATE ISSUE C AQHFST IFEQ *BLANK *IF C AQHGST OREQ '-' *IF Hope this helps. Regards Konrad
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.