Writing Application Log of SAP PI
Hi All,
I have a requirement to update the Application Log of SAP PI 7.1 with Ehp1 whenever mapping for a particular pair of Sender and Receiver is executed.
SenderA (JMS) -> SAP PI (update Application Log; SLG1) -> ReceiverA (JMS).
I have already seen this blog: /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility but it seems to be written long back.
How should this be done in PI?
Thanks
Pankaj
You can do this with an RFC lookup in message mapping, or with a BPM by calling an abap proxy that post a log in SLG1.
Similar Messages
-
How to create application log in SAP
According to my reqirement,I need to display messages in the application log whenever some updation is done.
How to do create application log and display messages in the application log.Hello Smriti
If you have interface IF_RECA_MESSAGE_LIST available on your system then I highly recommend to use as message collector.
When you create an instance of the interface (CF_RECA_MESSAGE_LIST=>CREATE) you can provide an application log object.
The collected messages can easily be saved as log.
For an example have a look at my Wiki posting [Message Handling - Finding the Needle in the Haystack|https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack]
Regards
Uwe -
The following log <b>Backend integrated documents are not supported</b> is found while trying to give <b>complete document for free pack</b> in exception handling (AUTO-ID COCKPIT).
Can anyone say what could be the reason for the specified log?Hi Hari,
System logs activities in SAP GTS system for various objects, including document blocks in SAP Compliance Management for the customs documents that are replicates of logistics documents from the feeder system and similar such data is also recorded by the system for references at a latter stage for other areas as well. These are known as application logs. For a quick reference, you can use Tcode SLG1 and look at the various things it has. I hope this is what you asked for. For more information, please feel free to ask and of course keep posting.
Regards,
Aman -
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,
JayHi 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 -
Hi All,
The requirment is to create a Standard SAP Application Log using a Function module 'BAL_LOG_CREATE' and each successfull work order update should create a message in the log using FM 'BAL_LOG_MSG_ADD'. Each failed work order update should result in a exception being added to the log using BAL_LOG_EXCEPTIOn_ADD'.
please guide me on how these FM's should be used for creating the Standard SAP Application log.
Thanks in Advance.hi tina,
please give specific SAPGUI you're using. Is it SAPGUI for Windows or SAPGUI for Java ?
If you're using SAPGUI for Java on Linux, you can refer here (http://sapbasis.wordpress.com/2007/08/22/installation-and-configuration-of-sapgui-for-java-on-linux/)
ardhian
http://ardhian.kioslinux.com
http://sapbasis.wordpress.com -
Urgent help needed on writing errors in to windows events application logs
Hi all,
we have web based application. Whenever there is critical errors encounters in our application we need to write that errors in to windows
event viewer, application logs. Please help me on how to do this.
do we have any specific API for this ?
thanks in advance
ShivakumarYou should use WinAPI to do so. Asking in JNI forum (or specialized WinAPI forum) for more details is good idea I think.
-
Urgent help needed on writing errors in to windows application logs
Hi all,
we have web based application. Whenever there is critical errors encounters in our application we need to write that errors in to windows
event viewer, application logs. Please help me on how to do this.
do we have any specific API for this ?
thanks in advance
ShivakumarYou should use WinAPI and followed functions: RegisterEventSource(), ReportEvent() and may be some more. It was some time ago as I deal with...
-
SAP TABLE TO VIEW THE APPLICATION LOGS OF IDOCS
Hi,
Can you please suggest where I can see the table to view the application logs in idocs. We can see this individually in SLG1 or MM90. But I need to see it collectively to see all the error messages. Please suggest.Hi
You can check tables:
EDIDC- for control records
EDID4-for Data Records
EDIDS-for Status records
You can also use T Code WE02 or WE05
Thanks & Regards
Sanil Bhandari -
XI 7.0 NW 2004s install - JMS Errors in applications.log & defaultTrace
We just installed XI 7.0 NW 2004s. The installation of XI 7.0 NW 2004s is a lot simpler than XI 3.0 NW 2004 since the Template installer runs most of the post installation steps.
However, there are a few issues that I am encountering that i did not see with XI 3.0 installations. The installation is on Windows 2003 server and SQL server 2005.
Checking the applications.log file through Visual Administrator LogViewer, I see that the Applications log is filing up every few seconds with the following repeating errors:
Message -
Exception on server occured! Internal error.
Additional Information -
Category : /Applications/JMS
Message ID : 001422B146E800750000070D0000013000041A845FCB659B
Source Name : /Applications/JMS
Thread : SAPEngine_Application_Thread[impl:3]_26
Application :
Argument Objs :
Arguments :
Dsr Component :
Dsr Transaction : d16ec30026fd11dbb450001422b146e8
Dsr User :
Indent : 0
Level : 0
Message Code :
Message Type : 0
Relatives : com.sap.jms.client.session.Session
Resource Bundlename :
Session : 0
Source : /Applications/JMS
ThreadObject : SAPEngine_Application_Thread[impl:3]_26
Transaction :
User : J2EE_GUEST
Message -
Exception on server occured! Cannot write to transaction log TXf48.tx.
Additional Information -
Category : /Applications/JMS
Message ID : 001422B146E800750000070A0000013000041A845FCB4CC8
Source Name : /Applications/JMS
Thread : SAPEngine_Application_Thread[impl:3]_26
Application :
Argument Objs :
Arguments :
Dsr Component :
Dsr Transaction : d16ec30026fd11dbb450001422b146e8
Dsr User :
Indent : 0
Level : 0
Message Code :
Message Type : 0
Relatives : com.sap.jms.client.session.Session
Resource Bundlename :
Session : 0
Source : /Applications/JMS
ThreadObject : SAPEngine_Application_Thread[impl:3]_26
Transaction :
User : J2EE_GUEST
In the defaultTrace.trc file, i see the JMS error too:
Message -
Error From List = javax.jms.JMSException: Internal error.
at com.sap.jms.protocol.notification.ServerExceptionResponse.getException(ServerExceptionResponse.java:271)
at com.sap.jms.client.session.Session.checkReceivedPacket(Session.java:1808)
at com.sap.jms.client.session.Session.rollback(Session.java:300)
at com.sap.jms.client.session.Session.close(Session.java:158)
at com.sap.jms.client.xa.SessionAdapter.close(SessionAdapter.java:52)
at com.sap.engine.services.jmsconnector.spi.ManagedSession.sessionClosed(ManagedSession.java:279)
at com.sap.engine.services.jmsconnector.cci.SessionImpl.close(SessionImpl.java:119)
at com.sap.aii.af.protocol.ispeak.services.timer.impl.ISPEventSession.close(ISPEventSession.java:262)
at com.sap.aii.af.protocol.ispeak.services.timer.impl.ISPTimerEvent.timeout(ISPTimerEvent.java:361)
at com.sap.engine.services.timeout.TimeoutNode.run(TimeoutNode.java:56)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
Additional Information -
Category : /Version
Message ID : 001422B146E8008B000007340000013000041A847A0F6CB9
Source Name : com.sap.aii.af.protocol.ispeak.services.timer.impl.ISPEventSession
Thread : SAPEngine_Application_Thread[impl:3]_98
Application :
Argument Objs :
Arguments :
Dsr Component :
Dsr Transaction : d815880126fe11db9edc001422b146e8
Dsr User :
Indent : 0
Level : 0
Message Code :
Message Type : 0
Relatives : /Version
Resource Bundlename :
Session : 0
Source : com.sap.aii.af.protocol.ispeak.services.timer.impl.ISPEventSession
ThreadObject : SAPEngine_Application_Thread[impl:3]_98
Transaction :
User : J2EE_GUEST
This is filing up both the applications.log and defaultTrace files. I cannot find any information through Service Marketplace. Has anyone encountered this issue? This is new installation - no messages are running on it so I am not sure why there is a JMS error.
Regards,
JayHi Jay,
The exception means that the JMS Provider is not able to write to the transaction log file upon close of a transacted session. In NW04s, JMS transactions are stored as files on the local file system. The location of the root folder where the transactions are persisted is configured by the JMS service property "transactionStorePath". You can check its value through the Visual Administrator -> Services-> JMS Provider -> Properties. Please check if it contains a correct directory path and that nothing prevents the server from writing to this path - access rights, enough disk space, etc. If there is something wrong with the path, you can change it, save the change and restart the JMS provider service for the change to become effective.
You can also have a closer look at the server trace file: the root cause of the above exception is some other exception, probably I/O one, and it should be logged somewhere in adjacency to the JMS exception.
There is ongoing JMS communication even in a new server installation - in this case (judging from the stack trace) the component that performs this JMS activity is the timeout service.
Hope this helps,
Stoyan -
RFC function to retrieve application log
Hi,
does anybody know a standard SAP RFC function module to read an application log? So far I haven't been able to find one...
Please note that I'm not looking for any custom RFC wrappers around standard SAP functions or any solutions to read the data directly from the database tables.
Thanks for your help, haraldHi Sidarth and Elini,
thanks for the answers. Sidarth my goal is to find a standard SAP function module. Writing a wrapper is trivial, but is not helpful as a general solution (e.g. when working on multiple systems including some, where you don't have development access).
Elini, I looked at the function module C1CA_READ_APPLICATION_LOG, but it's not what I'm looking for (should've been more specific): It doesn't exist in SAP4.6c (support package level 48) and it's only a wrapper to present a dialog. I need an RFC function module to return an application log, dialog processing is not desired.
Thanks for the feedback. Does anybody have any other suggestions?
Best wishes, harald -
Write error log to Application log
Hi All ,
I am new to APO area . I am writing a report in APO and the requirement here is to write the error log to the application log . Can anyone help explain the process o hot to write the error log to application log . If possible please help me with some code .
Thanks ,
Daniel.Hi Daniel,
Refer the below code for writing the application log.
.<a href="/people/kamalkumar.ramakrishnan/blog/2007/01/10/a-primer-on-using-and-creating-sap-application-log on Application Log</a>
Regards,
Siva.
Create a Application log
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = g_bal_log
IMPORTING
e_log_handle = g_log_handle
EXCEPTIONS
log_header_inconsistent = 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.
ENDIF.
ENDIF.
loop at g_return.
g_log_mess-msgty = g_return-type.
g_log_mess-msgid = g_return-id.
g_log_mess-msgno = g_return-number.
g_log_mess-msgv1 = g_return-message.
g_log_mess-msgv2 = g_return-message_v1.
g_log_mess-msgv3 = g_return-message_v2.
g_log_mess-msgv4 = g_return-message_v3.
g_log_mess-probclass = 'Error Class'.
appemd g_log_mess.
endloop.
add this message to log file
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_s_msg = g_log_mess
EXCEPTIONS
log_not_found = 0
OTHERS = 1 -
Who uses Application Logs?
Hey there, I just wanted to understand more about the usage of application logs. Do any of you use it for debugging/analysis purposes of your applications? For those that use it, would you mind explain how you use it etc.
Sorry, I'm pretty much an ABAP newbie.I used Application Logs to get errors or other messages for RFC Calls etc in most of my Custom BAPIs.
See this\
http://help.sap.com/saphelp_nw04/helpdata/en/3a/c8263712c79958e10000009b38f936/content.htm
It doesnt help you much but definetly gives you some idea.
There are a bunch of function modules to help in getting Application Logs. Theoritically an Application Log is similar to System Log. But System Log is for the whole SAP system where are an Application log is specific to the Custom Object (and sometimes even sub-object) that you create and assign to.
Pros: If improves performance by reducing number of database hits and writing the logs locally.
Cons: A lot of effort is needed for initial setup.
If this helps, award points suitably. -
Exporting and Importing Data of Application Log
Hello,
We do migrate an application from SAP System A to SAP System B.
Despite the application logic, we do need to migrate some data, too.
For this we do write an export report in System A that writes the data of some tables to files on the app server..
Another report in system B takes the files and fills the respecting tables.
So far so good:
One table (which reports certain actions) contains the handle to the application log, which was created for this action.
I do want to extract this application log and later import this log in the other system, but do not know how this can be done in the best way.
Do you have any suggestion ?
Best regards
MichaelIn my experience, it's an unrealistic expectation.
SAP doesn't provide a straight path to migrate logs the way you plan to do. It's kept in a combination of tables and index files on the system. So even if you were to successfully extract it, when you load the data into system B you will lose the date and time stamp. When you create a log entry, it picks up system date and time. That's what an auditor would look for.
An alternate solution would be to read the application log and store it in a new custom table in system B.
Any reporting should be done off that as of a specific date. -
To add message in Application Log in Me2xn
Hello Experts,
This is my requirement.
During creation of PO item it is required to put a check if the Vendor is one among the Vendors in the table: ZTABLE.
If yes, it means that the PO is an internal order. Then you should check if the flag: GR Non-valuated is set for the newly added items.
If not, send out an error into the application log when the document is saved, so that the user is notified and it has to be checked to make the document complete for further processing.
I have implemented is check in the exit <b>EXIT_SAPMM06E_012</b>. But I don't know how to update the application log.
Could you please send some sample code to update the application log saying that <b>the PO is inetrnal Order</b>
Thanks in Advance.
Regards,
VasanthHi Vasanth,
in this case u have to USE BADI only ,
path-.Se18->f4--.SAP Application and check under ME package.
Regards
Prabhu -
Issue regarding application log in standard program RPCLMSU0
System Status: SAP ECC6, SP15.
This probem has been observed after we have upgraded from 4.6C.
In the include RPCLMSUF of the Report RPCLMSU0, there is an FM BAL_LOG_MSG_ADD, which adds messages to an application log.
A structure is passed to the FM, of type bal_s_msg.
The first 3 components of the structure are of type:
sy-msgt, sy-msgid and sy-msgno.
These should normally be filled in by values from the FM called just above it: BAL_LOG_CREATE.
But this doesnu2019t happen.
So, SAP has hardcoded values for these 3 as u2018Eu2019 (Message type), HRPAYNA_ALV (Message ID) and u2018998u2019 (Message no).
These are the values that get printed when the program is tested. i.e. the hardcoded text is getting displayed.
Output in the ALV : HRPAYNA_ALV:998 ***********No records found***********
We have checked the documentation for the FMs, and even gone through a few sample programs that SAP has created like SBAL_DEMO_02. The output is perfect here.
Since this is code that SAP has added (Entire form added "SL0K008292) by SAP to its standard code, they must believe that these hardcoded text will still not get printed. Can this error can be corrected by making some configuration changes in the system (SLG1?).
The code of the suroutine where this FM is called is given below:
FORM alv_appl_msg_add USING iv_text1 TYPE any
iv_text2 TYPE any
iv_text3 TYPE any
iv_text4 TYPE any.
Constants delcation.....
CONSTANTS: lc_msgid TYPE sy-msgid VALUE 'HRPAYNA_ALV', " Message ID
lc_msgty TYPE sy-msgty VALUE 'E'. " Message Type
Data declarations.....
DATA ls_msglog TYPE bal_s_msg. " Structure for msg log
ls_msglog-msgty = lc_msgty.
ls_msglog-msgid = lc_msgid.
ls_msglog-msgno = gv_msgno.
ls_msglog-msgv1 = iv_text1.
ls_msglog-msgv2 = iv_text2.
ls_msglog-msgv3 = iv_text3.
ls_msglog-msgv4 = iv_text4.
Function module is used to add the messages to message log
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_s_msg = ls_msglog
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF sy-subrc <> 0
ENDFORM. " alv_appl_msg_addHi
Pass IDoc Number, Date, Time from EDIDC table to FM-
'APPL_LOG_READ_DB'.
You'll get all log details of that IDoc.
For only Message, check FM - 'IDOC_GET_MESSAGE_ATTRIBUTE'.
Regards.
Maybe you are looking for
-
I have a MacPro5,1, Quad-Core Intel Xeon, 2 processors running at 2.4 GHz. I am running OSX 10.6.8. I installed Yosemite on another drive. When I choose Restart in Yosemite it shows my 10.6.8 hard drive. But when I click Restart in 10.6.8 it does NOT
-
JBO-33035: Row currency has changed
Hi, I have a Dept table which has 10 rows. Lets say 2 users are viewing the Dept List and tries to modify the same record at the same time. Then one of the user gets the following error "JBO-29000: Unexpected exception caught: oracle.jbo.JboException
-
How to use payload from standard RFC MessageType in a RFC Lookup function
Hello We have a DB sender to call an BAPI. The DB receiver gets the BAPI response. It is an easy scenario with one mapping. But the RFC Mapping Lookup is very awful. You have to rebuild all open and close tags to get the RFC payload. A lot of concat
-
Computer doesn't boot, stuck in white screen with Apple logo
I got a friend that has a MacBook 2.0GHz, Black. The computer had some sort of problem so he took out the HD and placed it into another computer (MacBook 2.2GHz, Black). For some reason whenever the computer boots, it gets stuck in the white screen w
-
Hello, I ran the sample program C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values\Write Dig Chan-Ext Clk, but got a message as below: DAQmx Error: Requested value is not a supported value for this pro