Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

application log issue

Former Member
0 Likes
584

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

3 REPLIES 3
Read only

Former Member
0 Likes
512

Hello,

Try to use FM BAL_LOG_MSG_ADD to add entries to the application log.

Arash

Read only

alejiandro_sensejl
Active Participant
0 Likes
512

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

Read only

Former Member
0 Likes
512

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.