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: 

Transaction SLG1 - Export/Save Log

Former Member
0 Kudos

Hi,

How do you export/save a log from transaction SLG1?

Points will be rewarded and all help will be greatly appreciated.

Thanks,

John

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

SLG! transaction is not to save log, to view log messages by providing object name and subobject.

see the following instructions, it will give clear idea on how to create, how to save in data base and how to see log messages tat are stored in database.

What is an Application Log?

The Application Log is a tool for collecting messages, saving, reading and deleting logs in the database and displaying logs.

Use of Application Log:

You can analyze the logs and their messages, and get more information about them, in the Display log dialog box. The log display is used in many SAP system applications, and has a slightly different format depending on the number of messages and the data structure.

Features of Application Log:

In applications with a (potentially) large number of messages, the display is divided into areas. A navigation tree provides an overview and allows navigation among the messages, and either all or a selection of messages are displayed in a list (ABAP List Viewer). The navigation tree can be either above or to the left of the list. Applications with little data have no navigation tree.

Function module used to create Application Log

BAL_LOG_CREATE --> Create log with header data

BAL_LOG_MSG_ADD --> Put message in log

BAL_DB_SAVE --> Save logs in the database

Transaction Codes:

SLG0: Creation of Object and Sub object

SLG1: Display Application Logs

Step by Step procedure for Creation of Application Log:

Step 1: Open the transaction code SLG0. This transaction code is used to create Object and Sub object.

Step 2: Check for the Object which is already in created and in use by your company/team/project. Else, Create a New Entry starting with Z or Y.

Step 3: After creating (if not exist) the object, select the object and go to its sub-objects.

Step 4: If corresponding sub-objects doesn¡¦t exists, create a sub object.

Step 5: Now the ¡¥Object¡¦ and ¡¥Sub Object¡¦ are used in creation of Application Log.

Step 6: Three function modules are basically used to create the application log

Step 7: 'BAL_LOG_CREATE' „³ this function module creates the log handle

Step 8: 'BAL_LOG_MSG_ADD' „³ this function module is used to populate the messages into the created application log. If we have more than one message to be passed into the same log, then we can loop at the messages and pass them through this function module.

Step 9: 'BAL_DB_SAVE' „³ this function module is used to save the log. The creation of log and addition of messages into the log are performed in the first two function modules mentioned. This function module saves the log so that the user can view the log in SAP.Transaction Code the view the log: SLG1.

SAMPLE CODE

data: ls_log TYPE bal_s_log,

ls_log_handle TYPE balloghndl,

ls_log_handle TYPE balloghndl,

ls_msg TYPE bal_s_msg,

lt_new_lognumbers TYPE bal_t_lgnm.

clear: ls_log, ls_log_handle.

ls_log-aluser = sy-uname.

ls_log-alprog = sy-repid.

ls_log-object = .

CALL FUNCTION 'BAL_LOG_MSG_ADD'

EXPORTING

i_log_handle = ls_log_handle

i_s_msg = ls_msg

EXCEPTIONS

log_not_found = 1

msg_inconsistent = 2

log_is_full = 3

OTHERS = 4.

CALL FUNCTION 'BAL_DB_SAVE'

EXPORTING

i_t_log_handle = lt_log_handle

IMPORTING

e_new_lognumbers = lt_new_lognumbers

EXCEPTIONS

log_not_found = 1

save_not_allowed = 2

numbering_error = 3

OTHERS = 4.

How to view Application Logs?

1. Choose the transaction SLG1. You go to the Analyze Application Log dialog box.

2. Enter Object, Subobject and Ext. number.

3. Choose a Time restriction.

4. Specify Log caused by.

5. Choose the Log class and Log creation.

6. Choose Execute.

You go to the Display log dialog box.

FURTHER REFERENCES

Help URL:

http://help.sap.com/saphelp_47x200/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/fr ameset.htm

http://help.sap.com/saphelp_erp2005/helpdata/EN/d6/5d7f38f52f923ae10000009b38f8cf/ frameset.htm

reward points if it useful.

thanks

swapna

5 REPLIES 5

Former Member
0 Kudos

Execute SLG1. Goto List->Export-->to your format..

REward if this helps.

Vik

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In 46c, you appear to be able to choose from the menu, List -> Export -> Local File.

Regards,

RIch Heilman

Former Member
0 Kudos

SLG1 Initial screen - it is disabled ,if you execute the SLG1 then use below path

System->List->save->local file

Former Member
0 Kudos

Hi,

SLG! transaction is not to save log, to view log messages by providing object name and subobject.

see the following instructions, it will give clear idea on how to create, how to save in data base and how to see log messages tat are stored in database.

What is an Application Log?

The Application Log is a tool for collecting messages, saving, reading and deleting logs in the database and displaying logs.

Use of Application Log:

You can analyze the logs and their messages, and get more information about them, in the Display log dialog box. The log display is used in many SAP system applications, and has a slightly different format depending on the number of messages and the data structure.

Features of Application Log:

In applications with a (potentially) large number of messages, the display is divided into areas. A navigation tree provides an overview and allows navigation among the messages, and either all or a selection of messages are displayed in a list (ABAP List Viewer). The navigation tree can be either above or to the left of the list. Applications with little data have no navigation tree.

Function module used to create Application Log

BAL_LOG_CREATE --> Create log with header data

BAL_LOG_MSG_ADD --> Put message in log

BAL_DB_SAVE --> Save logs in the database

Transaction Codes:

SLG0: Creation of Object and Sub object

SLG1: Display Application Logs

Step by Step procedure for Creation of Application Log:

Step 1: Open the transaction code SLG0. This transaction code is used to create Object and Sub object.

Step 2: Check for the Object which is already in created and in use by your company/team/project. Else, Create a New Entry starting with Z or Y.

Step 3: After creating (if not exist) the object, select the object and go to its sub-objects.

Step 4: If corresponding sub-objects doesn¡¦t exists, create a sub object.

Step 5: Now the ¡¥Object¡¦ and ¡¥Sub Object¡¦ are used in creation of Application Log.

Step 6: Three function modules are basically used to create the application log

Step 7: 'BAL_LOG_CREATE' „³ this function module creates the log handle

Step 8: 'BAL_LOG_MSG_ADD' „³ this function module is used to populate the messages into the created application log. If we have more than one message to be passed into the same log, then we can loop at the messages and pass them through this function module.

Step 9: 'BAL_DB_SAVE' „³ this function module is used to save the log. The creation of log and addition of messages into the log are performed in the first two function modules mentioned. This function module saves the log so that the user can view the log in SAP.Transaction Code the view the log: SLG1.

SAMPLE CODE

data: ls_log TYPE bal_s_log,

ls_log_handle TYPE balloghndl,

ls_log_handle TYPE balloghndl,

ls_msg TYPE bal_s_msg,

lt_new_lognumbers TYPE bal_t_lgnm.

clear: ls_log, ls_log_handle.

ls_log-aluser = sy-uname.

ls_log-alprog = sy-repid.

ls_log-object = .

CALL FUNCTION 'BAL_LOG_MSG_ADD'

EXPORTING

i_log_handle = ls_log_handle

i_s_msg = ls_msg

EXCEPTIONS

log_not_found = 1

msg_inconsistent = 2

log_is_full = 3

OTHERS = 4.

CALL FUNCTION 'BAL_DB_SAVE'

EXPORTING

i_t_log_handle = lt_log_handle

IMPORTING

e_new_lognumbers = lt_new_lognumbers

EXCEPTIONS

log_not_found = 1

save_not_allowed = 2

numbering_error = 3

OTHERS = 4.

How to view Application Logs?

1. Choose the transaction SLG1. You go to the Analyze Application Log dialog box.

2. Enter Object, Subobject and Ext. number.

3. Choose a Time restriction.

4. Specify Log caused by.

5. Choose the Log class and Log creation.

6. Choose Execute.

You go to the Display log dialog box.

FURTHER REFERENCES

Help URL:

http://help.sap.com/saphelp_47x200/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/fr ameset.htm

http://help.sap.com/saphelp_erp2005/helpdata/EN/d6/5d7f38f52f923ae10000009b38f8cf/ frameset.htm

reward points if it useful.

thanks

swapna

0 Kudos

try RSSEARCHLOGS_SLG1