diff --git a/SAILPOINT/Functions/ES_GET_ALL_MAPICS_USERS.sql b/SAILPOINT/Functions/ES_GET_ALL_MAPICS_USERS.sql
index e784465..722da89 100644
--- a/SAILPOINT/Functions/ES_GET_ALL_MAPICS_USERS.sql
+++ b/SAILPOINT/Functions/ES_GET_ALL_MAPICS_USERS.sql
@@ -1 +1,91 @@
-âÅã@×ÁãÈ@\ÓÉÂÓ@^@
%
%ÃÙÅÁãÅ@ÖÙ@ÙÅ×ÓÁÃÅ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâmÇÅãmÁÓÓmÔÁ×ÉÃâmäâÅÙâ@M@
%ÅÕåÉÙÖÕÔÅÕã@åÁÙÃÈÁÙMò]@]@
%ÙÅãäÙÕâ@ÃÓÖÂMòñô÷ôøóöô÷]@@@
%ÓÁÕÇäÁÇÅ@âØÓ@
%â×ÅÃÉÆÉÃ@âÁÉÓ×ÖÉÕãKÅâÙãåÔäâÙâ@
%ÕÖã@ÄÅãÅÙÔÉÕÉâãÉÃ@
%ÔÖÄÉÆÉÅâ@âØÓ@ÄÁãÁ@
%ÃÁÓÓÅÄ@ÖÕ@ÕäÓÓ@ÉÕ×äã@
%ÕÖã@ÆÅÕÃÅÄ@
%âÅã@Ö×ãÉÖÕ@@ÁÓæÂÓÒ@~@\ÁÓÓÙÅÁÄ@k@
%ÁÓæÃ×èÄãÁ@~@\Ö×ãÉÔÉéÅ@k@
%ÃÖÔÔÉã@~@\ÕÖÕÅ@k@
%ÄÂÇåÉÅæ@~@\âÖäÙÃÅ@k@
%ÄÅÃÙÅâäÓã@~@Móñk@óñk@ðð]@k@
%ÄèÕÄÆãÃÖÓ@~@\ÕÖ@k@
%ÄèÕäâÙ×ÙÆ@~@\ÖæÕÅÙ@k@
%âÙãâÅØ@~@\ÈÅç@@@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@ÃÖÕãÉÕäÅ@ÈÁÕÄÓÅÙ@ÆÖÙ@âØÓÅçÃÅ×ãÉÖÕ@
%ÂÅÇÉÕ@
%ÄÅÃÓÁÙÅ@åmâØÓâãÁãÅ@ÃÈÁÙ@M@õ@]@^@
%ÄÅÃÓÁÙÅ@åmÄÂòmÙÅãäÙÕmÃÖÄÅ@ÉÕã@^@
%ÄÅÃÓÁÙÅ@åmÄÂòmÔÅââÁÇÅmÉÄ@ÃÈÁÙ@M@÷@]@^@
%ÄÅÃÓÁÙÅ@åmÅÙÙÖÙmÔÅââÁÇÅ@ÃÓÖÂ@M@òðôø@]@^@
%``@Ã�—£¤™…@„‰�‡•–¢£‰ƒ@‰•†–@
%ÇÅã@ÄÉÁÇÕÖâãÉÃâ@ÃÖÕÄÉãÉÖÕ@ñ@
%åmÄÂòmÙÅãäÙÕmÃÖÄÅ@~@ÄÂòmÙÅãäÙÕÅÄmâØÓÃÖÄÅ@k@åmâØÓâãÁãÅ@~@ÙÅãäÙÕÅÄmâØÓâãÁãÅ@k@åmÅÙÙÖÙmÔÅââÁÇÅ@~@ÔÅââÁÇÅmãÅçã@k@
%åmÄÂòmÔÅââÁÇÅmÉÄ@~@ÄÂòmÔÅââÁÇÅmÉÄ@^@
%ÙÅãäÙÕ@
%M@
%åÁÓäÅâ@ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@åÁÓäÅ@}†�“¢…}@k@}âØÓÉ•†–}@åÁÓäÅ@ÑâÖÕmÖÂÑÅÃã@M@
%}âØÓâ£�£…}@åÁÓäÅ@åmâØÓâãÁãÅ@k@}âØÓÃ–„…}@åÁÓäÅ@åmÄÂòmÙÅãäÙÕmÃÖÄÅ@k@}”…¢¢�‡…ÉÄ}@åÁÓäÅ@åmÄÂòmÔÅââÁÇÅmÉÄ@k@
%}”…¢¢�‡…}@åÁÓäÅ@åmÅÙÙÖÙmÔÅââÁÇÅ@k@}ƒ¤™™…•£ã‰”…¢£�”—}@åÁÓäÅ@ÃäÙÙÅÕãmãÉÔÅâãÁÔ×@
%]@
%]@]@^@
%ÅÕÄ@^@
%âÅã@ÃÉâãÖÖÓâ@K@ÓÉÂÓ@~@ÃÉâãÖÖÓâ@K@âÅãmÓÉÂÙÁÙèmÓÉâã@M@ÅÕåÉÙÖÕÔÅÕã@]@^@
%``@Ã�““@Ã‰¢£––“¢aâ£�™£mÔ�—‰ƒ¢MÅ•¥‰™–•”…•£]^@
%ÙÅãäÙÕ@
%ÃÖÁÓÅâÃÅ@M@
%ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@åÁÓäÅ@}£™¤…}@k@}„�£�}@åÁÓäÅ@M@
%âÅÓÅÃã@ÑâÖÕmÁÙÙÁèÁÇÇ@M@
%ÑâÖÕmÖÂÑÅÃã@M@
%}¤¢…™É„}@åÁÓäÅ@ãÙÉÔ@M@ÃÁâã@M@ÆðÂäÃÄ@Áâ@åÁÙÃÈÁÙ@M@ñð@]@ÃÃâÉÄ@ó÷@]@]@k@}¤¢…™Õ�”…}åÁÓäÅ@ãÙÉÔ@M@
%ÃÁâã@M@ÆðÈñãç@Áâ@åÁÙÃÈÁÙ@M@öð@]@ÃÃâÉÄ@ó÷@]@]@k@}¤¢…™ã¨—…}@åÁÓäÅ@ãÙÉÔ@M@ÃÁâã@M@
%ÃÁâÅ@Åçãè×Å@
%æÈÅÕ@}@}@ãÈÅÕ@}Ç…•…™�“@ä¢…™}@
%æÈÅÕ@}Á}@ãÈÅÕ@}Á„”‰•‰¢£™�£–™}@
%æÈÅÕ@}â}@ãÈÅÕ@}â¨¢£…”aÁ——“‰ƒ�£‰–•@ä¢…™}@
%æÈÅÕ@}Ç}@ãÈÅÕ@}Ç…•…™‰ƒ@ä¢…™}@
%ÅÓâÅ@}Mä•’•–¦•]}@
%ÅÕÄ@Áâ@åÁÙÃÈÁÙ@M@õð@]@ÃÃâÉÄ@ó÷@]@]@k@}¤¢…™Ä…—£}@åÁÓäÅ@ÑâÖÕmÖÂÑÅÃã@M@
%ãÙÉÔ@M@ÃÁâã@M@ÅçÄÅ×ã@Áâ@åÁÙÃÈÁÙ@M@ñð@]@ÃÃâÉÄ@ó÷@]@]@åÁÓäÅ@ãÙÉÔ@M@ÃÁâã@M@ÅäÄÅâÃ@Áâ@åÁÙÃÈÁÙ@M@öð@]@ÃÃâÉÄ@ó÷@]@]@
%ÁÂâÅÕã@ÖÕ@ÕäÓÓ@
%]@k@}¤¢…™Å”—Õ–}@åÁÓäÅ@ãÙÉÔ@M@ÃÁâã@M@ÅçãðøÁ@Áâ@åÁÙÃÈÁÙ@M@ñð@]@ÃÃâÉÄ@ó÷@]@]@k@}¢£�£¤¢}@åÁÓäÅ@ãÙÉÔ@M@ÃÁâã@M@
%ÃÁâÅ@ÅçâãÁã@
%æÈÅÕ@}Á}@ãÈÅÕ@}Áƒ£‰¥…}@
%æÈÅÕ@}@}@ãÈÅÕ@}ä•’•–¦•}@
%æÈÅÕ@}Ä}@ãÈÅÕ@}Ä‰¢�‚“…„}@
%ÅÕÄ@Áâ@åÁÙÃÈÁÙ@M@ñõ@]@ÃÃâÉÄ@ó÷@]@]@
%]@
%]@
%ÆÙÖÔ@ÔéÆðÙÅ×@
%ÑÖÉÕ@ÅâäÅç×@
%ÓÅÆã@ÑÖÉÕ@ÅâÄ×ã×@
%ÖÕ@ÅçÄÅ×ã@~@ÅäÄÅ×ã@
%ÖÕ@ÆðÂäÃÄ@~@ÅçäâÅÙ@
%ÑÖÉÕ@ÔéÇäÃ×âð@
%ÖÕ@ÇäÂäÃÄ@~@ÆðÂäÃÄ@
%æÈÅÙÅ@Åçãè×Å@Ln@}Ù}@ÁÕÄ@
%ÆðäÇÙ×@~@ð@]@ÆÖÙÔÁã@ÑâÖÕ@
%]@k@ÑâÖÕmÖÂÑÅÃã@M@
%}¢¤ƒƒ…¢¢}@åÁÓäÅ@}†�“¢…}@k@}âØÓÉ•†–}@åÁÓäÅ@ÑâÖÕmÖÂÑÅÃã@M@
%}”…¢¢�‡…ÉÄ}@åÁÓäÅ@}âØÓðòððð}@k@}”…¢¢�‡…}@åÁÓäÅ@}Ù…˜¤…¢£…„@¤¢…™@•–£@†–¤•„@}@k@
%}ƒ¤™™…•£ã‰”…¢£�”—}@åÁÓäÅ@ÃäÙÙÅÕãmãÉÔÅâãÁÔ×@
%]@
%]@]@^@
%ÅÕÄ@@^@
%
%ÇÙÁÕã@ÁÓãÅÙ@k@ÅçÅÃäãÅ@@@
%ÖÕ@â×ÅÃÉÆÉÃ@ÆäÕÃãÉÖÕ@âÁÉÓ×ÖÉÕãKÅâÙãåÔäâÙâ@
%ãÖ@ÁÔÁ×ÉÃâ@æÉãÈ@ÇÙÁÕã@Ö×ãÉÖÕ@^@
%
%ÇÙÁÕã@ÅçÅÃ
\ No newline at end of file
+SET PATH *LIBL ; 
+
+CREATE OR REPLACE FUNCTION SAILPOINT.ES_GET_ALL_MAPICS_USERS ( 
+	ENVIRONMENT VARCHAR(2) ) 
+	RETURNS CLOB(2147483647)   
+	LANGUAGE SQL 
+	SPECIFIC SAILPOINT.ESRTVMUSRS 
+	NOT DETERMINISTIC 
+	MODIFIES SQL DATA 
+	CALLED ON NULL INPUT 
+	NOT FENCED 
+	SET OPTION  ALWBLK = *ALLREAD , 
+	ALWCPYDTA = *OPTIMIZE , 
+	COMMIT = *NONE , 
+	DBGVIEW = *SOURCE , 
+	DECRESULT = (31, 31, 00) , 
+	DYNDFTCOL = *NO , 
+	DYNUSRPRF = *OWNER , 
+	SRTSEQ = *HEX   
+	BEGIN 
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION 
+BEGIN 
+DECLARE V_SQLSTATE CHAR ( 5 ) ; 
+DECLARE V_DB2_RETURN_CODE INT ; 
+DECLARE V_DB2_MESSAGE_ID CHAR ( 7 ) ; 
+DECLARE V_ERROR_MESSAGE CLOB ( 2048 ) ; 
+-- Capture diagnostic info 
+GET DIAGNOSTICS CONDITION 1 
+V_DB2_RETURN_CODE = DB2_RETURNED_SQLCODE , V_SQLSTATE = RETURNED_SQLSTATE , V_ERROR_MESSAGE = MESSAGE_TEXT , 
+V_DB2_MESSAGE_ID = DB2_MESSAGE_ID ; 
+RETURN 
+( 
+VALUES JSON_OBJECT ( 
+'success' VALUE 'false' , 'SQLInfo' VALUE JSON_OBJECT ( 
+'SQLState' VALUE V_SQLSTATE , 'SQLCode' VALUE V_DB2_RETURN_CODE , 'messageID' VALUE V_DB2_MESSAGE_ID , 
+'message' VALUE V_ERROR_MESSAGE , 'currentTimestamp' VALUE CURRENT_TIMESTAMP 
+) 
+) ) ; 
+END ; 
+SET CISTOOLS . LIBL = CISTOOLS . SET_LIBRARY_LIST ( ENVIRONMENT ) ; 
+-- Call Cistools/Start_Mapics(Environment); 
+RETURN 
+COALESCE ( 
+JSON_OBJECT ( 
+'success' VALUE 'true' , 'data' VALUE ( 
+SELECT JSON_ARRAYAGG ( 
+JSON_OBJECT ( 
+'userId' VALUE TRIM ( CAST ( F0BUCD AS VARCHAR ( 10 ) CCSID 37 ) ) , 'userName'VALUE TRIM ( 
+CAST ( F0H1TX AS VARCHAR ( 60 ) CCSID 37 ) ) , 'userType' VALUE TRIM ( CAST ( 
+CASE EXTYPE 
+WHEN ' ' THEN 'General User' 
+WHEN 'A' THEN 'Administrator' 
+WHEN 'S' THEN 'System/Application User' 
+WHEN 'G' THEN 'Generic User' 
+ELSE '(Unknown)' 
+END AS VARCHAR ( 50 ) CCSID 37 ) ) , 'userDept' VALUE JSON_OBJECT ( 
+TRIM ( CAST ( EXDEPT AS VARCHAR ( 10 ) CCSID 37 ) ) VALUE TRIM ( CAST ( EUDESC AS VARCHAR ( 60 ) CCSID 37 ) ) 
+ABSENT ON NULL 
+) , 'userEmpNo' VALUE TRIM ( CAST ( EXT08A AS VARCHAR ( 10 ) CCSID 37 ) ) , 'status' VALUE TRIM ( CAST ( 
+CASE EXSTAT 
+WHEN 'A' THEN 'Active' 
+WHEN ' ' THEN 'Unknown' 
+WHEN 'D' THEN 'Disabled' 
+END AS VARCHAR ( 15 ) CCSID 37 ) ) 
+) 
+) 
+FROM MZF0REP 
+JOIN ESUEXP 
+LEFT JOIN ESDPTP 
+ON EXDEPT = EUDEPT 
+ON F0BUCD = EXUSER 
+JOIN MZGUCPS0 
+ON GUBUCD = F0BUCD 
+WHERE EXTYPE <> 'R' AND 
+F0UGRP = 0 ) FORMAT JSON 
+) , JSON_OBJECT ( 
+'success' VALUE 'false' , 'SQLInfo' VALUE JSON_OBJECT ( 
+'messageID' VALUE 'SQL02000' , 'message' VALUE 'Requested user not found ' , 
+'currentTimestamp' VALUE CURRENT_TIMESTAMP 
+) 
+) ) ; 
+END  ; 
+
+GRANT ALTER , EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.ESRTVMUSRS 
+TO AMAPICS WITH GRANT OPTION ; 
+
+GRANT EXECUTE   
+ON SPECIFIC FUNCTION SAILPOINT.ESRTVMUSRS 
+TO PUBLIC ; 
+
