Function SET184W

LANSA

Function SET184W

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_184);
********** COMMENT(Function .......: SET184W);
********** COMMENT(Created on .....: 26/07/00 at 14:43:32);
********** COMMENT(Description ....: A do it yourself browselist);
********** COMMENT();
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show how a function can construct a browselist line by);
********** COMMENT(line.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT();
********** COMMENT(Receives: nothing);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT();
********** COMMENT();
DEFINE FIELD(#S_184BCMP) TYPE(*CHAR) LENGTH(015);
********** COMMENT();
********** COMMENT(Fields to hold the column headings);
DEFINE FIELD(#S_184COL1) TYPE(*CHAR) LENGTH(020) INPUT_ATR(LC) DEFAULT('''Code''');
DEFINE FIELD(#S_184COL2) TYPE(*CHAR) LENGTH(020) INPUT_ATR(LC) DEFAULT('''Description''');
DEFINE FIELD(#S_184COL3) TYPE(*CHAR) LENGTH(020) INPUT_ATR(LC) DEFAULT('''Quantity''');
DEFINE FIELD(#S_184COL4) TYPE(*CHAR) LENGTH(020) INPUT_ATR(LC) DEFAULT('''Unit''');
DEFINE FIELD(#S_184COL5) TYPE(*CHAR) LENGTH(020) INPUT_ATR(LC) DEFAULT('''Unit Price''');
DEFINE FIELD(#S_184COL6) TYPE(*CHAR) LENGTH(020) INPUT_ATR(LC) DEFAULT('''Total Price''');
********** COMMENT();
GROUP_BY NAME(#S_GRPPANL) FIELDS((#S_184FDES *INPUT *NOID)(#S_FUNDES *HIDDEN));
********** 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 SET184W)));
********** COMMENT();
********** COMMENT();
DEF_LIST NAME(#S_184WFVC) FIELDS((#S_184BCMP *INPUT)(#S_184CDE *HIDDEN)(#S_184DES *HIDDEN)(#S_184QTY *HIDDEN)(#S_184UNIT *HIDDEN)(#S_184UPRC *HIDDEN)(#S_184TPRC *HIDDEN)(#S_184COL1 *HIDDEN)(#S_184COL2 *HIDDEN)(#S_184COL3 *HIDDEN)(#S_184COL4 *HIDDEN)(#S_184COL5 *HIDDEN)(#S_184COL6 *HIDDEN));
********** COMMENT((Field #S_184BCMP contains the name of the component);
********** COMMENT(to be used for the browselist line being added.);
********** COMMENT(Different components can be used for different);
********** COMMENT(lines of the browselist. #S_184LTYP can be used to);
********** COMMENT(give different browselist lines different attributes,);
********** COMMENT(even when they use the same component.));
********** COMMENT(The components used in #S_184BCMP are:);
********** COMMENT(S_184STRT - begin browselist html);
********** COMMENT(S_184COLH - column heading html);
********** COMMENT(S_184DATA1 - browselist line input);
********** COMMENT(S_184DATA2 - browselist line output);
********** COMMENT(S_184ENDT - end browselist html.);
********** COMMENT();
********** COMMENT(Note: this allows dynamic column headings, as well as);
********** COMMENT(dynamic browselist line format.));
********** COMMENT();
********** COMMENT();
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();
CHANGE FIELD(#S_FUNDES) TO(*FUNCTION_DESC);
********** COMMENT();
CLR_LIST NAMED(#S_184WFVC);
********** COMMENT(Function SET184Y populates list #S_WRKFVC with data);
CALL PROCESS(*DIRECT) FUNCTION(SET184Y) PASS_LST(#S_WRKFVC );
********** COMMENT();
********** COMMENT(Now build the browselist:);
********** COMMENT();
********** COMMENT(Because *LW3BL_S_184WFVC = *NOCBITP,);
********** COMMENT(all of the browselist header, trailer, column headings);
********** COMMENT(and lines must be constructed as entries are added);
********** COMMENT();
********** COMMENT();
********** COMMENT(First, add the start table tag: <TABLE>);
CHANGE FIELD(#S_184BCMP) TO(S_184STRT);
ADD_ENTRY TO_LIST(#S_184WFVC);
********** COMMENT();
********** COMMENT(Second, add the column headings. These can be set to);
********** COMMENT(any value by changing fields #S_184COLn, but in this);
********** COMMENT(case the default values will do.);
********** COMMENT();
CHANGE FIELD(#S_184BCMP) TO(S_184COLH);
ADD_ENTRY TO_LIST(#S_184WFVC);
********** COMMENT();
********** COMMENT(Now add the lines. In this case where the total price);
********** COMMENT(is greater than $1000, the line will be made input);
********** COMMENT(capable. This is done by using component S_184DATA1);
********** COMMENT(instead of component S_184DATA2);
********** COMMENT();
********** COMMENT();
SELECTLIST NAMED(#S_WRKFVC);
IF COND('#S_184TPRC *GT 1000');
CHANGE FIELD(#S_184BCMP) TO(S_184DATA1);
ELSE;
CHANGE FIELD(#S_184BCMP) TO(S_184DATA2);
ENDIF;
********** COMMENT();
ADD_ENTRY TO_LIST(#S_184WFVC);
ENDSELECT;
********** COMMENT(Last, add the end table tag: </TABLE>);
CHANGE FIELD(#S_184BCMP) TO(S_184ENDT);
ADD_ENTRY TO_LIST(#S_184WFVC);
********** COMMENT();
REQUEST FIELDS(#S_GRPPANL) BROWSELIST(#S_184WFVC) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT(The appearance of browselist S_184WFVC is altered);
********** COMMENT(because there is a graphical variable);
********** COMMENT(*LW3BL_S_184WFVC which has been set to *NOCBITP);
********** COMMENT(This has removed all the html that would normally be);
********** COMMENT(added around browselist data.);
********** COMMENT(The graphical variable is created using the LANSA);
********** COMMENT(Web administrator. It is of type text, and value);
********** COMMENT(*NOCBITP);
********** COMMENT();
********** COMMENT(A system variable must also be created with the same);
********** COMMENT(name, (alpha 255 uses 3GL W3@P2100));