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: 

Application log ( Transaction slg1)

suresh_kumar53
Participant
0 Kudos

Hi,

This is suresh.

I got a requirement in that i need to send input values to application log. Am able to send four parameters using function module bal_log_msg_add(msgv1,msgv2,..) successfully. But in my requirement i need to send five parameters to application log. How can i do this. For which prameter i need to send using function module bal_log_msg_add. please help me in this.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Suresh,

See the Function Module Documentation, It will help you.

Sets of logs can be created with the following methods.

Function modules: [ Some Additional Function Modules ] :

BAL_LOG_CREATE Create log with header data

BAL_LOG_MSG_ADD Log a message

BAL_LOG_MSG_CUMULATE Add a message cumulatively to the log

BAL_LOG_MSG_REPLACE Replace the last message

BAL_GLB_MSG_CURRENT_HANDLE_GET Get the current message handle

BAL_LOG_MSG_DELETE Delete message

BAL_LOG_MSG_CHANGE Change message

BAL_GLB_MSG_DEFAULTS_GET Get message data defaults

BAL_GLB_MSG_DEFAULTS_SET Set message data defaults

Types :

BAL_S_MDEF Message defaults

Example program :

Program SBAL_DEMO_02 simulates a flight check and outputs a check result log.

==>SBAL_DEMO_02 ==>SBAL_DEMO_02 coding

Add message to log :

This is the 'classical' way of logging messages with BAL_LOG_MSG_ADD.

==>Note

The log handle is optional for function modules such as BAL_LOG_MSG_ADD, BAL_LOG_MSG_CUMULATE, BAL_LOG_MSG_ADD_FREE_TEXT, etc.

If it is not specified, the default log, which can be set, with other default data, with BAL_GLB_MSG_DEFAULTS_SET is used. If no default log is defined, it is set automatically by BAL_LOG_CREATE (see here).

Add message cumulatively :

Functionality :

A message is added to the log with ( log handle) I_LOG_HANDLE cumulatively.

The message data is in the IMPORTING parameter I_S_MSG (structure BAL_S_MSG).

A message handle E_S_MSG_HANDLE, which uniquely identifies this message, is returned.

'Cumulative'

Some messages are sent several times by a program, without providing new information each time. Such messages can be cumulated with BAL_LOG_MSG_CUMULATE to save memory. When the same message is repeated, no new message is added, the counter MSG_COUNT for the old message is incremented.

You can specify when messages are the same in the function module interface. The T100 data must be identical, and you can specify that other data must also be the same:

I_COMPARE_ATTRIBUTES = 'X'

Message attributes (problem class PROBCLASS, level of detail DETLEVEL and sort field ALSORT) must be identical

I_COMPARE_CONTEXT = 'X'

The context must be the same

I_COMPARE_PARAMETERS = 'X'

The message parameters must be the same.

To find identical messages quickly for cumulation, the Application Log constructs a small index table containing as unambiguous a signature of a message as possible, at runtime. This index is only constructed if cumulation is used.

Thanks.

3 REPLIES 3

Former Member
0 Kudos

Hi Suresh,

See the Function Module Documentation, It will help you.

Sets of logs can be created with the following methods.

Function modules: [ Some Additional Function Modules ] :

BAL_LOG_CREATE Create log with header data

BAL_LOG_MSG_ADD Log a message

BAL_LOG_MSG_CUMULATE Add a message cumulatively to the log

BAL_LOG_MSG_REPLACE Replace the last message

BAL_GLB_MSG_CURRENT_HANDLE_GET Get the current message handle

BAL_LOG_MSG_DELETE Delete message

BAL_LOG_MSG_CHANGE Change message

BAL_GLB_MSG_DEFAULTS_GET Get message data defaults

BAL_GLB_MSG_DEFAULTS_SET Set message data defaults

Types :

BAL_S_MDEF Message defaults

Example program :

Program SBAL_DEMO_02 simulates a flight check and outputs a check result log.

==>SBAL_DEMO_02 ==>SBAL_DEMO_02 coding

Add message to log :

This is the 'classical' way of logging messages with BAL_LOG_MSG_ADD.

==>Note

The log handle is optional for function modules such as BAL_LOG_MSG_ADD, BAL_LOG_MSG_CUMULATE, BAL_LOG_MSG_ADD_FREE_TEXT, etc.

If it is not specified, the default log, which can be set, with other default data, with BAL_GLB_MSG_DEFAULTS_SET is used. If no default log is defined, it is set automatically by BAL_LOG_CREATE (see here).

Add message cumulatively :

Functionality :

A message is added to the log with ( log handle) I_LOG_HANDLE cumulatively.

The message data is in the IMPORTING parameter I_S_MSG (structure BAL_S_MSG).

A message handle E_S_MSG_HANDLE, which uniquely identifies this message, is returned.

'Cumulative'

Some messages are sent several times by a program, without providing new information each time. Such messages can be cumulated with BAL_LOG_MSG_CUMULATE to save memory. When the same message is repeated, no new message is added, the counter MSG_COUNT for the old message is incremented.

You can specify when messages are the same in the function module interface. The T100 data must be identical, and you can specify that other data must also be the same:

I_COMPARE_ATTRIBUTES = 'X'

Message attributes (problem class PROBCLASS, level of detail DETLEVEL and sort field ALSORT) must be identical

I_COMPARE_CONTEXT = 'X'

The context must be the same

I_COMPARE_PARAMETERS = 'X'

The message parameters must be the same.

To find identical messages quickly for cumulation, the Application Log constructs a small index table containing as unambiguous a signature of a message as possible, at runtime. This index is only constructed if cumulation is used.

Thanks.

suresh_kumar53
Participant
0 Kudos

Ok VJ.

But in my requirement i need to send 5 input values that are specified in selection screen to application log. Am able to send 4 values using function module BAL_LOG_MSG_ADD (parameters msgv1, .. msgv4) to application log. But fifth input value which given in selection screen is not going to application log. Please help me in this.

0 Kudos

Hi suresh,

you can

- create more than one message using BAL_LOG_MSG_ADD

or

- concatenate your values into one MSGV field separated by '/'.

Regards,

Clemens