Check error log sap

Now I’ll show you how to monitor SAP System logs for some warning or error logs. One of the tasks of SAP Basis Administrator is to maintain the health of the system and to keep the system performance good and the SAP application runs well. You must regularly check the system log for early detection ... Read more

Now I’ll show you how to monitor SAP System logs for some warning or error logs. One of the tasks of SAP Basis Administrator is to maintain the health of the system and to keep the system performance good and the SAP application runs well. You must regularly check the system log for early detection and take action if necessary. This task is part of Daily Monitoring in SAP System Management (SAP CCMS).

You check the SAP system logs from transaction SM21.
1. Click Continue if it’s you first time running SM21.

How to monitor SAP System log-1
How to monitor SAP System Logs – Pic 1

2. Choose All Remote Systems logs if you have more than one application servers.

How to monitor SAP System Logs – Pic 2

3. Look for any error messages, and do detailed analysis by double clicking it. You have to do this monitoring daily. Because if too many errors happen it can affect your daily SAP Application Server performance.

How to monitor SAP System Logs – Pic 3

4. Now you can see further information from it. Actually the checking process can’t run stand alone, you have to check as well error log from System Dump (ST22) or system Process (SM50/SM51)

How to monitor SAP System Logs – Pic 4
How to monitor SAP System Logs – Pic 5

Содержание

  1. Error log transaction sap
  2. Prerequisites
  3. Procedure
  4. Result
  5. More Information
  6. Viewing the Error Log with the SAP System
  7. Displaying Error Log
  8. Prerequisites
  9. Context
  10. Procedure
  11. Results
  12. Next Steps
  13. Viewing the Error Log with the SAP System
  14. Error Log

Error log transaction sap

The error logging function provides information about all errors happening during the processing in the SOAP runtime. The system writes an entry in the error log for any Web service error, both for synchronous and asynchronous Web service communication. Note that the log may not contain details on every error if aggregation has been switched on during configuration. For more information, see Configuring Logging

You can use the error log to:

Check the recommended action for an entry, and try to solve the problem or ask for help from the administrators or SAP Active Global Support .

Use information such as the names of the interface and the operation, the message ID, and the user ID to perform further analyses in the Message Monitor and the Sequence Monitor .

Use the information about an error to activate the tracing function and analyze the error in detail.

Consider that the error log contains entries only for errors that occur during runtime. It does not contain information about activities such as changes to the Web service configuration, deletion or cancellation of Web service messages, or termination of Web service sequences. You can find information about these activities using the SOAP Configuration Management tools. More information: Application Log – (BC-SRV-BAL)

Prerequisites

You have activated and configured logging. More information: Configuring Logging

Your user is assigned one of the following roles:

SAP_BC_WEBSERIVCE_ADMIN_BIZ allows you only to view the error log.

SAP_BC_WEBSERIVCE_ADMIN_TEC allows you to view and manage the error log.

For more information, see Authorizations .

Procedure

Start transaction SRT_UTIL.

Choose Error Log.

The error log displays by default the entries for the current day for all users.

To find log entries that are not displayed, choose Select Logs and set the search parameters.

You can change the expiration date for a log entry by selecting it and choosing ( Change Expiry Date) .

The number of days for which the error log keeps the error entries can be configured for each SAP client of an ABAP system.

Result

The system displays error log entries according to the search criteria you specified. The displayed information can help a Web service user or system administrator to solve Web service issues.

Recommended Action

Choose ( Show recommended action) in the Long Text column for an error log entry. This way you can obtain information about the error diagnosis, the system response, and recommendations on what a Web service user or administrator can do to solve the problem.

Error Details

By default, the system displays general information such as date and time, client ID, operation ID, user name, consumer proxy or server proxy, error category, component, package, and many other details.

You can choose to display or hide columns as needed. More information: Showing and Hiding Columns

Additional Information

In addition to the general information, you can obtain additional useful information in one of the following ways:

Choose Summarize Logs to view a summary of error log entries.

You can see the error context for a log entry by selecting the entry in the list and choosing Error Context.

The error context contains variable data delivered by an SOAP Runtime component, and also information about the current consumer or provider configuration.

To view the basic details or the source of a log entry, you need to select the entry in the list and choose ( Details) or ( View Source Code) , respectively.

Choose ( Download as XML) to download a log entry as a file.

You can send this file to your colleagues or to SAP Active Global Support when you need to discuss errors.

Choose the link in the Consumer/Server Proxy column for an error log entry to receive more information about the corresponding ABAP proxy object. More information: Displaying ABAP Proxy Objects

For asynchronous messages, you can choose the link in the Message ID column to display details about the corresponding XML message. More information: Monitor for Processed XML Messages

Choose the link in the Sequence ID column for an error log entry to receive more information about the corresponding sequence. More information: Monitoring Sequences

Choose the link in the Queue Name column for an error log entry to access the bgRFC monitor, where you can obtain information about the corresponding bgRFC units. More information: bgRFC Monitor

More Information

Transaction SOAMANAGER also provides error and trace logs for the Web service runtime. The tools provided by this transaction are based on a different logging and tracing concept. They are configured, implemented, and viewed independently of the Web service support utilities described here. More information: Displaying Logs and Traces

The Web service support utilities can be integrated in transaction SOAMANAGER in future releases.

Источник

Viewing the Error Log with the SAP System

The error log is a central file(s) in which all the important actions and error messages concerning the database are recorded. The database administrator should examine the log every day.

  1. To view the error log, use transaction DBACOCKPIT.
  2. Choose Diagnostics.
  3. Choose SQL Error Logs.

All the available error logs are listed.

To display the contents of a particular log, click on it to list its contents below.

A new error log is created each time SQL Server starts. SQL Server retains backups of the previous six error logs. If the log file name is E: Program FilesMicrosoft SQL ServerLOGERRORLOG, the last six log files are archived under the following names:

E: Program FilesMicrosoft SQL ServerLOGERRORLOG.1

E: Program FilesMicrosoft SQL Server\LOGERRORLOG.2 …

E: Program FilesMicrosoft SQL Server\LOGERRORLOG.6

Each time the SQL Server starts, the archived oldest log files are overwritten and lost, unless you save them first. If you have a serious problem, you should immediately save these files otherwise they are lost.

Pay special attention to the columns Contains Severity 17 and Contains Severity 20. If a Y appears in these columns, it means a noteworthy severity level error message has occurred, and the cause should be investigated.

Newer versions of the application allow you to select checkboxes to include only severity 20 or 17 errors, or to exclude backup and logon messages.

Источник

Displaying Error Log

Prerequisites

You have activated and configured logging. More information: Configuring Logging

Your user is assigned one of the following roles:

SAP_BC_WEBSERIVCE_ADMIN_BIZ allows you only to view the error log.

SAP_BC_WEBSERIVCE_ADMIN_TEC allows you to view and manage the error log.

For more information, see Authorizations .

Context

The error logging function provides information about all errors happening during the processing in the SOAP runtime. The system writes an entry in the error log for any Web service error, both for synchronous and asynchronous Web service communication. Note that the log may not contain details on every error if aggregation has been switched on during configuration. For more information, see Configuring Logging

You can use the error log to:

Check the recommended action for an entry, and try to solve the problem or ask for help from the administrators or SAP Active Global Support .

Use information such as the names of the interface and the operation, the message ID, and the user ID to perform further analyses in the Message Monitor and the Sequence Monitor .

Use the information about an error to activate the tracing function and analyze the error in detail.

Consider that the error log contains entries only for errors that occur during runtime. It does not contain information about activities such as changes to the Web service configuration, deletion or cancellation of Web service messages, or termination of Web service sequences. You can find information about these activities using the SOAP Configuration Management tools. More information: Application Log — (BC-SRV-BAL)

Procedure

The error log displays by default the entries for the current day for all users.

The number of days for which the error log keeps the error entries can be configured for each SAP client of an ABAP system.

Results

The system displays error log entries according to the search criteria you specified. The displayed information can help a Web service user or system administrator to solve Web service issues.

Choose in the Long Text column for an error log entry. This way you can obtain information about the error diagnosis, the system response, and recommendations on what a Web service user or administrator can do to solve the problem.

By default, the system displays general information such as date and time, client ID, operation ID, user name, consumer proxy or server proxy, error category, component, package, and many other details.

You can choose to display or hide columns as needed. More information: Showing and Hiding Columns

In addition to the general information, you can obtain additional useful information in one of the following ways:

Choose Summarize Logs to view a summary of error log entries.

You can see the error context for a log entry by selecting the entry in the list and choosing Error Context .

The error context contains variable data delivered by an SOAP Runtime component, and also information about the current consumer or provider configuration.

To view the basic details or the source of a log entry, you need to select the entry in the list and choose or , respectively.

Choose to download a log entry as a file.

You can send this file to your colleagues or to SAP Active Global Support when you need to discuss errors.

Choose the link in the Consumer/Server Proxy column for an error log entry to receive more information about the corresponding ABAP proxy object. More information: Displaying ABAP Proxy Objects

For asynchronous messages, you can choose the link in the Message ID column to display details about the corresponding XML message. More information: Monitor for Processed XML Messages

Choose the link in the Sequence ID column for an error log entry to receive more information about the corresponding sequence.

Choose the link in the Queue Name column for an error log entry to access the bgRFC monitor, where you can obtain information about the corresponding bgRFC units. More information: bgRFC Monitor

Next Steps

Transaction SOAMANAGER also provides error and trace logs for the Web service runtime. The tools provided by this transaction are based on a different logging and tracing concept. They are configured, implemented, and viewed independently of the Web service support utilities described here. More information: Displaying Logs and Traces

The Web service support utilities can be integrated in transaction SOAMANAGER in future releases.

Источник

Viewing the Error Log with the SAP System

The error log is a central file(s) in which all the important actions and error messages concerning the database are recorded. The database administrator should examine the log every day.

  1. To view the error log, use transaction DBACOCKPIT.
  2. Choose Diagnostics.
  3. Choose SQL Error Logs.

All the available error logs are listed.

To display the contents of a particular log, click on it to list its contents below.

A new error log is created each time SQL Server starts. SQL Server retains backups of the previous six error logs. If the log file name is E: Program FilesMicrosoft SQL ServerLOGERRORLOG, the last six log files are archived under the following names:

E: Program FilesMicrosoft SQL ServerLOGERRORLOG.1

E: Program FilesMicrosoft SQL Server\LOGERRORLOG.2 …

E: Program FilesMicrosoft SQL Server\LOGERRORLOG.6

Each time the SQL Server starts, the archived oldest log files are overwritten and lost, unless you save them first. If you have a serious problem, you should immediately save these files otherwise they are lost.

Pay special attention to the columns Contains Severity 17 and Contains Severity 20. If a Y appears in these columns, it means a noteworthy severity level error message has occurred, and the cause should be investigated.

Newer versions of the application allow you to select checkboxes to include only severity 20 or 17 errors, or to exclude backup and logon messages.

Источник

Error Log

The Error Log for SAP Gateway Foundation is a helpful addition to the Application Log Viewer. It provides detailed context information about errors that have occurred at runtime.

Developers, administrators, support consultants, and end users can launch the Error Log in transaction /IWFND/ERROR_LOG for hub systems and /IWBEP/ERROR_LOG in SAP Business Suite systems to obtain important context information about the time and location of errors. The Error Log facilitates easy navigation to the affected source code where you can make the necessary corrections.

The Error Log enables you to:

Identify precise time and location of errors in source code.

Determine how often an error has occurred.

Perform root-cause analyses.

Reproduce and correct errors.

The Error Log comprises two screen areas:

The Overview screen area lists all error IDs and their attributes, together with the date and time at which the particular errors occurred. As default, errors are displayed chronologically with the newest error at the top of the list. You can display the error information and descriptive error texts to obtain more detailed information about a particular error and also see how often and where it has occurred. You can determine the Line and Entry Number of an error in the Error Log and also ascertain the number of occurrences in the Error Count column. The error counter is helpful to reduce the amount of data stored in the Error Log as it counts the number of times an identical error (according to standard parameters including User Name, Service Name, Message Class, and Message Number) has occurred within one full hour.

As default, the Overview screen area lists all errors that have occurred on the current date for all users, but you can change the standard setting to suit your requirements. To display errors according to different criteria, choose the Re-Select icon and on the Select Error Log Entries subscreen, select the Free search radio button. The free-search options enable you to search for errors that occurred on a different date and specify the exact time range, for example.

To help you further refine your search, you can display errors according to the following criteria:

T100 Message ID

T100 Message Number

Component: can be cross-referenced if you need to create a customer message

Request URI Part

Request ID: identifier sent from consumer to SAP Gateway

If you do not want to use the free-search criteria, you can select one of the following alternative search options:

Operation ID : identifier within the Error Log

Transaction ID : identifies one transaction and is transferred to all affected SAP systems during processing.

If you select an error on the Overview screen area and then choose the Re-Select icon, the attributes of this particular error are entered automatically in the Select Error Log Entries subscreen. You can select an entire line or parts of the error information.

To enable you to identify where an error has occurred, the component, package, service name, root context ID, transaction ID, and request ID are listed in separate columns in the Overview screen area. You can sort the errors in the table according to various criteria, for example, the time or location they occurred.

If required, you can use the standard SAP Export function in the SAP List Viewer (ALV) to download the errors displayed in the Overview screen area, however the Error Log provides further options for facilitating error analysis.

The Overview screen area provides you with the following functions, which you can execute by choosing the relevant pushbuttons:

Display complete overview of context in which error occurred including technical attributes such as service name, request URI, SAP Business Suite system alias, and RFC destination. This context information is displayed in the Error Context screen area.

To display the context information in the Error Context screen area, you can select an error and then choose the Error Context pushbutton or double-click the error information in the Overview screen area.

Navigate to the source code in which the error has occurred and analyze the cause of the error.

Download the error log in XML format to your local PC. You might want to download the error log to analyze the errors offline at a later time or to forward the log as an attachment to administrators or Active Global Support. If required, you can select multiple errors in the table and download all the relevant error log information in one XML log file.

Upload error information contained in an XML file to enable easier error analysis. To upload an error log file from your PC, choose Upload from PC , browse to the relevant XML file, and choose Open . The error log information contained in the XML file is displayed in the Overview screen area of the Error Log.

Display a summary of all errors displayed in the list for each component and package together with the date and time of the first and last occurrence.

To display detailed context information about an error, double-click the relevant error item in the Overview screen area, or select the error item and choose the Error Context pushbutton. The relevant context information about the error item is displayed in the Error Context screen area where you can expand or collapse this information depending on the level of detail you require. The information displayed is organized according to Name and Value .

The Error Context screen area includes the following functions, which you can execute by choosing the relevant pushbuttons:

Display error in context in XML format. It is advantageous to display the error in XML so that all text strings are displayed in their entirety and in context. The texts displayed in the Error Context screen area are limited to 100 characters.

Display call stack up to the source code line in which the error occurred. You can select the error event to navigate to and check the relevant line of source code.

Navigate to the corresponding entry in the Application Log. You can also launch the Application Log in transaction /IWFND/APPS_LOG . Expand the tree to navigate to the error.

Display request XML that was sent from external consumer. It contains the HTTP request headers and payload.

Display response XML sent from SAP Gateway . It displayed the HTTP response headers and payload.

Access the Error Log (as of SAP Gateway 2.0 Support Package 5) or the Application Log Viewer (for lower releases) in the SAP Business Suite system. Alternatively, launch the ABAP Runtime Error application (transaction ST22 ) in the SAP Business Suite system if a short dump occurred during processing.

Choose from the following two replay options allowing you to reproduce and correct errors:

Choose from the following service maintenance options:

Maintain Service to activate and maintain services in the SAP Gateway hub system.

Service Implementation to navigate to the SAP Business Suite system and maintain the service there. In the SAP Business Suite system, you can navigate directly to the model provider class or data provider class for the given service.

For more information about how to configure the Error Log, see Configuration Settings for the Error Log.

Источник

При выполнении программы могут возникать ситуации, которые необходимо донести до пользователя. Обычно это ошибки, предупреждения или просто сообщение об успешном выполнении процедуры. Эти сообщения не должны возникать по отдельности через команду MESSAGE. Их нужно собрать и отобразить все вместе в нужный момент. Такой набор сообщений называется журналом. Журнал содержит как заголовочную информацию (код транзакции, пользователь, дата и время создания и т.п.), так и позиционную (сами сообщения).
Для ведения журнала приложений SAP предоставляет мощный инструмент, называемый BAL (Basis Application Log). Журнал приложений применяется для отладки, поддержки и разработки как стандартный, так и Z-приложений. Лог особенно необходим при отладки фоновых задачах, веб-сервисов, рабочих процессов, т.е. где не всегда удобно, а иногда даже просто невозможно использовать стандартный отладчик.
Просмотреть журнал приложения можно в тр. SLG1.
тр. SLG1 - Журнал приложения SAP


Реализация журнала приложений содержится в пакете SZAL.
BC-SRV-BAL - Базис: журнал приложений

Принцип работы

Весь цикл работы журнала приложений можно свести к 3-м этапам:

  • Создание/загрузка журнала. Для создания экземпляра лога используется функциональный модуль BAL_LOG_CREATE. На вход в ФМ передается структура типа BAL_S_LOG, содержащая заголовочную информацию. ФМ возвращает ID журнала приложений BALLOGHNDL.
  • Добавление сообщений. Для добавления сообщений используется функциональный модуль BAL_LOG_MSG_ADD. На вход ФМ передается ID журнала BALLOGHNDL, а также структура типа BAL_S_MSG содержащая информацию о сообщении.
  • Сохранение/отображение журнала. За отображения лога отвечает функциональный модуль BAL_DSP_LOG_DISPLAY.

Пример простого использования журнала приложений

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

*&———————————————————————*

*& Report  ZBAL_LOG_EXAMPLE1

*& BAL Log: Журнал приложений SAP

*&———————————————————————*

*& Пример использования журнала приложений SAP

*& http://abap4.ru/?p=283

*&———————————————————————*

REPORT zbal_log_example1.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  DATA ls_log TYPE bal_s_log.

  DATA ls_msg TYPE bal_s_msg.

  DATA lv_hnd TYPE balloghndl.

  DATA lt_hnd TYPE bal_t_logh.

  DATA lv_dummy TYPE string.

  ls_logextnumber = ‘Журнал приложений’.

  ls_logaluser = syuname.

  ls_logalprog = syrepid.

  CALL FUNCTION ‘BAL_LOG_CREATE’

    EXPORTING

      i_s_log      = ls_log

    IMPORTING

      e_log_handle = lv_hnd.

  MESSAGE s191(bl) INTO lv_dummy.

  ls_msgmsgty = symsgty.

  ls_msgmsgid = symsgid.

  ls_msgmsgno = symsgno.

  ls_msgmsgv1 = symsgv1.

  ls_msgmsgv2 = symsgv2.

  ls_msgmsgv3 = symsgv3.

  ls_msgmsgv4 = symsgv4.

  CALL FUNCTION ‘BAL_LOG_MSG_ADD’

    EXPORTING

      i_s_msg      = ls_msg

      i_log_handle = lv_hnd.

  APPEND lv_hnd TO lt_hnd.

  CALL FUNCTION ‘BAL_DSP_LOG_DISPLAY’

    EXPORTING

      i_t_log_handle = lt_hnd.

ENDFORM.

Результат работы программы
Пример использования журнала приложений SAP

Структура заголовка

Параметр Значение
1 EXTNUMBER Внешний идентификатор. Используется в качестве критериев поиска нужного журнала.
2 OBJECT Имя объекта. Объект журнала приложений, применяется при поиске в тр. SLG1.
3 SUBOBJECT Подобъект. Объект журнала приложений, применяется при поиске в тр. SLG1.
4 ALDATE Дата
5 ALTIME Время
6 ALUSER Имя пользователя
7 ALTCODE Код транзакции
8 ALPROG Имя программы
9 ALMODE Режим работы (B — фоновый; D — диалоговый; I — пакетный ввод; A — авто)
10 ALCHDATE Дата последнего изменения
11 ALCHTIME Время последнего изменения
12 ALCHUSER Пользователь, изменивший журнал
13 ALDATE_DEL Дата истечения срока хранения
14 DEL_BEFORE Журнал сохраняется до истечения срока хранения
15 ALSTATE Статус обработки (1 — подлежит обработке; 2 — в обработке; 3 — исполнено)
16 CONTEXT Контекст. Используется для привязки контекста к сообщению.
17 PARAMS Параметры. Используется для детализации сообщений.

В журнале приложений эти поля будут выглядеть следующим образом
BAL Log: Поля структуры BAL_S_LOG

Структура сообщения

Параметр Значение
1 MSGTY Тип сообщения
2 MSGID Класс сообщений
3 MSGNO Номер сообщения
4 MSGV1 Переменная сообщения
5 MSGV2 Переменная сообщения
6 MSGV3 Переменная сообщения
7 MSGV4 Переменная сообщения
8 MSGV1_SRC Происхождение переменных сообщения
9 MSGV2_SRC Происхождение переменных сообщения
10 MSGV3_SRC Происхождение переменных сообщения
11 MSGV4_SRC Происхождение переменных сообщения
12 DETLEVEL Степень детализации (число от 1 до 9)
13 PROBCLASS Класс проблем сообщения (1 — особо важное; 2 — важное; 3 — среднее; 4 — дополнительная информация)
14 ALSORT Критерий сортировки/группировка
15 TIME_STMP Метка времени сообщения
16 MSG_COUNT Число накопленных сообщений
17 CONTEXT Контекст. Используется для привязки контекста к сообщению.
18 PARAMS Параметры. Используется для детализации сообщений.

Параметры MSGV1_SRC, MSGV2_SRC, MSGV3_SRC, MSGV4_SRC используются для анализа сообщений. В них можно записывать параметры или место запуска программы. Например, у нас есть 2 реализации одной и той же операции. Сообщения в журналах будут одинаковыми. Чтобы отличить происхождения сообщений, можно записать служебную информацию в переменные происхождения.
Параметры DETLEVEL, PROBCLASS, ALSORT используются для фильтрации и сортировки сообщений.
Параметр MSG_COUNT является счетчиком накопленных сообщений, в случае если отправляются одинаковые сообщения.

В журнале приложений эти поля будут выглядеть следующим образом
BAL LOG: Поля структуры сообщения BAL_S_MSG

Пример стандартной демо-программы SBAL_DEMO_01.

Детализация сообщений

Сообщения можно детализировать. Процесс детализации заключается в следующем: в параметр PARAMS заполняются необходимые переменные и программу обратной связи для обработки детализации. При двойном клике на поле детализации вызывается программа обратной связи, в которую передаются необходимые параметры.
Параметр PARAMS является структурой типа BAL_S_PARM.

Параметр Значение
1 T_PAR Таблица параметров с именами параметров и их значениями
2 CALLBACK Структура для обратной связи
3 ALTEXT Текст из SE61, в случае если длины текста T100 не достаточно

Программа обратной связи представляет собой функциональный модуль или подпрограмму, принимающие на вход таблицу I_T_PARAMS типа BAL_T_PAR.
В случае, если необходимо вызывать ФМ, то CALLBACK должна быть заполнена следующим образом:
CALLBACK-USEREXITT = ‘F’.
CALLBACK-USEREXITF = ИМЯ_ФМ.
В случае, если необходимо вызывать подпрограмму, то CALLBACK должна быть заполнена следующим образом:
CALLBACK-USEREXITP = ИМЯ_ПРОГРАММЫ.
CALLBACK-USEREXITF = ИМЯ_ПОДПРОГРАММЫ.

Пример журнала приложений с деталицацией

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

*&———————————————————————*

*& Report  ZBAL_LOG_EXAMPLE2

*& BAL Log: Журнал приложений SAP

*&———————————————————————*

*& Пример детализации в журнале приложений SAP

*& http://abap4.ru/?p=283

*&———————————————————————*

REPORT zbal_log_example2.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  DATA ls_log TYPE bal_s_log.

  DATA ls_msg TYPE bal_s_msg.

  DATA lv_hnd TYPE balloghndl.

  DATA lt_hnd TYPE bal_t_logh.

  DATA ls_param TYPE BAL_S_PAR.

  DATA lv_dummy TYPE string.

  ls_logaluser = syuname.

  ls_logextnumber = ‘Журнал приложений’.

  CALL FUNCTION ‘BAL_LOG_CREATE’

    EXPORTING

      i_s_log      = ls_log

    IMPORTING

      e_log_handle = lv_hnd.

  MESSAGE w191(bl) INTO lv_dummy.

  ls_msgmsgty = symsgty.

  ls_msgmsgid = symsgid.

  ls_msgmsgno = symsgno.

  ls_msgmsgv1 = symsgv1.

  ls_msgmsgv2 = symsgv2.

  ls_msgmsgv3 = symsgv3.

  ls_msgmsgv4 = symsgv4.

  ls_msgparamscallbackuserexitp = syrepid.

  ls_msgparamscallbackuserexitf = ‘CALLBACK’.

  ls_paramparname = ‘PAR’.

  ls_paramparvalue = ‘Hello, world!’.

  APPEND ls_param TO ls_msgparamst_par.

  CALL FUNCTION ‘BAL_LOG_MSG_ADD’

    EXPORTING

      i_s_msg      = ls_msg

      i_log_handle = lv_hnd.

  APPEND lv_hnd TO lt_hnd.

  CALL FUNCTION ‘BAL_DSP_LOG_DISPLAY’

    EXPORTING

      i_t_log_handle = lt_hnd.

ENDFORM.

FORM callback TABLES i_t_params TYPE bal_t_par.

  DATA ls_param TYPE bal_s_par.

  READ TABLE i_t_params INTO ls_param WITH KEY parname = ‘PAR’.

  CHECK sysubrc EQ 0.

  MESSAGE ls_paramparvalue TYPE rs_c_info.

ENDFORM.

И результат выполнения
BAL LOG: Детализация сообщения

Пример стандартной демо-программы SBAL_DEMO_02.

Привязка контекста

Иногда сообщение имеет смысл только в контексте. Например, сообщение «Документ не может быть удален» возникает при обработке определённого документа. При выводе лога привязка документа теряется. Информация о документе может быть помещена в само сообщение. В этом случае могут возникнуть проблемы при анализе сообщения (в случае если перечень сообщений возвращает пакетный ввод) или число параметром может быть больше чем число переменных сообщения (например, БЕ, завод, склад, год, номер документа, позиция и т.п.).
Журнал приложения предоставляет возможность добавить к сообщениям определенный контекст. В программе просмотра журнала поля контекста можно выводить в отдельном столбце.
BAL LOG: пример вывода полей контекста в ALV

Для добавления контекста необходимо заполнить параметр CONTEXT, который является структурой типа BAL_S_CONT.

Параметр Значение
1 TABNAME Имя структуры ABAP-словаря (см. SE11)
2 VALUE Данные контекста

Если контекстом является плоская структура, все элементы которой типа CLIKE, то контекст можно заполнить прямым присвоением структуры в поле VALUE

  DATA ls_msg TYPE bal_s_msg.

  DATA ls_ctx TYPE zs_bal_ctx.

  ls_msgcontexttabname = ‘ZS_BAL_CTX’.

  ls_msgcontextvalue = ls_ctx.

В остальных случаях (например, если контекст содержит числовые поля) можно воспользоваться таким способом

  DATA ls_msg TYPE bal_s_msg.

  DATA ls_ctx TYPE zs_bal_ctx.

  FIELDSYMBOLS: <lv_ctx> TYPE c.

  ASSIGN ls_ctx TO <lv_ctx> CASTING.

  ls_msgcontexttabname = ‘ZS_BAL_CTX’.

  ls_msgcontextvalue = <lv_ctx>.

Для вывода полей контекста в ALV журнала приложений, необходимо добавить нужное поле в каталог полей. Отображение журнала происходит через функциональный модуль BAL_DSP_LOG_DISPLAY, в который передается параметр профиля отображения I_S_DISPLAY_PROFILE. В профиле есть поле MESS_FCAT — каталог полей. В него нужно добавить нужные столбцы для отображения.
Пример стандартной демо-программы SBAL_DEMO_02.

Объединение сообщений

Некоторые сообщения отправляются программой несколько раз без предоставления новой информации. Такие сообщения могут быть объединены с помощью BAL_LOG_MSG_CUMULATE. Когда повторяется одно и то же сообщение, новое сообщение не добавляется, счетчик MSG_COUNT для старого сообщения увеличивается.
Функциональный модуль BAL_LOG_MSG_CUMULATE имеет спец. параметры, определяющие критерии объединения:
I_COMPARE_ATTRIBUTES = ‘X’
Атрибуты сообщения (класс проблем PROBCLASS, уровень детализации DETLEVEL, критерий сортировки ALSORT) должны совпадать
I_COMPARE_CONTEXT = ‘X’
Контекст должен совпадать
I_COMPARE_PARAMETERS = ‘X’
Параметры сообщения должны совпадать

Дополнительные возможности добавления сообщений

BAL_LOG_MSG_ADD_FREE_TEXT — добавляет текст в журнал

  CALL FUNCTION ‘BAL_LOG_MSG_ADD_FREE_TEXT’

    EXPORTING

      i_msgty = ‘E’

      i_text  = ‘Текст сообщения’.

BAL_LOG_EXCEPTION_ADD — добавляет исключение в журнал

  DATA ls_exc TYPE bal_s_exc.

  DATA lr_root TYPE REF TO cx_root.

  ls_excmsgty = ‘E’.

  ls_excexception = lr_root.

  CALL FUNCTION ‘BAL_LOG_EXCEPTION_ADD’

    EXPORTING

      i_log_handle = lv_log_handle

      i_s_exc      = ls_exc.

Пример стандартной демо-программы SBAL_DEMO_07.

Сохранение журнала приложений

Если журнал нужно сохранять в БД, то при создании лога через BAL_LOG_CREATE в структуру заголовка необходимо передать объект и подобъект (не обязательно).
Создаются объекты и подобъекты в тр. SLG0.
slg0 - создание объекта/подобъекта BAL

Просматривать журнал можно будет в тр. SLG1.
slg1 - просмотр журнала приложений BAL

Чтобы сообщения сохранились нужно вызвать BAL_DB_SAVE, после чего сделать COMMIT WORK.

Просмотр журнала сообщений

За отображения журнала приложений отвечает BAL_DSP_LOG_DISPLAY. На вход нужно передать заполненную структуру BAL_S_PROF. В большинстве случаев, требуется изменить какие-то значения структуры. Чтобы не заполнять профиль целиком, можно считать стандартный профиль и изменить в нем нужные поля. Пример добавляет контекстное поле в ALV.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

FORM log_display.

  DATA ls_display_profile TYPE bal_s_prof.

  DATA ls_fcat TYPE bal_s_fcat.

  CALL FUNCTION ‘BAL_DSP_PROFILE_SINGLE_LOG_GET’

    IMPORTING

      e_s_display_profile = ls_display_profile

    EXCEPTIONS

      OTHERS              = 1.

  IF sysubrc <> 0.

    MESSAGE ID symsgid TYPE symsgty NUMBER symsgno

            WITH symsgv1 symsgv2 symsgv3 symsgv4.

  ENDIF.

  ls_fcatref_table = ‘BAL_S_EX01’.

  ls_fcatref_field = ‘ID’.

  ls_fcatcol_pos   = 100.

  APPEND ls_fcat TO ls_display_profilemess_fcat.

  ls_display_profiledisvariantreport = syrepid.

  ls_display_profiledisvarianthandle = ‘LOG’.

  CALL FUNCTION ‘BAL_DSP_LOG_DISPLAY’

    EXPORTING

      i_s_display_profile = ls_display_profile

    EXCEPTIONS

      OTHERS              = 1.

  IF sysubrc <> 0.

    MESSAGE ID symsgid TYPE symsgty NUMBER symsgno

            WITH symsgv1 symsgv2 symsgv3 symsgv4.

  ENDIF.

ENDFORM.

Отображение журнала в модальном окне

Функциональный модуль BAL_DSP_PROFILE_POPUP_GET возвращает настройки профиля для вывода в модальном окне.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

*&———————————————————————*

*& Report  ZBAL_LOG_EXAMPLE3

*& BAL Log: Журнал приложений SAP

*&———————————————————————*

*& Пример детализации в журнале приложений SAP

*& http://abap4.ru/?p=283

*&———————————————————————*

REPORT zbal_log_example3.

START-OF-SELECTION.

  PERFORM main.

FORM main.

  DATA ls_log TYPE bal_s_log.

  DATA ls_msg TYPE bal_s_msg.

  DATA lv_hnd TYPE balloghndl.

  DATA lt_hnd TYPE bal_t_logh.

  DATA ls_prof TYPE bal_s_prof.

  DATA lv_dummy TYPE string.

  CALL FUNCTION ‘BAL_LOG_CREATE’

    EXPORTING

      i_s_log      = ls_log

    IMPORTING

      e_log_handle = lv_hnd.

  MESSAGE w191(bl) INTO lv_dummy.

  ls_msgmsgty = symsgty.

  ls_msgmsgid = symsgid.

  ls_msgmsgno = symsgno.

  ls_msgmsgv1 = symsgv1.

  ls_msgmsgv2 = symsgv2.

  ls_msgmsgv3 = symsgv3.

  ls_msgmsgv4 = symsgv4.

  CALL FUNCTION ‘BAL_LOG_MSG_ADD’

    EXPORTING

      i_s_msg      = ls_msg

      i_log_handle = lv_hnd.

  CALL FUNCTION ‘BAL_DSP_PROFILE_POPUP_GET’

    IMPORTING

      e_s_display_profile = ls_prof.

  ls_profuse_grid = abap_true.

  APPEND lv_hnd TO lt_hnd.

  CALL FUNCTION ‘BAL_DSP_LOG_DISPLAY’

    EXPORTING

      i_t_log_handle      = lt_hnd

      i_s_display_profile = ls_prof.

ENDFORM.

Результат будет таким
BAL LOG: Журнал приложения в модальном окне

Информация

Подробную документацию API журнала приложений можно взять тут.
Демо программы:
SBAL_DEMO_01 — простейший вызов журнала приложений
SBAL_DEMO_02 — различные виды сбора сообщений, детализация, контекст
SBAL_DEMO_03 — поиск сообщений в памяти
SBAL_DEMO_04 — разные форматы журнала приложений
SBAL_DEMO_05 — сохранение и загрузка журналов
SBAL_DEMO_06 — добавление комплексных данных к журналу
SBAL_DEMO_07 — добавление исключений
SBAL_DEMO_08 — поиск исключений в памяти

December 27, 2017 coderobbot SAP Gateway Leave a comment

light111SAP Gateway Error Log

 


Many times the oDATA service created in Tx- /IWFND/MAINT_SERVICE don’t work properly while testing. In such a case it is essential to analyse the error log of the service.

The error log can be checked in Tx- /IWFND/ERROR_LOG .


Test a service in Tx- /IWFND/MAINT_SERVICE

1

Execute and check the result in RESPONSE window. here some error in response.

2


Open Tx- /IWFND/ERROR_LOG  and check the error details.

3

Here the request and response data can be checked with many other things.

4


Leave a Reply

Enter your comment here…

Fill in your details below or click an icon to log in:

Gravatar

Email (Address never made public)

Name

Website

WordPress.com Logo


You are commenting using your WordPress.com account.
( Log Out / 
Change )

Twitter picture


You are commenting using your Twitter account.
( Log Out / 
Change )

Facebook photo


You are commenting using your Facebook account.
( Log Out / 
Change )

Cancel

Connecting to %s

Notify me of new comments via email.

Notify me of new posts via email.


Advertisements

Critical tasks:

  1. Check that the R/3System is up –> Log onto the R/3 System
  2. Check that daily backup executed without errors –> DB12 Check database backup from DB02 or another backup tool.
  3. Log backup –> Log backup is completing successfully and adequate log area is there.
  4. Network Issue –> verify there is any network issue which causing connection/performance issue.

SAP System checks:

  1. Check that all application servers are up –> by logging at OS level through MMC or sapcontrol command and from within SAP check that all servers are up through SM51.
  2. Check work processes (started from SM51) –> All work processes with a “running” or a “waiting” status though SM50 tcode.
  3. Global Work Process overview –> check whether all workprocess is occupied in system and whether maximum wp action on same table/program or any wp is on hold.
  4. Look for any updates –> check for update in SM13 whether any update is hung/running since long time in system.
  5. Check system log –> check the log in SM21, any error log is there related to issue.
  6. Review for SM37 jobs –> check if any job is running since long time and continually getting failed. Also verify if any all standard housekeeping job is running and successfully completing in system.
  7. Check for “old” locks –> check for old SM12 lock entry and take the respective action on it.
  8. Check for spool problems –> check for spool jobs that have been “In process” for over an hour r spool WP is stuck through SM66.
  9. Review and resolve dumps –> Look for an excessive number of dumps. Look for dumps of an unusual nature in ST22 tcode.
  10. Review buffer statistics –> Look for swaps memory through ST02 tcode and check if need of any buffer tuning.
  11. Review error log for problems –> check various error log under tcode ST04
  12. Review high locking query/program –> check if any query or program is consuming lots of lock and commit statement from ST04 or DB level.
  13. SQL lock –> Check if any SQL lock is stuck or running since long time.
  14. Reorg and stats at DB level –> Check if DB stats for all table is ran successfully and up to date. In some case noticed that due to outdated stats many programs took much longer time than usual to complete from DB13 or DB level.
  15. Database Growth & Missing Indexes –> If tablespace is used more than 90 % add new data file to it Rebuild the Missing Indexes from DB02 or at DB level.
  16. Review SQL Profile –> Keep updating all updated SQL profile for program at DB level.
  17. Check DB01 –> make sure there is no database lock entry present in db01
  18. Expensive statement –>Check the expensive SQL statement n db02
  19. Check in ST03n tcode –> Check the response time for that user and also check for which report the response time is higher and take the action accordingly

OS level check:

  1. Check I/O input utilization for all server at OS level.
  2. Check CPU & memory utilization at OS level for all server.
  3. Check if any anti-virus can be running at that time on /usr/sap and /sapmnt/ directory at OS level.
  4. Check for space of all file system at OS level.

Hi buddies,

In this topic, i will show you how to check SAP PO system logs and meaning of each system logs files when you download from SAP PO.

What is system log viewer ?

SAP Process Orchestration will store activities of system, integration, and database events. In system log viewer you can see technical detail system status.

Base on information in system logs you can checking, monitoring and investigating issue and roots cause if any.

System logs stored with multi severity:

Fatal error messages

Error messages

Warning messages

Information messages

Path messages

Debug messages

Each log message, it has three group of information (1) log properties, (2) values of properties, (2) detail of message

View system logs step by step

Step 01: Access SAP PO Main page and SAP Netweaver Administrator.

http://XXX:YYY/nwa

XXX: your SAP PO host name or IP

YYY: Port number

Step 02: Troubleshooting -> Logs and Traces

Step 03: Filter log messages

Filter logs messages by severity
Log record details

Step 04: Download logs to text files

Download log files to your local computer then open by WinRAR or WinZip

Step 05: Log files types

[Auto number]_applications_00.0.log -> file content logs of activities of SAP PO Application level.

[Auto number]_database_00.0.log -> file content logs of SAP PO Database level.

[Auto number]_security_00.0.log -> file content logs of securities of application level.

[Auto number]_userinterface_00.0.log -> file content logs of user’s interface

[Auto number]_enterprise_services_00.0.log -> file content logs of enterprise services.

Depend on size and numbers of interface objects in your SAP PO system. Logs will be stored with files by versions.

Tips for search log files content with special keyword

When system is facing issues and there are many log files, it is difficult to search log content. We need use external tools to search errors with keyword. In my case, i use Notepad++ and search download log files.

Conclusion, to identify issues of SAP PO system, you need to finger out detail of message log in log files, that help you know root cause of issues.

Thanks for your reading, leave comment if any question.

Cuong Dang

Понравилась статья? Поделить с друзьями: