‎2010 Aug 23 2:59 PM
Hello,
I am facing an issue while creating application log.
I am able to get the log_handle as well as the log_number.
but when I call the Function: 'APPL_LOG_WRITE_MESSAGES', the sy-subrc is '1'.
i.e. Object cannot be found.
but thats not true because the log_handle and log_number can only be generated if there is Log object exists.
please help in this regard.
Thanks,
Ravish
‎2010 Aug 23 10:02 PM
Hello,
Try to use FM BAL_LOG_MSG_ADD to add entries to the application log.
Arash
‎2010 Aug 23 10:37 PM
Hello Ravish,
Arash is right, you should use the BAL* functions for writing the application log. You can find several examples in the wiki and/or code gallery (e.g. [Community Code Gallery > Error logging in Application Log|http://wiki.sdn.sap.com/wiki/display/Snippets/ErrorlogginginApplicationLog], [Community Code Gallery > Application Logging in SAP Using ABAP|http://wiki.sdn.sap.com/wiki/display/Snippets/ApplicationLogginginSAPUsingABAP] or [Community Code Gallery > Using Application Log|http://wiki.sdn.sap.com/wiki/display/Snippets/UsingApplication+Log]).
Regards,
Alej
‎2010 Aug 24 5:44 AM
Hi,
Use the following function modules in sequence - BAL_LOG_CREATE
to add different messages - BAL_LOG_MSG_AD
then save the log to database to view it later - BAL_DB_SAVE
then check in SLG1 for application log.