Codeblock Onlinehilfe

Event "Bei Standort-Synchronisation (von KD-Auftrag zur EK-Bestellung)"

Bei Standort-Synchronisation (von KD-Auftrag zur EK-Bestellung)

Ereignis dient zu Anpassung der Individual-Felder während des Intercompany-Synchronization.

Diese Ereignis tritt auf, wenn die Auftragsposition der Kunde "Vertrieb" (im Standort "Produktion") geändert wird.

Beispiel


| nEvtNo:P1, nMode:P2, oDab050:P3, oDab055:P4, oDab035:P5
// nMode   : 1 - vor Standort-Synchronisation
//           2 - nach Standort-Synchronisation
//           3 - vor Speichern aller Daten während Standort-Synchronisation
//               (die Tabelle Dab035 mit bereits aktualisierten Werten befindet sich noch im Editmodus)
  , oOwner, oDab510 |
 
function ArticleRangeFound()
   Result := not EOF(oDab510)
             and (Trim(AsString('ARTNR',oDab035)) = Trim(AsString('ARTNR',oDab510)))
             and (AsNumber('LIEFNR',oDab035) = AsNumber('LINR', oDab510)),
end,

if nMode = 3 then // vor Speichern aller Daten während Standort-Synchronisation
 
  oOwner  := GetOwner(oDab035),
  oDab510 := DBGetTable(oOwner,waDab510),
 
  if not ArticleRangeFound() then
     oDab510.IndexName := 'DAB512',
     oDab510.CbFindKey({AsNumber('LIEFNR',oDab035), AsString('ARTNR',oDab035)}),
     while ArticleRangeFound()
        and ((not Empty(oDab510:GUELTIGVON) and (Today() <= oDab510:GUELTIGVON))
           or (not Empty(oDab510:GUELTIGBIS) and (Today() >= oDab510:GUELTIGBIS))) do
        oDab510.CbNext(),
     end,
  endif,
 
  if ArticleRangeFound() then 
     oDab035:TERMIN := DToC(WToD(oDab055:TERMIN) + oDab510:X_ICLOGIST), // hier den IC Zeitaufschlag Logistik in Tagen zufügen
  endif,
 
endif,