Custom error message in SAP application log
Is there a way to add a custom error message to the SAP application log without passing the message variables MSGV1, MSGV2, MSGV3, MSGV4 and the Message class and number.
We want to pass a custom message from the BAPIRET2-MESSAGE without giving it a Message class and number. The reason for this is that we are using class based exceptions instead of the traditional message class with errors. When we catch the class based exception, we take the error text of the exception and put in in the BAPIRET2-message and set the BAPIRET2-TYPE as 'E'. Now we want to add this to the SAP application log.
The call to 'BAL_LOG_MSG_ADD' takes a structure BAL_S_MSG which is just like BAPIRET2. However this function builds the entry to the application log use the message variables MSGV1, MSGV2, MSGV3, MSGV4. There is no provision to pass in the BAPIRET2 message.
Add message to application log
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = app_log_handle
i_s_msg = log_message
Thanks,
Jay
Hi Jay,
Did you see <b>BAL_LOG_EXCEPTION_ADD</b>?
This FM is represented by the structure <b>BAL_S_EXC</b>. This can have various versions as described below:
<b>Data of BAL_S_EXC Structure / Use</b>
<b>EXCEPTION</b> / Exception class from which an exception text
is added to the log. This field must be filled.
<b>MSGTY</b> / Message type (MSGTY) of a T100 message.
This field must also be filled for exceptions.
<b>PROBCLASS,
DETLEVEL,
ALSORT, TIME_STMP</b> / Message or exception attributes, such as
problem class (PROBCLASS, for
example, "very important"), level of detail
(DETLEVEL, from 1 to 9), sort criterion
(ALSORT, unrestricted) and timestamp
(TIME_STMP). These fields can be displayed
in the log (except TIME_STMP).
<b>MSG_COUNT</b> / This attribute is not used for exceptions.
Follow the link below for more details:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/frameset.htm">SAP Help DOc</a>
Hope this helps.
Thanks
Sanjeev
Similar Messages
-
How to add custom error message in standard application log of change doc.
Hi,
While saving chnage document I need to add raise an error on specific condition. As Error messages is being shown in application log I added custom message in include LCRM_1O_UIF15 by using BAL_LOG_MSG_ADD FM however it is not showing in the screen. What could be the reason? Can anybody please explain?
Rgds
SudhanshuMuhammed,
Have you tried throwing a JboException in your AM code?
John -
ICI - How to display custom error messages in SAP CRM
Hello,
we are working on a custom Contact Center which interfaces with SAP CRM Version 7 with Enhancement Package over ICI.
The basic call functions like accepting, hanging up, holding and retrieving are fully implemented and are working already.
Our goal is to display error messages in the CRM so that clients know there is something wrong, for example why he can't be log in successfully (e.g. the telephony server isn't reachable).
We already found the ICI Documentation file which provides us the CRM SOAP error codes and tried to send SOAP Fault messages, but never got
them to screen.
Please find an attached example screenshot what we mean exactly, reproduced by trying to make a call with CRM user while BCM CDT isn't
running in the background.
Regarding to this topic we've the following questions:
- Is it possible to display custom error messages on the CRM or is this functionality limited to SAP?
- Could you provide us some further information on how to use this feature exactly (implementation details?) and how the SOAP XML should look like to get it work?
Thank you in advance!
Best regards
René HolyNewUser7 wrote:
Please correct me if I am wrong
I need to create an entity adapter and attach an error handler with the adapter? or can i handle that in the event handler itself. I coulnt find any api for handling errorsYou can do it both ways but since we are talking about event handler now, then in 9.x you need to extend com.thortech.xl.client.events.tcBaseEvent class for creating a event handler. In tcBaseEvent class there are various flavors of handleError method. So use that as per my note earlier and you should be good.
HTH -
Error Message in portal application.log
Hi all,
There are error messages continually been written to application.log.
Here is the path.
$ORACLE_HOME/j2ee/OC4J_Portal/application-deployments/portal/OC4J_Portal_default_island_1/application.log
We couldn't find out what's wrong.
Portal Version is 10.1.2.2.0.
application.log
07/01/31 16:54:54 portal: [module=RepositoryServlet, ecid=103102642203,1] ERROR: Repository Gateway error: Request Processing Error:
maxlength.htc: PROCEDURE DOESN'T EXIST
07/01/31 17:23:44 portal: [module=RepositoryServlet, ecid=133169185626,1] ERROR: Repository Gateway error: Request Processing Error:
maxlength.htc: PROCEDURE DOESN'T EXIST
07/01/31 17:23:58 portal: Broken pipe
07/01/31 17:23:58 portal: Broken pipe
07/01/31 17:23:58 portal: id=146054097151,1 Exception processing portlet response
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.evermind.server.http.EvermindServletOutputStream.write(EvermindServletOutputStream.java:216)
at com.evermind.server.http.EvermindServletOutputStream.write(EvermindServletOutputStream.java:151)
at oracle.webdb.repository.service.RepositoryHttpResponseWrapper$RepositoryOutputStreamWrapper.write(Unknown Source)
at oracle.webdb.page.CharConvertingOutputStream.write(Unknown Source)
at oracle.webdb.page.v2.BaseDataProcessor.addToOutputStream(Unknown Source)
at oracle.webdb.page.v2.BaseDataProcessor.includePortlet(Unknown Source)
at oracle.webdb.page.v2.BaseDataProcessor.parseLayout(Unknown Source)
at oracle.webdb.page.v2.BaseDataProcessor.assemblePage(Unknown Source)
at oracle.webdb.page.v2.BaseDataProcessor.process(Unknown Source)
at oracle.webdb.page.PageBuilder.process(Unknown Source)
at oracle.webdb.page.Main.doRequest(Unknown Source)
at oracle.webdb.page.ParallelServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:834)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:260)
at oracle.webdb.portal.servlet.PortalServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:834)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:228)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
----------------------$ORACLE_HOME/j2ee/OC4J_Portal/application-deployments/portal/OC4J_Portal_default_island_1/application.log
os the log of the "parent application". This is rather high level in the container. The message in the logfiles tells you that a procedure doesn't exist.
This can mean 3 things:
1. The procedure really doesn't exist
2. The procedure expects different parameters then passed
3. In the procedure a specific array member is called (but not found). (don't know how to explain this better in English, sorry for that).
It has been a while since I touched portal. In the past portal used a DAD (located in your HTTP-Server configuration). By changing the error style of the dad, you might find a more comprohensive error message. -
Web composer option not displaying while Customizing Error Messages of Portal applications
Hi
I am trying to customize the error messages through web composer in sap portal but when i Choose System Administration → System Configuration → Knowledge Management → Content Management Web composer option is not shown . I am using netwearver 7.0
please guide me I searched google but couln't find any satisfactory answer.
ThanksHi Raima,
From your description I assume you are attempting to implement the steps outlined in the following documentation, is this correct -
Modifying Error Pages - Carrying Out the Initial Configuration - SAP Library
If you are navigating to the KM configuration through the steps you outlined and you do not see WPC Composer listed under 'Content Management' I would suspect that it is not deployed on your system (at least not successfully). It is not included as part of the default stack in EP 7.0 and must be deployed separately. If you do intent to deploy this component, you should also note that the SP level of the KMC-WPC SCA should match the SP level of the other KM and EP components. -
Cannot display custom error message in CRM_MKTLIST_BADI
We did implement the following BADI BADI Name: CRM_MKTLIST_BADI
Interface: IF_EX_CRM_MKTLIST_BADI Method: MAP_AND_CONVERT_DATA
This enhancement is for suport the extension field for create new BP in
external list management (transaction CRMD_MKTLIST). The BP creation
process work properly but we cannot display our custom error message,
only SAP standard error message is shown. We did try using the export
parameter ET_MKTLIST_E but it does not work as expected, custom message
still cannot display.
How we can be show the custome error message ?
Thanks in advance.
Supreeya K.Hello Supreeya,
have you tried to post this question in the SAP CRM: Webclient UI - Framework forum?
Regards
Gregor -
The custom error message in the bank application is displaying in English
Hello Team,
The custom error message for a blank institution number in the bank application is displaying in English when the user is logged in French. See attached screen shot.
ESS --> Personal Information --> Bank Information.
Could any one let me know the procedure in solving the error. Helpful answer is highly appreciated.
Thanks,
SankarHi,
sandip is correct, go to SE11 Table T100.
I did it this way: Searched for (in my case) SPRSL = DE and TEXT = "Bitte Bankschlüssel eingeben" (that's the said error message). With the upcoming result I got the message ID and message Number, these are:
ARBGB = 'AR' MSGNR = '195'
ARBGR = '1J' MSGNR ='510'
Maintain them for your SPRSL and you should be fine.
regards, Lukas -
Print a custom Error message in the XML bursting program's log file...
Hi,
I having this requirement, where i need to print a custom error message in the xml bursting program's log file.
Actually i am having a report where i create invoices and then those invoices are emailed to the respective customers, now say if a customer has three contacts and there is only two valid email id's so what happens is bursting will be successful for two contacts whereas the third contact dosen't get any emails. when this happens i need to log a message in the bursting programs log file stating a custom message.
Two things i want to know..
1- Whether is it possible to write into the xml bursting programs log file
2- If yes, then how..
note: it ll be greatly appreciated if the answer is elaborated.
thanks,
RagulHi,
I having this requirement, where i need to print a custom error message in the xml bursting program's log file.
Actually i am having a report where i create invoices and then those invoices are emailed to the respective customers, now say if a customer has three contacts and there is only two valid email id's so what happens is bursting will be successful for two contacts whereas the third contact dosen't get any emails. when this happens i need to log a message in the bursting programs log file stating a custom message.
Two things i want to know..
1- Whether is it possible to write into the xml bursting programs log file
2- If yes, then how..
note: it ll be greatly appreciated if the answer is elaborated.
thanks,
Ragul -
Can we show custom error message if the user fail to log in MII system.
Hi,
Is it possible to show a custom error message when a log in is failed because of access restrictions?
I am using xMII version 11.5
Thanks
Regards,
Neha MaheshwariSince you are on 11.5, it is possible to make edits to some of the system jsp pages, etc. but it would NOT be my recommendation to do so. Since the NetWeaver versions for MII 12.0 and beyond use UME for the login instead of the LHSecurity engine, this would be a very short term change.
What specific changes would you like to make, the login page messages, query result messages, applet messages? -
Custom Error message in portal
HI Experts,
I trying to implement cutom error messages in portal. By Following the below link.
[https://cw.sdn.sap.com/cw/community/docupedia/nw70java/blog/2010/03/21/custom-error-messages-in-the-portal]
As of now I trying to implement it for error code "500".
<error-page>
<error-code>500</error-code>
<location>/Customerrors/500.html</location>
</error-page>
</web-app>
The above code I pasted in web.xml. 500.html is there in customerrors folder. I have also restrated the system.
when I log in to portal system still I could see standard message coming for "500" code error not the custom one from 500.html.
Iam using EP7.0 EHP1 .
Thanks
Surender Singh DahiyaSurender,
I guess it should work in the similar fashion.However, I do not have access to a portal system now. Will try testing the scenario soon and keep you posted.
Cheers!
Sandeep Tudumu -
Hi,
I have designed a Custom screen for one of my requirements. However when the screen is displayed, I am facing an error message from SAP Front End Server that says " Erroneous data received from server. Application may not work correctly".
What could be the reason ?
Thanks & Regards,
Venkatesh.Hi,
Please check the belos SAP notes
1453114 Maximum string length
1161022 Dialog box "Erroneous data received from server"
1524462 - Erroneous Data received from server. Application may not work correctly.
Regards,
Naveen. -
Customized error message for MethodValidator
Hi,
I coded a validation method and attached it to an entity attribute through the MethodValidator of the Entity Object validation tab.
When I test it in the application module tester, it works fine. Just the error message produce by BC4J is too generic, like "JBO-27013: Attribute set validation method validateIsSoldTo failed for attribute IsSoldTo in Customer".
Is there anyway that I can provide a more meaningful customized error message?
I am using JDev 3.2.2 for a JSP application using Data Tag.
Thanks!
Dawsonshort of coding the dml procs yourself and trapping those error messages that way, i don't think we offer you a good way currently to trap and translate error messages coming out of our automatic DML processes. i've just logged the enhancement request to facilitate this, but for now i'm pretty sure you'd have to code that dml and trap your errs yourself.
regards,
raj -
LSO_CHECK_BOOKING custom error messages are not displayed
Hi,
Good day! I am currently experiencing some problems displaying custom error messages from BADI LSO_CHECK_BOOKING. I have implemented this Badi and is appending error messages in CT_MESSAGE_TAB however when the message is displayed in portal, the custom message is not displayed. Instead, SAP displays a predefined error "Error When Creating Prebooking with the data entered..."
Is there a way for me to display my custom error message instead of the predefined SAP message?
Thanks a lot.
Cheers,
JamesHi James,
You have not mentioned, which portal you are using. Please see below, that there are differences in the learning and the admin portal:
Learning Portal:
The framework of the existing design of the Learning Portal does not
allow customer specific error messages to be displayed in the portal.
Only a generic message will be displayed when prebooking in the learning
portal if the BADI LSO_CHECK_BOOKING returns an error. The design of the
application does not expect to raise an exception from the BADI. If the
BADI processing is assumed to be unsuccessful, the messages filled by
the BADI will be ignored and a general error message will be displayed
in the portal.
So this is basically a design limitation.
Administrator Portal:
Have you tried e.g. the following notes?
SAP Note 1806593 Admin Portal: Message is not displayed while prebooking
SAP Note 1575238 LSO: BADI LSO_CHECK_BOOKING does not show warning messages
Regards,
Agnes -
How can we define custom error page in protal application
How can we define custom error page in protal application, like we define "jsp Error page " in JSPs
Hi,
Check these:
Customization of Portal Runtime Errors and portal standard error codes
http://help.sap.com/saphelp_nw04/helpdata/en/9a/e74d426332bd30e10000000a155106/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/ec/1273b2c413b2449e554eb7b910bce7/frameset.htm
Regards,
Praveen Gudapati -
How to show custom error message in WebADI Excel template?
Hi,
I've created a custom Web ADI integrator and associated it with a 'Procedure' based custom interface.
WebADI Interface API Returns is set to "Error Message".
I'm using raise_application_error(-20001, "Actual Error Message") for invalid rows,but custom error message from PL/SQL is not populated on the excel template.
Instead it is showing "SQL exception occurred during PL/SQL upload".
Am I missing anything? How to show custom error message from Pl/SQL procedure to WebADI Excel template?
TIA
NarasimhaThe custom API errors are visible in the BNE log but not on the Excel.
BNE Log=>
12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR BnePLSQLUpload.doUpload: Exception while uploading to PL/SQL API. Error Code: 20001, Message: ORA-20001: -Please enter CONTAINER_ID - Enter PO_NO -
ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
ORA-06512: at line 1
12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR BnePLSQLUpload.doUpload: Stack trace: java.sql.SQLException: ORA-20001: -Please enter CONTAINER_ID - Enter PO_NO -
ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
ORA-06512: at line 1
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3550)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4710)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at oracle.apps.bne.integrator.upload.BnePLSQLUpload.doUpload(BnePLSQLUpload.java:284)
at oracle.apps.bne.integrator.upload.BneSAXUploader.processDeepestLevel(BneSAXUploader.java:2346)
at oracle.apps.bne.integrator.upload.BneSAXUploader.startElement(BneSAXUploader.java:1182)
at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:181)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:234)
at oracle.apps.bne.integrator.upload.BneUploader.processUpload(BneUploader.java:301)
at oracle.apps.bne.integrator.upload.BneAbstractUploader.processUpload(BneAbstractUploader.java:114)
at oracle.apps.bne.integrator.upload.async.BneAsyncUploadThread.run(BneAsyncUploadThread.java:140)
12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 WARNING BneOracleWebAppsContext.getTimeZone CLIENT_TIMEZONE_ID has not been set
12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 ERROR BneOracleWebAppsContext.getExtraJDBCConnection recieved the same connection as the base connection. There may be transaction problems.
How to show the same error in the excel template?
Here is the package:
CREATE OR REPLACE PACKAGE BODY APPS.XXPO_COSTFACTS_WEBADI_PKG
AS
PROCEDURE upload_data (
P_CONTAINER_ID IN VARCHAR2
, P_SAIL_DATE IN DATE
, P_PO_NO IN VARCHAR2
) IS
--declare
lv_err_msg VARCHAR2(240);
lf_err_flag NUMBER := 0;
ln_temp NUMBER;
BEGIN
--------------------- checking for mandatory parameters---------------------------
IF (P_CONTAINER_ID IS NULL) THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg||'-'||'Please enter CONTAINER_ID - ';
END IF;
-------------Validation for Sail Date Format----------------------
IF (P_SAIL_DATE IS NULL) THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' ' || 'Enter Sail Date - ';
ELSE
BEGIN
SELECT 1
INTO ln_temp
FROM DUAL
WHERE P_SAIL_DATE = TO_DATE (TO_CHAR (P_SAIL_DATE, 'DD-MON-YYYY'), 'DD-MM-YYYY');
EXCEPTION
WHEN NO_DATA_FOUND THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format';
WHEN OTHERS THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format'|| SQLERRM;
END;
END IF;
-------------Validation for PO_Number----------------------
IF (P_PO_NO IS NULL) THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' ' || 'Enter PO_NO - ';
ELSE
BEGIN
SELECT count(1)
INTO ln_temp
FROM PO_HEADERS
WHERE Attribute4 = P_PO_NO;
EXCEPTION
WHEN NO_DATA_FOUND THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' No Oracle PO for Biceps PO#'||P_PO_NO;
WHEN OTHERS THEN
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' Error getting the Oracle PO for Bicpes PO#'||P_PO_NO||' Error-' || SQLERRM;
END;
END IF;
-----------------------Insert Record----------------------------
IF lv_err_msg is NULL THEN
BEGIN
INSERT
INTO XXP2P_HW_COST_FACTORS_STG
CONTAINER_ID
,SAIL_DATE
,PO_NO
, ERROR_FLAG
, ERROR_MSG
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
VALUES
P_CONTAINER_ID
,P_SAIL_DATE
,P_PO_NO
,lf_err_flag
,lv_err_msg
,FND_GLOBAL.USER_ID
, trunc (sysdate)
,FND_GLOBAL.USER_ID
, trunc (sysdate)
,FND_GLOBAL.LOGIN_ID
-- commit;
DBMS_OUTPUT.put_line
'-' || 'After ap_invoices_interface'
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
lf_err_flag := 1;
lv_err_msg := lv_err_msg || ' ' || 'error loading CONTAINER_ID-' || P_CONTAINER_ID || SQLERRM;
raise_application_error(-20001, lv_err_msg);
END;
ELSE
raise_application_error(-20001, lv_err_msg);
END IF;
END upload_data;
END XXPO_COSTFACTS_WEBADI_PKG;
Maybe you are looking for
-
Issue with calculation script - please help
There is a script that I am working on that needs to track the changes made by the user on the data form and push the entered value down proportionally to the lower levels. It's a signal dimensional spread. It needs to spread the parent level values
-
Datasource transport in BI 7.0 in SCM 5.0 fails
System Specification - SCM 5.0 with BI 7.0 SP10. Is there a way to transport a new datasource created from a planning area from Dev -> QA. Right now I have tried many times to transport datasources and all of them have failed. In the past we had to e
-
Missing table SDO_Geom_Metadata
Thankyou all for answering my previous question. I would appreciate some input on this one too. I have installed Spatial as suggested by the installation guide for Sun Sparc station. But I do not see the SDO_GEOM_METADATA table. But I do see the othe
-
The best quotation of forwording sgent will pick in Sales order.
How is it possible in SAP,the best quotation of forwording agent will pick automatically in sales Order. Suppose there is 10 Forwording agent,the best quotation should reflect in SAP, the best quotation will select through SAP system.
-
hi friends, i want the programming code to use address,protect endprotect,new-page and all commands in SCRIPTS. i dont want any theory.i want only the programming code.i hope that u all will help me.