Function SET184V
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_184);
********** COMMENT(Function .......: SET184V);
********** COMMENT(Created on .....: 26/07/00 at 14:43:32);
********** COMMENT(Description ....: Sorting columns in a browselist);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show how a webevent function can display a browselist);
********** COMMENT(page at a time);
********** COMMENT(This function was derived from template FRWEBENQ01);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(Receives: nothing);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*WEBEVENT *DIRECT);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT();
********** COMMENT();
DEFINE FIELD(#S_184CNT) REFFLD(#LISTCOUNT) DESC('Total number of entries in listS_184VALL');
********** COMMENT();
********** COMMENT(This field contains the list entry number of the first);
********** COMMENT(list entry to be shown on the page.);
DEFINE FIELD(#S_184STRP) REFFLD(#LISTCOUNT);
********** COMMENT();
DEFINE FIELD(#S_184ENT) REFFLD(#LISTCOUNT);
********** COMMENT();
********** COMMENT(This field contains the list entry number of the last);
********** COMMENT(list entry to be shown on the page.);
DEFINE FIELD(#S_184ENDP) REFFLD(#LISTCOUNT);
********** COMMENT();
DEFINE FIELD(#S_184PAGE) REFFLD(#LISTCOUNT) DEFAULT(10);
********** COMMENT();
********** COMMENT(This list contains the complete product list);
DEF_LIST NAME(#S_184VALL) FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)) COUNTER(#S_184CNT);
********** COMMENT();
********** COMMENT(This list holds just the page of records that are to);
********** COMMENT(be displayed to the user.);
DEF_LIST NAME(#S_184VDSP) FIELDS((#STDSELECT *HIDDEN)(#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC));
********** COMMENT();
********** COMMENT(This list is used when calling function SET184Y);
DEF_LIST NAME(#S_WRKFVC) FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)(#S_184IMG)) TYPE(*WORKING) ENTRYS(0000500);
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
********** COMMENT();
CHANGE FIELD(#S_FUNDES) TO(*FUNCTION_DESC);
********** COMMENT();
********** COMMENT(Determine action to take according to STDRENTRY flag);
CASE OF_FIELD(#STDRENTRY);
********** COMMENT();
WHEN VALUE_IS('= *BLANK');
********** COMMENT(First time in);
********** COMMENT(Get the data and load it into list #S_184VALL);
********** COMMENT(build the first page for display);
CHANGE FIELD(#STDRENTRY) TO(M);
********** COMMENT();
CLR_LIST NAMED(#S_184VALL);
CLR_LIST NAMED(#S_184VDSP);
********** COMMENT(Function SET184Y populates list #S_WRKFVC with data);
CALL PROCESS(*DIRECT) FUNCTION(SET184Y) PASS_LST(#S_WRKFVC );
********** COMMENT();
SELECTLIST NAMED(#S_WRKFVC);
ADD_ENTRY TO_LIST(#S_184VALL);
IF COND('#S_184CNT <= #S_184PAGE');
********** COMMENT(add the entry to the list to be displayed to the user);
ADD_ENTRY TO_LIST(#S_184VDSP);
ENDIF;
ENDSELECT;
********** COMMENT(Set the start entry and end entry fields for the);
********** COMMENT(page to be displayed);
IF COND('#S_184CNT > 0');
CHANGE FIELD(#S_184STRP) TO(1);
ELSE;
********** COMMENT(no list entries passed from SET184Y);
CHANGE FIELD(#S_184STRP) TO(0);
MESSAGE MSGID(DEM0046) MSGF(DC@M01);
ENDIF;
********** COMMENT();
WHEN VALUE_IS('= D');
********** COMMENT(Display details);
GET_ENTRY NUMBER(#STDROWNUM) FROM_LIST(#S_184VDSP);
DISPLAY FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_FUNDES *HIDDEN)) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT();
WHEN VALUE_IS('= M');
********** COMMENT((More) Build the next page for display.);
CLR_LIST NAMED(#S_184VDSP);
CHANGE FIELD(#S_184STRP) TO('#S_184STRP + #S_184PAGE');
CHANGE FIELD(#S_184ENDP) TO('(#S_184STRP + #S_184PAGE) - 1');
IF COND('#S_184ENDP > #S_184CNT');
CHANGE FIELD(#S_184ENDP) TO(#S_184CNT);
ENDIF;
BEGIN_LOOP USING(#S_184ENT) FROM(#S_184STRP) TO(#S_184ENDP);
GET_ENTRY NUMBER(#S_184ENT) FROM_LIST(#S_184VALL);
ADD_ENTRY TO_LIST(#S_184VDSP);
END_LOOP;
********** COMMENT();
WHEN VALUE_IS('= P');
********** COMMENT((Previous) Build the previous page for display.);
CLR_LIST NAMED(#S_184VDSP);
CHANGE FIELD(#S_184STRP) TO('#S_184STRP - #S_184PAGE');
CHANGE FIELD(#S_184ENDP) TO('(#S_184STRP + #S_184PAGE) - 1');
BEGIN_LOOP USING(#S_184ENT) FROM(#S_184STRP) TO(#S_184ENDP);
GET_ENTRY NUMBER(#S_184ENT) FROM_LIST(#S_184VALL);
ADD_ENTRY TO_LIST(#S_184VDSP);
END_LOOP;
********** COMMENT();
ENDCASE;
********** COMMENT();
********** COMMENT(Enable the next and previous page buttons.);
CHANGE FIELD(#STDMORE #STDPREV) TO(*BLANK);
IF COND('(#S_184STRP + #S_184PAGE) *LE #S_184CNT');
CHANGE FIELD(#STDMORE) TO(Y);
ENDIF;
IF COND('(#S_184STRP - #S_184PAGE) *GT 0');
CHANGE FIELD(#STDPREV) TO(Y);
ENDIF;
********** COMMENT();
********** COMMENT(Display page of data.);
REQUEST FIELDS((#S_184FDES *INPUT *NOID)(#S_184PAGE *HIDDEN)(#S_184STRP *HIDDEN)(#STDRENTRY *HIDDEN)(#STDPREV *HIDDEN)(#STDMORE *HIDDEN)(#STDROWNUM *HIDDEN)(#S_FUNDES *HIDDEN)) BROWSELIST(#S_184VDSP) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT((Field #S_184FDES has a component S_184FDES which);
********** COMMENT(merges in a component with the same name as the);
********** COMMENT(function (in this case component SET184V)));
********** COMMENT();
IF COND('1 *EQ 2');
********** COMMENT(display for additional browse list.);
DISPLAY BROWSELIST(#S_184VALL) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
ENDIF;
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_184);
********** COMMENT(Function .......: SET184V);
********** COMMENT(Created on .....: 26/07/00 at 14:43:32);
********** COMMENT(Description ....: Sorting columns in a browselist);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show how a webevent function can display a browselist);
********** COMMENT(page at a time);
********** COMMENT(This function was derived from template FRWEBENQ01);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(Receives: nothing);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*WEBEVENT *DIRECT);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT();
********** COMMENT();
DEFINE FIELD(#S_184CNT) REFFLD(#LISTCOUNT) DESC('Total number of entries in listS_184VALL');
********** COMMENT();
********** COMMENT(This field contains the list entry number of the first);
********** COMMENT(list entry to be shown on the page.);
DEFINE FIELD(#S_184STRP) REFFLD(#LISTCOUNT);
********** COMMENT();
DEFINE FIELD(#S_184ENT) REFFLD(#LISTCOUNT);
********** COMMENT();
********** COMMENT(This field contains the list entry number of the last);
********** COMMENT(list entry to be shown on the page.);
DEFINE FIELD(#S_184ENDP) REFFLD(#LISTCOUNT);
********** COMMENT();
DEFINE FIELD(#S_184PAGE) REFFLD(#LISTCOUNT) DEFAULT(10);
********** COMMENT();
********** COMMENT(This list contains the complete product list);
DEF_LIST NAME(#S_184VALL) FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)) COUNTER(#S_184CNT);
********** COMMENT();
********** COMMENT(This list holds just the page of records that are to);
********** COMMENT(be displayed to the user.);
DEF_LIST NAME(#S_184VDSP) FIELDS((#STDSELECT *HIDDEN)(#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC));
********** COMMENT();
********** COMMENT(This list is used when calling function SET184Y);
DEF_LIST NAME(#S_WRKFVC) FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)(#S_184IMG)) TYPE(*WORKING) ENTRYS(0000500);
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
********** COMMENT();
CHANGE FIELD(#S_FUNDES) TO(*FUNCTION_DESC);
********** COMMENT();
********** COMMENT(Determine action to take according to STDRENTRY flag);
CASE OF_FIELD(#STDRENTRY);
********** COMMENT();
WHEN VALUE_IS('= *BLANK');
********** COMMENT(First time in);
********** COMMENT(Get the data and load it into list #S_184VALL);
********** COMMENT(build the first page for display);
CHANGE FIELD(#STDRENTRY) TO(M);
********** COMMENT();
CLR_LIST NAMED(#S_184VALL);
CLR_LIST NAMED(#S_184VDSP);
********** COMMENT(Function SET184Y populates list #S_WRKFVC with data);
CALL PROCESS(*DIRECT) FUNCTION(SET184Y) PASS_LST(#S_WRKFVC );
********** COMMENT();
SELECTLIST NAMED(#S_WRKFVC);
ADD_ENTRY TO_LIST(#S_184VALL);
IF COND('#S_184CNT <= #S_184PAGE');
********** COMMENT(add the entry to the list to be displayed to the user);
ADD_ENTRY TO_LIST(#S_184VDSP);
ENDIF;
ENDSELECT;
********** COMMENT(Set the start entry and end entry fields for the);
********** COMMENT(page to be displayed);
IF COND('#S_184CNT > 0');
CHANGE FIELD(#S_184STRP) TO(1);
ELSE;
********** COMMENT(no list entries passed from SET184Y);
CHANGE FIELD(#S_184STRP) TO(0);
MESSAGE MSGID(DEM0046) MSGF(DC@M01);
ENDIF;
********** COMMENT();
WHEN VALUE_IS('= D');
********** COMMENT(Display details);
GET_ENTRY NUMBER(#STDROWNUM) FROM_LIST(#S_184VDSP);
DISPLAY FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_FUNDES *HIDDEN)) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT();
WHEN VALUE_IS('= M');
********** COMMENT((More) Build the next page for display.);
CLR_LIST NAMED(#S_184VDSP);
CHANGE FIELD(#S_184STRP) TO('#S_184STRP + #S_184PAGE');
CHANGE FIELD(#S_184ENDP) TO('(#S_184STRP + #S_184PAGE) - 1');
IF COND('#S_184ENDP > #S_184CNT');
CHANGE FIELD(#S_184ENDP) TO(#S_184CNT);
ENDIF;
BEGIN_LOOP USING(#S_184ENT) FROM(#S_184STRP) TO(#S_184ENDP);
GET_ENTRY NUMBER(#S_184ENT) FROM_LIST(#S_184VALL);
ADD_ENTRY TO_LIST(#S_184VDSP);
END_LOOP;
********** COMMENT();
WHEN VALUE_IS('= P');
********** COMMENT((Previous) Build the previous page for display.);
CLR_LIST NAMED(#S_184VDSP);
CHANGE FIELD(#S_184STRP) TO('#S_184STRP - #S_184PAGE');
CHANGE FIELD(#S_184ENDP) TO('(#S_184STRP + #S_184PAGE) - 1');
BEGIN_LOOP USING(#S_184ENT) FROM(#S_184STRP) TO(#S_184ENDP);
GET_ENTRY NUMBER(#S_184ENT) FROM_LIST(#S_184VALL);
ADD_ENTRY TO_LIST(#S_184VDSP);
END_LOOP;
********** COMMENT();
ENDCASE;
********** COMMENT();
********** COMMENT(Enable the next and previous page buttons.);
CHANGE FIELD(#STDMORE #STDPREV) TO(*BLANK);
IF COND('(#S_184STRP + #S_184PAGE) *LE #S_184CNT');
CHANGE FIELD(#STDMORE) TO(Y);
ENDIF;
IF COND('(#S_184STRP - #S_184PAGE) *GT 0');
CHANGE FIELD(#STDPREV) TO(Y);
ENDIF;
********** COMMENT();
********** COMMENT(Display page of data.);
REQUEST FIELDS((#S_184FDES *INPUT *NOID)(#S_184PAGE *HIDDEN)(#S_184STRP *HIDDEN)(#STDRENTRY *HIDDEN)(#STDPREV *HIDDEN)(#STDMORE *HIDDEN)(#STDROWNUM *HIDDEN)(#S_FUNDES *HIDDEN)) BROWSELIST(#S_184VDSP) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT((Field #S_184FDES has a component S_184FDES which);
********** COMMENT(merges in a component with the same name as the);
********** COMMENT(function (in this case component SET184V)));
********** COMMENT();
IF COND('1 *EQ 2');
********** COMMENT(display for additional browse list.);
DISPLAY BROWSELIST(#S_184VALL) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
ENDIF;