Function SET178W Maintain Products

LANSA

Function SET178W Maintain Products

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_178);
********** COMMENT(Function .......: SET178W);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Maintain Product - Subtypes);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(maintain the product - subtype records);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(=======================================================);
DEF_LIST NAME(#S_LSTPRD) FIELDS((#S_178PRD)(#S_178DVTP)(#S_178SBTP)(#S_178BRND)(#S_178PRCE)(#S_178PDES)(#S_178PTEC));
BEGIN_LOOP;
SET_MODE TO(*ADD);
CLR_LIST NAMED(#S_LSTPRD);
SELECT FIELDS(#S_LSTPRD) FROM_FILE(SETPRD);
ADD_ENTRY TO_LIST(#S_LSTPRD);
ENDSELECT;
CHANGE FIELD(#S_LSTPRD) TO(*NULL);
BEGIN_LOOP TO(40);
ADD_ENTRY TO_LIST(#S_LSTPRD);
END_LOOP;
REQUEST BROWSELIST(#S_LSTPRD);
SELECTLIST NAMED(#S_LSTPRD);
IF COND('#S_178PRD *NE 0');
CHECK_FOR IN_FILE(SETPRD) WITH_KEY(#S_178PRD #S_178DVTP #S_178SBTP);
IF_STATUS IS(*EQUALKEY);
UPDATE FIELDS(#S_LSTPRD) IN_FILE(SETPRD) WITH_KEY(#S_178PRD #S_178DVTP #S_178SBTP);
ELSE;
INSERT FIELDS(#S_LSTPRD) TO_FILE(SETPRD);
ENDIF;
ENDIF;
ENDSELECT;
END_LOOP;