Application Development 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: 

ABAP Application log

Former Member
0 Kudos
201

Hi,

I have created a sample program for testing ABAP application log. I have used SBAL_DEMO examples as templates.

However what I dont understand is:

The call for creating the log is:

CALL FUNCTION 'BAL_LOG_CREATE'

which gives you back the parameter

e_log_handle which is some kind of id for identifying the log.

1. When do I need to use that parameter? I dont use it and everything is saved properly anyways. Can anyone show me an example where is NECESSARY to use that?

2. After I create my log with only the statement CALL FUNCTION 'BAL_LOG_CREATE' and do things like add_message_to_log. How does the system know where to put my text messages although i do not specify the e_log_handle?

regards

Baran

1 ACCEPTED SOLUTION

Former Member
0 Kudos
66

Hi ,

This unique number will identify the log which you have created by the FM

BAL_LOG_CREATE on that execution.

Suppose you want to change the header data using the FM BAL_LOG_HDR_CHANGE,

then to identify the log you need to know the log handle (e_log_handle ) which you have imported from

the FM BAL_LOG_CREATE .

Similarly if you want to add a message using FM BAL_LOG_MSG_ADD, you need

to identify the log by the e_log_handle .

To add an an exception text to a allready created LOG by BAL_LOG_EXCEPTION_ADD,

you will require the e_log_handle .

Copy from the documentation of the function module -

Short Text
Log handle

The function module BAL_LOG_CREATE returns the log handle (LOG_HANDLE, CHAR22).
The LOG_HANDLE is a GUID (globally unique identifier) which uniquely identifies a log. 
You can access this log with this handle, for example, to subsequently change the header 
data ( BAL_LOG_HDR_CHANGE) or to add a message ( BAL_LOG_MSG_ADD) 
or an exception text ( BAL_LOG_EXCEPTION_ADD) to the log.
The LOG_HANDLE has its permanent value straight away, so it remains valid after saving.

Regards

Pinaki

2 REPLIES 2

Former Member
0 Kudos
66

Hi Baran ,

As because e_log_handle is a optional parameter , so no need to worry about it.

Whenever you import this parameter you will get a unique number (LOG HANDLE)

in that parameter.

Regards

Pinaki

Former Member
0 Kudos
67

Hi ,

This unique number will identify the log which you have created by the FM

BAL_LOG_CREATE on that execution.

Suppose you want to change the header data using the FM BAL_LOG_HDR_CHANGE,

then to identify the log you need to know the log handle (e_log_handle ) which you have imported from

the FM BAL_LOG_CREATE .

Similarly if you want to add a message using FM BAL_LOG_MSG_ADD, you need

to identify the log by the e_log_handle .

To add an an exception text to a allready created LOG by BAL_LOG_EXCEPTION_ADD,

you will require the e_log_handle .

Copy from the documentation of the function module -

Short Text
Log handle

The function module BAL_LOG_CREATE returns the log handle (LOG_HANDLE, CHAR22).
The LOG_HANDLE is a GUID (globally unique identifier) which uniquely identifies a log. 
You can access this log with this handle, for example, to subsequently change the header 
data ( BAL_LOG_HDR_CHANGE) or to add a message ( BAL_LOG_MSG_ADD) 
or an exception text ( BAL_LOG_EXCEPTION_ADD) to the log.
The LOG_HANDLE has its permanent value straight away, so it remains valid after saving.

Regards

Pinaki