Display Error Message in OIM 11g
Hi
Requirement: When we create user manually if middle name is empty then show error message as "Middle Name is null. Please enter value"
Steps I have done so far
1. Created below event handler custom code which extends ValidationHandler and specified the logic inside validate() which will throw error message.
package mypackage;
import java.io.Serializable;
import java.util.HashMap;
import oracle.iam.platform.context.ContextAware;
import oracle.iam.platform.kernel.ValidationException;
import oracle.iam.platform.kernel.ValidationFailedException;
import oracle.iam.platform.kernel.spi.ValidationHandler;
import oracle.iam.platform.kernel.vo.BulkOrchestration;
import oracle.iam.platform.kernel.vo.Orchestration;
public class MiddleNameValidation implements ValidationHandler {
@Override
public void validate(long arg0, long arg1, Orchestration orchestration)
throws ValidationException, ValidationFailedException {
// TODO Auto-generated method stub
HashMap<String, Serializable> parameters = orchestration
.getParameters();
String middleName = getParameterValue(parameters, "Middle Name");
if (isNullOrEmpty(middleName)) {
String msg = "NOTE[MIDDLE_NAME_MISSING].text:Middle Name is Missing:"; // Custom error message which should be displayed in console
ValidationFailedException excep = new ValidationFailedException(msg);
throw excep;
@Override
public void validate(long arg0, long arg1, BulkOrchestration arg2)
throws ValidationException, ValidationFailedException {
// TODO Auto-generated method stub
@Override
public void initialize(HashMap<String, String> arg0) {
// TODO Auto-generated method stub
private String getParameterValue(HashMap<String, Serializable> parameters,
String key) {
String value = (parameters.get(key) instanceof ContextAware) ? (String) ((ContextAware) parameters
.get(key)).getObjectValue()
: (String) parameters.get(key);
System.out.println("VALUE::" + value);
return value;
private boolean isNullOrEmpty(String str) {
return str == null || str.isEmpty();
}2. Registered this code as plugin with out errors.
plugin.xml
<?xml version="1.0" encoding="UTF-8" ?>
<oimplugins>
<plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
<plugin pluginclass="mypackage.MiddleNameValidation" version="1.0" name="MiddleNameValidation" />
</plugins>
</oimplugins>
3. Imported eventhandlers.xml file to MDS.
<?xml version='1.0' encoding='utf-8'?>
<eventhandlers>
<action-handler class="com.example.custompph.CustomPreProcessEventHandler" entity-type="User" operation="CREATE" name="CustomPreProcessEventHandler" stage="preprocess" order="1000" sync="TRUE"/>
*<action-handler class="mypackage.MiddleNameValidation" entity-type="User" operation="CREATE" name="MiddleNameValidation" stage="preprocess" order="1000" sync="TRUE"/>*
</eventhandlers>
4. Purged the Cache
But when I tested the same it is not throwing error message but it says ClassCast exception in the logs.
Am I following the correct steps?
Pls help.
<Jul 28, 2011 4:45:42 AM EDT> <Error> <oracle.iam.identity.usermgmt.impl> <IAM-3050030> <An exception occurred while performing the operation.
java.lang.ClassCastException: mypackage.MiddleNameValidation
at oracle.iam.platform.kernel.impl.OrchProcessData.runPreProcessEvents(OrchProcessData.java:868)
at oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:627)
at oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:220)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:665)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.process(OrchestrationEngineImpl.java:435)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:381)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:334)
at oracle.iam.identity.usermgmt.impl.UserManagerImpl.create(UserManagerImpl.java:635)
at oracle.iam.identity.usermgmt.api.UserManagerEJB.createx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy319.createx(Unknown Source)
at oracle.iam.identity.usermgmt.api.UserManager_nimav7_UserManagerRemoteImpl.createx(UserManager_nimav7_UserManagerRemoteImpl.java:1089)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:84)
at $Proxy184.createx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at $Proxy312.createx(Unknown Source)
at oracle.iam.identity.usermgmt.api.UserManagerDelegate.create(Unknown Source)
at oracle.iam.identitytaskflow.backing.taskflows.createuser.CreateUserView.saveUserOperation(CreateUserView.java:521)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:91)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:91)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:421)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:421)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.iam.platform.auth.web.PwdMgmtNavigationFilter.doFilter(PwdMgmtNavigationFilter.java:116)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.iam.platform.auth.web.OIMAuthContextFilter.doFilter(OIMAuthContextFilter.java:101)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:160)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
>
<Jul 28, 2011 4:45:42 AM EDT> <Error> <oracle.iam.identitytaskflow.logging> <BEA-000000> <IAM-3060023>
you must specify the xmlns for the eventhandlers tag in the step 3, like this one
<eventhandlers
xmlns="http://www.oracle.com/schema/oim/platform/kernel"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
Similar Messages
-
Display Custom Error Message in OIM 11g
Hi,
I'm trying to display an error message from a validation event handler but seems that am missing something. When the "oracle.iam.platform.kernel.ValidationFailedException" is thrown from a validation handler an error message is displayed: "An error occurred". If an error code is provided (see code below) then the message looks like: "An error occurred. The corresponding error code is ERR-0001". I guess that some resource bungle with corresponding messages should be provided.
the code used:
package test;
public class UserGeneralValidationHandler implements oracle.iam.platform.kernel.spi.ValidationHandler
@Override
public void validate(long processId, long eventId, Orchestration orchestration)
throws ValidationException
String errorCode = "ERR-0001";
String message = "Simple validation message.";
ValidationFailedException ex = new ValidationFailedException(message);
ex.setProcessID(processId);
ex.setErrorCode(errorCode);
throw ex;
Q:
1.What is missing for complete solution?
2.What is the algorithm that used by OIM to find default or non default resource bundle?
3.How to change out-of-box validation messages? For a sample "The organization ABC does not exist." message is shown if non existing organization is provided during user creation and I'd like to have a different one.
Regards
Sergerename OIMUI.jar to OIMUI.zip
find logging_en and loggin.properties.
Modify the "IAM-2050512" error message with your custom message
Find Agent and agent_en.properties.
Find Note[ERROR_SUBMITTING_REQUEST].text. Modify the message. Make sure the message must be the same with in logging.properties("IAM_2050512")
Deploy
change the OIMUI.zip to jar
replace the existing OIMUI.jar
login to weblogic and redeploy OIM (oim.ear)
no need to restart OIM server.
Test:
create a request in web console again, you must see the custom message when you hit the submit button
hope this helps.
-rad -
Display error message in batch job log
Hello
I have a batch job running and I have an error coming during some validation logic.
The problem is I need to continue the batch job when this error message comes and it should not cancel the batch job as it is doing currently but display that error message in batch job log, there are more similar error messages coming in job log and job gets finished, but when my error message comes job gets cancelled.
I cannot give it as info message as it will give wrong idea about message type.
Is there any FM by which we can add message in job log?Sanjeev I have done that but problem is I do not want to give that as Information message but Error message only and continue processing.
If you see in screenshot 3rd message is given by me as information and you can see error messages also 6th and 7th and job continued till it is finished
Basically I want that 'I' to be displayed as 'E'.
Display error message in batch job log -
How to display error message ??
Hi,
I have a BDC program to upload data from an excel sheet. I could see that some records of data fail to pass and hence after my bdc run i would like to display error message for the failed records as follows:
costcenter:
cost element:
fiscal year:
etc etc
is it possible ?? how to do that ? please explain in detail.
for ur reference my program is pasted below.
thanks
*& Report ZBDC_BUDGET_UPLOAD
REPORT ZBDC_BUDGET_UPLOAD.
types: begin of tdata,
rec(150) type c,
end of tdata,
begin of tmtgp,
costcent LIKE CCSS-KOSTL,
costelem LIKE CCSS-KSTAR,
fisyear LIKE CCSS-GJAHR,
jan(10),
feb(10),
mar(10),
apr(10),
may(10),
jun(10),
jul(10),
aug(10),
sep(10),
oct(10),
nov(10),
dec(10),
end of tmtgp.
data: idata type table of tdata with header line.
data: imtgp type table of tmtgp with header line.
Data : fieldval(10) type c.
selection-screen begin of block b1 with frame title text-001.
parameters: p_file type localfile default 'C:\budget_data_csv.csv'.
selection-screen end of block b1.
include zbdcrecx1.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting static = 'X'
changing file_name = p_file.
start-of-selection.
perform upload_data.
loop at imtgp.
Write imtgp-fisyear to fieldval.
perform open_group.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(04)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KPP0B-VALUE(04)'
fieldval.
Write imtgp-costcent to fieldval.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(06)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KPP0B-VALUE(06)'
fieldval.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(09)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-costelem to fieldval.
perform bdc_field using 'KPP0B-VALUE(09)'
fieldval.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(04)'.
perform bdc_field using 'BDC_OKCODE'
'=CSPB'.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-jan to fieldval.
perform bdc_field using 'Z-BDC03(01)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-feb to fieldval.
perform bdc_field using 'Z-BDC03(02)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(03)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-mar to fieldval.
perform bdc_field using 'Z-BDC03(03)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(04)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-apr to fieldval.
perform bdc_field using 'Z-BDC03(04)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(05)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-may to fieldval.
perform bdc_field using 'Z-BDC03(05)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(06)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-jun to fieldval.
perform bdc_field using 'Z-BDC03(06)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(07)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-jul to fieldval.
perform bdc_field using 'Z-BDC03(07)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(08)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-aug to fieldval.
perform bdc_field using 'Z-BDC03(08)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(09)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-sep to fieldval.
perform bdc_field using 'Z-BDC03(09)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(10)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-oct to fieldval.
perform bdc_field using 'Z-BDC03(10)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(11)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-nov to fieldval.
perform bdc_field using 'Z-BDC03(11)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(12)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
Write imtgp-dec to fieldval.
perform bdc_field using 'Z-BDC03(12)'
fieldval.
perform bdc_dynpro using 'SAPLKPP2' '0110'.
perform bdc_field using 'BDC_CURSOR'
'Z-BDC03(12)'.
perform bdc_field using 'BDC_OKCODE'
'=CBUC'.
perform bdc_transaction using 'KP06'.
perform close_group.
endloop.
form upload_data.
data: filename type string.
clear idata.
refresh idata.
filename = p_file.
call function 'GUI_UPLOAD'
exporting filename = filename
filetype = 'ASC'
tables data_tab = idata
exceptions file_open_error = 1
file_read_error = 2
no_authority = 6
others = 17.
check sy-subrc = 0.
loop at idata.
clear imtgp.
split idata at ',' into imtgp-costcent imtgp-costelem imtgp-fisyear
imtgp-jan imtgp-feb imtgp-mar imtgp-apr imtgp-may imtgp-jun imtgp-jul
imtgp-aug imtgp-sep imtgp-oct imtgp-nov imtgp-dec.
append imtgp.
endloop.
endform.check the below code,.,
DATA : t_bdcmsgcoll TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
CALL TRANSACTION '<DELIVERYTRANSACTION>' USING t_bdctab
mode 'N'
MESSAGES INTO t_bdcmsgcoll.
DESCRIBE TABLE t_bdcmsgcoll LINES g_lines.
READ TABLE t_bdcmsgcoll INDEX g_lines.
IF t_bdcmsgcoll-msgtyp = 'S' AND
t_bdcmsgcoll-msgid = <Msg id> AND
t_bdcmsgcoll-msgnr = <Msg number>.
* Trap your Call Transaction messages
t_success-deliverynumber = t_bdcmsgcoll-msgv1.
* You can format the message returned by call transaction using function 'FORMAT_MESSAGE' which will return g_mesg
t_success-message = g_mesg.
APPEND t_success.
CLEAR t_success.
ELSE.
* If there an Error-Do this..
READ TABLE t_bdcmsgcoll WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
* Format your message using FORMAT_MESSAGE "FM
CLEAR g_mesg.
t_error-msg = g_mesg_incl.
APPEND t_error.
CLEAR t_error.
ENDIF.
ENDIF.
* Clear for next run
CLEAR: t_bdcmsgcoll,
t_bdctab.
REFRESH: t_bdcmsgcoll[],
t_bdctab[]. -
Prb display error message while creating PR at ME51n in ME_PROCESS_REQ_CUST
Hi All,
I have this requirement to check the cost center availability in PR screen (ME51n).
If cost center in the Account assignment tab is not empty, display error message and not able to create the PR.
With my code below, it doesn't triggered the error message and PR created.
Could anyone help?
METHOD if_ex_me_process_req_cust~process_account.
DATA: w_account_ref TYPE exkn.
w_account_ref = im_account_ref->get_data( )
IF w_account_ref-kostl IS NOT INITIAL.
MESSAGE e303(ME) WITH text-001 w_account_ref-kostl text-002.
ENDIF.
ENDMETHOD.
Thank you.
SWHi,
You have to use definition MMPUR_MESSAGE 'E' ME 303 text-001 w_account_ref-kostl text-002.
This will throw the error during check and save instead of message e303(me) .
Hope it helps.
Sujay
Edited by: Sujay Venkateswaran Krishnakumar on Oct 5, 2010 2:54 PM -
A way to display error messages from the program
Dear all,
I am looking forward to display a set of error messages(in a internal table) during the execution of the program to the user.
I wanted to know the better way of displaying error messages from my program with more options.
Well I tried out using displaying errors as ALV list/Grid or as simple list processing.
But I found some stanadard transactions (Like in MM and FI where errors are shown in a better way, but failed to find out how they are done.
Please guide me.
Thanks in advance
AryanTry to use application logging it has a very good way to display a set of messages.
[http://abap4.tripod.com/Using_Application_Logging.html|http://abap4.tripod.com/Using_Application_Logging.html]
Run this report in se38 an example sap report to understand logging way to show a set of messages
Report Name : SBAL_DEMO_01
Edited by: Vighneswaran CE on Dec 19, 2010 3:01 PM
Edited by: Vighneswaran CE on Dec 19, 2010 3:11 PM -
Displaying error messages in table...
Hi All,
How can we display error messages in a table in a bsp page.
I am filling an internal table in OnInputProcessing on some event with all the error messages to be displayed.
Table sould have two columns
1)Graphic depending on error type.
2)Error message.
Thanks,
Anubhav.Hi Graham,
The solution is perfect!
One more thing...when the page is displayed with errors table , i need to set focus on the table.
My code is:
<htmlb:gridLayoutCell columnIndex="1" rowIndex="1" id="fourthmain">
<% if itab_message is not initial .%>
<table class=""urGridLayout" border="1" cellpadding="2" id="err_tab">
<%
loop at itab_message into wa_message.
%>
<tr>
<td class="urCoB2Whl">
<% case wa_message-typ.
when 'S'. %>
<htmlb:image src = "ICON_MESSAGE_INFORMATION" />
<% when 'error'. %>
<htmlb:image src = "ICON_MESSAGE_ERROR" tooltip="Error" />
<% when 'W'. %>
<htmlb:image src = "ICON_MESSAGE_WARNING" />
<% when 'I'. %>
<htmlb:image src = "ICON_MESSAGE_INFORMATION" />
<% when 'A'. %>
<htmlb:image src = "ICON_MESSAGE_CRITICAL" />
<% endcase. %>
</td>
<td><font size="2" face="Times">
<%= wa_message-msg%>
</font>
</td >
</tr>
<%
endloop.
%>
</table>
<% refresh itab_message. %>
<% endif. %>
</htmlb:gridLayoutCell>
I tried using
<phtmlb:focusRect focusElementId="err_tab"/>
and also:
<s cript="text/javascript">
daument.farm.elementid.focus();
</s cript>
But failed...pls help me out.
Thanks,
Anubhav. -
ERROR WHILE INSTALLING OIM 11G
Hi,
When i am installing the below error whille installing oim 11g on windows 7,
https://picasaweb.google.com/107742630291389085108/August42012#5772738295887214898
Could someone please help me.
Installations:
win32_11gR2_database
weblogic 10.3.5
ofm_iam_generic_11.1.1.5.0
ofm_soa_generic_11.1.1.6.0
Regards,
RaguCheck oracle certification matrix first. Your SOA is uncertified. What error you are getting in logs? Check log file shown in image.
regards,
GP -
Not able to display error message in PR creation.
HI Experts,
In PR creation process i am not able to display error message.
BADI: ME_PROCESS_REQ_CUST
method : PROCESS_ACCOUNT, PROCESS_ITEM
I have used Include mm_messages_mac for handling error .
MESSAGE e112(XXX) WITH XX-XX. this is my error message.
even tried this also mmpur_message 'W' 'ZMM_PUR' '001' '' '' '' ''.
Please provide solution for this.
Regards,
JayantHi,
In devepoment system im able to display the message but not in quality,code is 100% algined with quality.
In quality system error message is being executed but not displayed,i mean control is comming out after the error message.
i am using
message EXXX(XXX).
regards,
Jayant. -
How To Display Error Message In Self Service Page
Dear All,
I am using 11.5.10 Oracle HRMS self Service ,,,
How can I display error message on the top of the self service page if some action happen ?
Best RegardsTime entry rules maybe?
-
How to display error message in Billing Output Type (VF03).
Hi,
could anyone suggest how do i display error message via billing (VF03) output type?i want to display an error message from my sapscript program.
*determine discount
it_zmas-discount = it_zmas-gross_value - zkwert.
MODIFY it_zmas.
ELSE.
MESSAGE ID 'Z0' TYPE 'S' NUMBER '999' WITH 'Please maintain cust pricing grp 34 for ' wa_zmas-matnr.
p_proc_screen = 'X'.
ENDIF.
when user enter billing doc no in vf03, user will click 'issue output type' and select their output type to be printed out.
if there's an error in the print program, it should promt out an error message and do not allowed user to print preview and print the form out.
what i had did previously, i prompt the error message and disable the print preview button. i think its not a good solution and i am not sure how to stop the form from not printing it out.
i was wondering is there any user exit of the output type, vofm (which i had this solutions from my previous question, but unsure how to use it) or any other solutions.
please help. -
How to display error message in abap
How to dispaly error message in report?
i have to check the range bewteen two days and if it is not in range have to display error message only once.
next time if i press the execute button report will get executed without showing the warning message.
i am calculating the days between two dates, i am displaying the error message but if i press the execute button i will not allow me to execute the report.it again shows me the error message.i have to skip this in 2nd time.
can any one suggest what to do with this?hello suman,
i am using select-option in my report. And i have to check the difference between two dates in select option input box( low-value and high-value). if it is greater then suppose 10 then i have to display warning message at once and then if click on execute button , the report should get executed without showing any warning messages in report.
here i am attaching my source code.please take a close look and tell me where should i have to make change.
SELECT-OPTIONS :s_bedat FOR ekko-bedat.
AT SELECTION-SCREEN ON s_bedat.
IF NOT s_bedat IS INITIAL.
PERFORM bedat_validate. " Perform for Purchasing Document Date Validation
ENDIF.
FORM bedat_validate . " Form for Purchasing Document Date Validation
DATA : diffr TYPE i.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = s_bedat-high
i_datum_von = s_bedat-low
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
e_tage = diffr
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
IF diffr GT 31.
MESSAGE s009(zerrormsg) WITH text-000 DISPLAY LIKE 'W'.
LEAVE TO LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " BEDAT_VALIDATE -
How to display error message in case of function module ?
In the report i was using " message-id " to display error message....
how to use in function module ?Hi,
Messages in Function Modules and Methods
Messages have two different functions in function modules and methods:
Normal Messages
If you use messages in function modules and methods without the RAISING addition in the MESSAGE statement, and the caller does not catch the message, the message is handled
normally according to the context in which it is called within the function module or method.
Triggering Exceptions with Messages
If you use messages in function modules and methods with the addition
... RAISING <exc>
the way in which the message is handled depends on whether the calling program handles the exception <exc> or not.
If the calling program does not handle the exception, the message is displayed and handled according to the context in which it occurs in the function module or method from which it
was called.
If the calling program handles the exception, the message is not displayed. Instead, the procedure is interrupted in accordance with the message type, and processing returns to the calling program. The contents of the message are placed in the system fields SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 to SY-MSGV4.
Catching Message in the Calling Program
You can catch messages from function modules that are not sent using the RAISING addition in the MESSAGE statement by including the implicit exception ERROR_MESSAGE in the
EXCEPTIONS list of the CALL FUNCTION statement. The following conditions apply:
Type S, I, and W messages are ignored (but logged during background processing)
Type E and A messages trigger the exception ERROR_MESSAGE
Type X messages trigger the usual runtime error and short dump.
Catching messages is not currently supported for methods.
Regards,
Bhaskar -
How to display error message in Shopping Cart?
How to display error message in Shopping Cart and stop the shopping cart for further processing? I try MESSAGE w001(zshop) or MESSAGE e001(zshop). But it is causing run-time error.
Hi Paul,
In the DOC_CHECK or DOC_SAVE BADI, you have a global internal table named et_messages. The structure of this table is 'bbp_smessages_badi'. You can append your error message here by inputting the message type, ID and number. The message type is either 'E' for error or 'W' for warning and the number would depend on your message class(ID). You will be able to see the error message on top of the screen, can be a red or yellow highlight depending on your appended message. I don't think creating the error message via the MESSAGE syntax will be successful, maybe this is why you are getting a runtime error.
Regards,
Noel -
Display error message in userexit
I have a checking which implement in userexit. When the criteria meet, it will block po saving and display error message. I would like to know how to display the error message. Thanks!
Use like this for first approach else if second one were serve you purpose than you may go with second one also.
DATA: mid TYPE sy-msgid VALUE 'SABAPDOCU',
mtype TYPE sy-msgty VALUE 'I',
num TYPE sy-msgno VALUE '014'.
MESSAGE ID mid TYPE mtype NUMBER num.
Maybe you are looking for
-
As the title says, how do I get the two devices to cammunicate with each other?
-
What is the auxiliary constructs in sql
I need some help to know what's the auxiliary constructs, and examples in the auxiliary constructs
-
How can we let logic in the implemetation process not to squeeze together?
Hi xilinx expert: There are three clk domain in my project . green, yellow and red clk domain. i don't understand why they are all place in the lower part of the device. All logic is squeeze together in the lower part, and the upper part i
-
Delete Authenticator Provider with WLST
Hi, I need to change an authentication provider for a newer one with a WLST script. Both providers have the same name. I found the createAuthenticationProvider method to add the new provider, but I find no way to delete the previous provider before a
-
Configuring speed and duplex settings of monitoring NIC under IDS v4.1
Good day, While I know that, unlike IPS v5.0 where you can configure interface-specific settings via IDM, you cannot adjust interface settings using IDM in v4.1. I was wondering if it was possible to set these things, however, via the service account