Function SET175F Schedule for a port pair

LANSA

Function SET175F Schedule for a port pair
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_175);
********** COMMENT(Function .......: SET175F);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Generate a schedule for a port pair);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(generate one page per port pair, showing the voyage);
********** COMMENT(arrival & departure times for the pair);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(Receives: Service (#S_175SRV));
********** COMMENT( Page name (#S_175IDPP));
********** COMMENT( First port (#S_175PRT1));
********** COMMENT( Second port(#S_175PRT2));
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT();
********** COMMENT(<RDML ONCONDITION> field.);
********** COMMENT(Group and field definitions);
********** COMMENT();
********** COMMENT(NAME(#PANELDATA) FIELDS((#S_175F *INPUT *NOID) (#S_175S);
********** COMMENT(RV *HIDDEN) (#S_175PRT1 *HIDDEN)(#S_175PRT2 *HIDDEN)));
GROUP_BY NAME(#PANELDATA) FIELDS((#S_175MENU *HIDDEN)(#S_175PRT1 *HIDDEN)(#S_175PRT2 *HIDDEN)(#S_175FDES *HIDDEN)(#S_175SRV *HIDDEN));
DEF_LIST NAME(#S_LST175F) FIELDS((#S_175VSL)(#S_175VOY)(#S_175DEP)(#S_175ARR)(#S_175DAYS));
DEFINE FIELD(#S_175ARR) REFFLD(#S_175DATV) DESC('to-port arrival date') COLHDG('Arrives' 'on');
DEFINE FIELD(#S_175DEP) REFFLD(#S_175DATV) DESC('from-port departure date') COLHDG('Departs' 'on');
DEFINE FIELD(#S_175DAYS) TYPE(*DEC) LENGTH(003) DECIMALS(0) DESC('Transit time in days') COLHDG('Transit' 'time' '(days)');
********** COMMENT();
********** COMMENT();
********** COMMENT(Mainline);
USE BUILTIN(TCONCAT) WITH_ARGS(#S_IFSPATH '/') TO_GET(#S_IFSPATH);
USE BUILTIN(WEB_STATIC_PAGE) WITH_ARGS(#S_175IDPP '*NO' #S_IFSPATH);
********** COMMENT();
********** COMMENT();
********** COMMENT(Build a list of all the voyages that are available);
********** COMMENT(for this port pair (in order of departure date));
CLR_LIST NAMED(#S_LST175F);
SELECT FIELDS((#S_175VSL)(#S_175VOY)(#S_175DATV)) FROM_FILE(SETVVPL1) WITH_KEY(#S_175SRV #S_175PRT1);
********** COMMENT(check whether the second port is on this voyage);
CHANGE FIELD(#S_175DEP) TO(#S_175DATV);
FETCH FIELDS(#S_175DATV) FROM_FILE(SETVVP) WITH_KEY(#S_175SRV #S_175VOY #S_175VSL #S_175PRT2);
IF_STATUS IS(*OKAY);
CHANGE FIELD(#S_175ARR) TO(#S_175DATV);
USE BUILTIN(DATEDIFFERENCE) WITH_ARGS(#S_175DEP A #S_175ARR A) TO_GET(#S_175DAYS);
ADD_ENTRY TO_LIST(#S_LST175F);
ENDIF;
ENDSELECT;
********** COMMENT();
********** COMMENT();
REQUEST FIELDS(#PANELDATA) BROWSELIST(#S_LST175F) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);