Function SET175Z: Add a voyage

LANSA

Function SET175Z: Add a voyage
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_175);
********** COMMENT(Function .......: SET175Z);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Add a voyage);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(allow the user to add port arrival times for a voyage);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
DEF_LIST NAME(#S_LSTVVP) FIELDS((#S_175PRT *OUTPUT)(#S_175DATV));
GROUP_BY NAME(#S_GRPVVP) FIELDS((#S_175SRV *OUTPUT)(#S_175VSL)(#S_175VOY));
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
REQUEST FIELDS(#S_175SRV);
********** COMMENT(Get all the ports for this service);
CLR_LIST NAMED(#S_LSTVVP);
SET_MODE TO(*ADD);
SELECT FIELDS(#S_175PRT) FROM_FILE(SETPT1L1) WITH_KEY(#S_175SRV);
CHANGE FIELD(#S_175DATV) TO(*NULL);
ADD_ENTRY TO_LIST(#S_LSTVVP);
ENDSELECT;
********** COMMENT();
BEGIN_LOOP;
REQUEST FIELDS(#S_GRPVVP) BROWSELIST(#S_LSTVVP);
SELECTLIST NAMED(#S_LSTVVP);
CHECK_FOR IN_FILE(SETVVP) WITH_KEY(#S_175SRV #S_175VOY #S_175VSL #S_175PRT);
IF_STATUS IS(*EQUALKEY);
UPDATE FIELDS(#S_175DATV) IN_FILE(SETVVP);
ELSE;
INSERT FIELDS((#S_175SRV)(#S_175VSL)(#S_175VOY)(#S_175PRT)(#S_175DATV)) TO_FILE(SETVVP);
ENDIF;
ENDSELECT;
********** COMMENT(Clear the dates for the next vessel voyage);
SELECTLIST NAMED(#S_LSTVVP);
CHANGE FIELD(#S_175DATV) TO(*NULL);
UPD_ENTRY IN_LIST(#S_LSTVVP) WITH_MODE(*CHANGE);
ENDSELECT;
********** COMMENT(Get ready for the next voyage);
CHANGE FIELD(#S_175VOY) TO(*NULL);
END_LOOP;