|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
ABAP based Application Log
By Vijayendra Krishnamurthy Rao, Hewlett-Packard
to use ABAP Based Application Log.
explains briefly the standard logging processes with Application Log. It should
help readers understand what Application Log is and how to use it.
provides an infrastructure for collecting messages and exceptions in a log,
saving, reading and deleting logs in the database and displaying them.
provides multiple advantages:
records the progress of the execution of an application. Whereas the system log
records system events, you can use the application log to record
application-specific events. Application Log is designed to temporarily store
messages. Logs should be deleted in intervals (e.g. weekly batch job for
deleting logs) to avoid too high database load.
A typical use of
the Application Log is within delivery processing. Negative results of a
dangerous goods check are written to the Application Log. Application messages
and reactions are collected based on a customer defined examination schema
(reactions determine how the document will be handled further). This approach
increases the transparency of the process for end users. Messages are collected
temporarily and are not saved to the database.
You may also use Application Log for complex scenarios such as the ticket selling by Internet invoked by a large number of users. With standard ABAP technologies (Enqueue/Dequeue) you can guarantee data consistency (details see below).
to use Application Log
are different transactions for use of the Application Log.
Developer: Use transaction SLG0 to define entries for your
own applications in the application log.
Key user: Use transaction SLG1 to analyze the application
Administrator: Use transaction SLG2 to delete logs.
in our scenario we have two custom programs to load PO and GR’s from a flat
file into SAP. We wanted a mechanism to store the results of each program run in
the database for future use. One way of achieving this is to create Z custom
tables and store all the errors in the Z table. The other option was to use the
std sap application log mechanism provided by SAP.
chose the second option as it is more robust and SAP has provided std
transactions to display the log. So we don’t have to write another program to
display the log from the Z tables had we used the first option.
1à Create Custom Application log objects
to transaction SLG1.Go to change mode and click on New entries button on the
application tool bar.
the name of the objects. In our case we have entered two objects. One to store
application log for Good receipts and one for storing application log for
can also create Sub-objects for an object. Subobjects are simply further
classifications of the application log. In our case we don’t need a sub
object. But the following screen shots below shows some of the std objects and
seen above for the standard object ALE DISTRIBUTION UNIT there are 2 sub objects
if there is any application logs generated during inbound ALE processing it will
be stored in the INBOUND sub-object and if there is any application logs
generated during outbound processing then it will be stored in the OUTBOUND
sub-object. This is just to classify the logs while storing them in the
database. Instead of simply creating the logs and storing them it makes sense to
have sub objects and store respective application logs. This way it becomes easy
for trouble shooting in the future.
see other standard objects and their sub-objects.
the standard application log object IUFC – Form Printout: Form Class
Maintenance the sub-objects are created to store the type of logs generated
while processing. So in this case as seen from the screen shot above there are
sub-objects such as
so on… so the purpose of the sub-object is to simply classify the types of
application logs generated while processing any applications.
once the entries are made in SLG0 transaction, save your entries. The system
will prompt for creating a transport request. Create a transport request so that
these objects can be transported from Development to the quality and finally to
the production systems.
Important point to remember.
Once you save the entries in the
system and create a transport request the system will automatically generate 2
LOCK function modules. If you go to SE09 and expand the TP number you will see
the system has created two LOCK function modules.
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards