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

Problem with SLG1 log application

Former Member
0 Likes
1,838

Hi all,

I have some problem with the SAP application log.

I would like to create a log and write message to the log and at last close my log

The problem is when i created log first time messages are written in the log as well. But when I created a new log my messages are written wihin the previous log and no message have been witten within the new log.

Is it necessary to call a commit work after saving message into a log? Or is there a standard function to close the log? For instance I used the function BAL_DB_SAVE to write message in my log and then to close it.

Thanks in advance for your answer.

Regards,

Philippe

1 ACCEPTED SOLUTION
Read only

VikasB
Active Participant
0 Likes
945

hi Philippe,

i think you need to create new log with different object or different subobject name.

if u create this by same name, the message will be written in the old log only.

also check whether you are saving the log when you finish with all your messages.

here is a code to the save the log.

  • If log created, save to database

if e_bal_hndl is not initial.

refresh: bal_hndl.

append e_bal_hndl to bal_hndl.

call function 'BAL_DB_SAVE'

exporting

i_client = sy-mandt

  • i_in_update_task = 'X'

i_t_log_handle = bal_hndl

importing

e_new_lognumbers = log_no

exceptions

log_not_found = 1

save_not_allowed = 2

numbering_error = 3

others = 4.

1 REPLY 1
Read only

VikasB
Active Participant
0 Likes
946

hi Philippe,

i think you need to create new log with different object or different subobject name.

if u create this by same name, the message will be written in the old log only.

also check whether you are saving the log when you finish with all your messages.

here is a code to the save the log.

  • If log created, save to database

if e_bal_hndl is not initial.

refresh: bal_hndl.

append e_bal_hndl to bal_hndl.

call function 'BAL_DB_SAVE'

exporting

i_client = sy-mandt

  • i_in_update_task = 'X'

i_t_log_handle = bal_hndl

importing

e_new_lognumbers = log_no

exceptions

log_not_found = 1

save_not_allowed = 2

numbering_error = 3

others = 4.