Function SET011A: Populate Working List for Menu

LANSA

Function SET011A: Populate Working List for Menu

FUNCTION OPTIONS(*DIRECT);
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_011);
********** COMMENT(Function .......: SET011A);
********** COMMENT(Created on .....: 20/02/00);
********** COMMENT();
********** COMMENT(Full Description: This function populates a workinglist);
********** COMMENT(called DATALISTW by reading the department file DEPTAB);
********** COMMENT(and the sections for each department from SECTAB.);
********** COMMENT(DATALISTW will end up with the descriptions of the);
********** COMMENT(different departments and sections that will appear in);
********** COMMENT(the expandable menu on the browser.);
********** COMMENT(This menu supports only two levels:);
********** COMMENT(1. Menu (S_011MTYP = M)_in this case the Departments);
********** COMMENT(2. Submennu (S_011MTYP = S) in this case the Department);
********** COMMENT(Sections.);
********** COMMENT();
********** COMMENT(If you customize this example for you own use, you);
********** COMMENT(would probably either run this function once and);
********** COMMENT(do a SAVE_LIST or use a database file. In such case,);
********** COMMENT(function SET011B should be modified to read either from);
********** COMMENT(the saved list or from the file.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT(*******************************************************);
********** COMMENT(Browselist fields:);
********** COMMENT(S_011MNUM: number to group menu and submenu items and);
********** COMMENT(to indicate the position within the whole menu);
********** COMMENT(S_011MDES: menu item displayed description.);
********** COMMENT(S_011MTYP: type of entry, M=Menu, S=Submenu);
********** COMMENT(S_011MCOL: item color);
********** COMMENT(S_011MFLG: flag, E=Expand, C=Collapse);
********** COMMENT(to indicate the position within the whole menu);
DEF_LIST NAME(#DATALISTW) FIELDS((#S_011MNUM)(#S_011MDES)(#S_011MTYP)(#S_011MCOL)(#S_011MFLG)(#DEPTMENT)(#SECTION)) TYPE(*WORKING) ENTRYS(0009999);
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
********** COMMENT(Set the menu to show collapsed (not expanded). Change);
********** COMMENT(this flag to E if you wanted to show the menu initially);
********** COMMENT(expanded or even change it within the select if some);
********** COMMENT(folders should show initially as expanded.);
CHANGE FIELD(#S_011MFLG) TO(C);
********** COMMENT();
SELECT FIELDS(*ALL) FROM_FILE(DEPTAB);
********** COMMENT();
********** COMMENT(Sequential number to indicate the position of the menu);
********** COMMENT(item in the menu.);
CHANGE FIELD(#S_011MNUM) TO('#s_011mnum + 1');
********** COMMENT(Indicates that it is a Menu type entry);
CHANGE FIELD(#S_011MTYP) TO(M);
CHANGE FIELD(#S_011MDES) TO(#DEPTDESC);
CHANGE FIELD(#SECTION) TO(*BLANKS);
ADD_ENTRY TO_LIST(#DATALISTW);
SELECT FIELDS((#SECDESC)(#SECTION)) FROM_FILE(SECTAB) WITH_KEY(#DEPTMENT);
CHANGE FIELD(#S_011MDES) TO(#SECDESC);
********** COMMENT(Indicates that it is a Submenu type entry);
CHANGE FIELD(#S_011MTYP) TO(S);
ADD_ENTRY TO_LIST(#DATALISTW);
ENDSELECT;
ENDSELECT;
********** COMMENT();
CALL PROCESS(*DIRECT) FUNCTION(SET011B) PASS_LST(#DATALISTW );
********** COMMENT();