 'set msg_mode     = ms_logger.G_MSG_MODE_NORMAL'||unistr('\000a')||
 '   ,open_process = ms_logger.G_OPEN_PROCESS_IF_CLOSED'||unistr('\000a')||
 'where module_type = ''REPORT'''||unistr('\000a')||
+'and   owner = :P9_OWNER'||unistr('\000a')||
 ';'||unistr('\000a')||
 ''||unistr('\000a')||
 '--Set Report Units to Overridden'||unistr('\000a')||
 'update ms_unit'||unistr('\000a')||
 'set msg_mode     = ms_logger.G_MSG_MODE_DEFAULT '||unistr('\000a')||
 '   ,open_process = ms_logger.G_OPEN_PROCESS_DEFAULT'||unistr('\000a')||
-'where module_id in (select module_id from ms_module where module_type ';
-
-p:=p||'= ''REPORT'')'||unistr('\000a')||
+'where module_id in (select module_id from ms_m';
+
+p:=p||'odule where module_type = ''REPORT'' and owner = :P9_OWNER)'||unistr('\000a')||
 ';'||unistr('\000a')||
 ''||unistr('\000a')||
 '--Set Reports Parameter routine to debug.'||unistr('\000a')||
 'update ms_unit'||unistr('\000a')||
 'set msg_mode     = ms_logger.G_MSG_MODE_DEBUG'||unistr('\000a')||
 'where unit_name  = ''get_parameters'''||unistr('\000a')||
-'and module_id in (select module_id from ms_module where module_type = ''REPORT'')'||unistr('\000a')||
+'and module_id in (select module_id from ms_module where module_type = ''REPORT'' and owner = :P9_OWNER)'||unistr('\000a')||
 ';'||unistr('\000a')||
 ''||unistr('\000a')||
 '--Set Report Library Modules to Disabled'||unistr('\000a')||
 'update ms_module'||unistr('\000a')||
-'set msg_mode     = ms_logger.G_MSG_MODE_DISABLED'||unistr('\000a')||
+'set msg_mode     = ms_logger.G_MSG_MO';
+
+p:=p||'DE_DISABLED'||unistr('\000a')||
 '   ,open_process = ms_logger.G_OPEN_PROCESS_NEVER'||unistr('\000a')||
-'where ';
-
-p:=p||'module_type = ''REPORT_LIB'''||unistr('\000a')||
+'where module_type = ''REPORT_LIB'''||unistr('\000a')||
+'and   owner = :P9_OWNER'||unistr('\000a')||
 ';'||unistr('\000a')||
 ''||unistr('\000a')||
 '--Set Report Library Units to Overridden'||unistr('\000a')||
 'update ms_unit'||unistr('\000a')||
 'set msg_mode     = ms_logger.G_MSG_MODE_DEFAULT '||unistr('\000a')||
 '   ,open_process = ms_logger.G_OPEN_PROCESS_DEFAULT'||unistr('\000a')||
-'where module_id in (select module_id from ms_module where module_type = ''REPORT_LIB'')'||unistr('\000a')||
-';'||unistr('\000a')||
-''||unistr('\000a')||
-''||unistr('\000a')||
+'where module_id in (select module_id from ms_module where module_type = ''REPORT_LIB'' and owner = :P9_OWNER)'||unistr('\000a')||
+';'||unistr('\000a')||
 ' '||unistr('\000a')||
-''||unistr('\000a')||
-''||unistr('\000a')||
-''||unistr('\000a')||
-''||unistr('\000a')||
-''||unistr('\000a')||
 'commit;';
 
 wwv_flow_api.create_page_process(

p:=p||'update ms_module'||unistr('\000a')||
'set msg_mode     = ms_logger.G_MSG_MODE_NORMAL'||unistr('\000a')||
'--DONT CHANGE OPEN_PROCESS   ,open_process = ms_logger.G_OPEN_PROCESS_IF_CLOSED'||unistr('\000a')||
';'||unistr('\000a')||
''||unistr('\000a')||
'update ms_unit'||unistr('\000a')||
'set msg_mode     = ms_logger.G_MSG_MODE_DEFAULT '||unistr('\000a')||
'   ,open_process = ms_logger.G_OPEN_PROCESS_DEFAULT'||unistr('\000a')||
';'||unistr('\000a')||
''||unistr('\000a')||
'commit;';

  p_process_type=> 'PLSQL',
  p_process_name=> 'SetAllQuiet',
  p_process_sql_clob => p,
  p_process_error_message=> 'Failed to set &P9_OWNER. modules to Quiet mode.',
  p_error_display_location=> 'INLINE_IN_NOTIFICATION',
  p_process_when_button_id=>3520316226535807 + wwv_flow_api.g_id_offset,
  p_only_for_changed_rows=> 'Y',
  p_process_success_message=> 'All &P9_OWNER. Modules are now in Quiet mode.  No Processes will start.',
  p_process_is_stateful_y_n=>'N',
  p_process_comment=>'');
end;
