{ ------------------------------------------------------------------ PROGRAMA : CPPRCS002 OBJETIVO : Capturar, Modificar, Eliminar registros de la Tabla de Suplidores. PROGRAMADOR : Tadeo A. Ferreras FECHA REALIZACION : Oct. 20, 1993. ------------------------------------------------------------------ } GLOBALS "cpprgb000.4gl" DEFINE suplidor RECORD LIKE cotb00001.* DEFINE otros_d RECORD nom_pais CHAR(30), term_sp CHAR(30) END RECORD FUNCTION cpprcs002() CLEAR SCREEN OPTIONS FORM LINE 9, ERROR LINE 23, COMMENT LINE 21 OPEN FORM cpfmcs002 FROM "cpfmcs002" DISPLAY FORM cpfmcs002 #CALL pantalla() DISPLAY "cpprcs002" AT 4,3 DISPLAY "Maestra de Suplidores" AT 6,29 MENU "OPCIONES" COMMAND "Consultar" " Realiza Busqueda Cancela Operacion" CALL copcmf001() COMMAND "Salir" "Retorna Menu Anterior" EXIT MENU END MENU END FUNCTION FUNCTION copcmf001() WHENEVER ERROR CONTINUE # Aqui se prepara para la captura del criterio de seleccion CONSTRUCT criterio ON cotb00001.* FROM cotb00001.* IF int_flag THEN LET numero_msg = 2 CALL msg(numero_msg) LET int_flag = false RETURN END IF LET SELEC = "SELECT UNIQUE cotb00001.* FROM cotb00001 ", "WHERE cotb00001.status_t is null AND ",criterio clipped, " ORDER BY 1,2,3,4" PREPARE busca FROM selec CALL integridad() IF bandera = 1 THEN LET bandera = 0 RETURN END IF DECLARE datos SCROLL CURSOR FOR busca OPEN datos CALL integridad() IF bandera = 1 THEN LET bandera = 0 RETURN END IF FETCH FIRST datos INTO suplidor.* IF status = NOTFOUND THEN LET numero_msg = 3 CALL msg(numero_msg) RETURN END IF CALL desplegar02() MENU "OPCIONES " COMMAND "Siguiente" "Presenta en pantalla el proximo registro encontrado" FETCH NEXT datos INTO suplidor.* IF status = NOTFOUND THEN LET numero_msg = 4 CALL msg(numero_msg) END IF CALL desplegar02() COMMAND "Anterior" "Presenta en pantalla el registro anterior encontrado" FETCH PREVIOUS datos INTO suplidor.* IF status = NOTFOUND THEN LET numero_msg = 5 CALL msg(numero_msg) END IF CALL desplegar02() COMMAND "Primero" "Presenta en pantalla el primer registro encontrado" FETCH FIRST datos INTO suplidor.* CALL desplegar02() LET numero_msg = 5 CALL msg(numero_msg) COMMAND "Ultimo" "Presenta en pantalla el ultimo registro encontrado" FETCH LAST datos INTO suplidor.* CALL desplegar02() LET numero_msg = 4 CALL msg(numero_msg) COMMAND "Retornar" "Retorna al menu anterior" CLEAR FORM EXIT MENU END MENU END FUNCTION FUNCTION desplegar02() SELECT UNIQUE a.nom_pais INTO otros_d.nom_pais FROM cotb00018 a WHERE a.cod_pais = suplidor.cod_pais SELECT UNIQUE a.descrip_term INTO otros_d.term_sp FROM cotb00024 a WHERE a.term_sp = suplidor.term_sp DISPLAY BY NAME suplidor.*,otros_d.* END FUNCTION