Hello everyone,
I am trying to filter an XMLPort by another table. The XMLPort mainly contains fields from the HR_MA table. However, there is an additional table called NAPA_MA for personnel payroll.
The key in the HR_MA table is the field "No." and in NAPA_MA the field "Nr".
The filtering should be done based on the "Status" field in the NAPA_MA table. Only records that have the "Aktiv" status (option field) in NAPA_MA should be output.
Here is my attempt, which does not work as it always outputs all records from HR_MA.
HR_MA - Export::OnPreXMLItem()
WITH HR_MA DO BEGIN
NAPA_MA.RESET;
NAPA_MA.SETCURRENTKEY(Nr);
NAPA_MA.SETRANGE(Nr, HR_MA."No.");
NAPA_MA.SETFILTER(Status, 'Aktiv');
IF FINDSET THEN BEGIN
REPEAT
HR_MA.MARK (TRUE);
UNTIL NEXT = 0;
END ELSE
currXMLport.SKIP;
NAPA_MA.MARKEDONLY(TRUE);
END;
Does anyone have any suggestions for me?
Best regards
