ich sitze mal wieder vor einem Problem, das ich mir nicht erklären kann.
Nach dem ausführen des folgenden Codes schmiert das Programm ohne Fehlermeldung (weder XPPERROR, noch XPPFATAL) ab. Ich weiß, das es an dem Aufruf von MAHNFAELLIG() liegt, denn nehme ich diese Funktion raus, funktioniert es wieder.
Code: Alles auswählen
select SDOPOS
set filter to (SDOPOS->FA = 1);
.and. (SDOPOS->KDNR = V_KDNR);
.and. (SDOPOS->RAUS = .f.);
.and. (MAHNFAELLIG())
Code: Alles auswählen
function MAHNFAELLIG
local lRetVal := .f.
do case
case (empty(SDOPOS->MAHNSTUFE)) .or. (SDOPOS->MAHNSTUFE = "0")
if (empty(SDOPOS->MAHNDATUM1)) .and. (SDOPOS->FDATUM + SDOPOS->MAHNTAGE1 < Application:Date)
lRetVal := .t.
else
lRetVal := .f.
endif
case SDOPOS->MAHNSTUFE = "1"
if (empty(SDOPOS->MAHNDATUM2)) .and. (SDOPOS->MAHNDATUM1 + (SDOPOS->MAHNTAGE2 - SDOPOS->MAHNTAGE1) < Application:Date)
lRetVal := .t.
else
lRetVal := .f.
endif
case SDOPOS->MAHNSTUFE = "2"
if (empty(SDOPOS->MAHNDATUM3)) .and. (SDOPOS->MAHNDATUM2 + (SDOPOS->MAHNTAGE3 - SDOPOS->MAHNTAGE2) < Application:Date)
lRetVal := .t.
else
lRetVal := .f.
endif
case SDOPOS->MAHNSTUFE = "3"
lRetVal := .f.
endcase
if .not.SDFIRMA->S36
if SDOPOS->BETRAG < 0
lRetVal := .f.
endif
endif
return (lRetVal)
Habt ihr eine Idee?
Gruß
Mirco