Ansicht
Dokumentation

COM_PRWB_OPEN_LOG -

COM_PRWB_OPEN_LOG -

BAL Application Log Documentation   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

As of CRM Release 2.0C, all important messages in the product master are collected in the application log. An application log is created initially for each product (inactive product GUID).

As a result, important error messages are not output on the screen with the ABAP statement 'message', but appended to this application log.

The problem classes used in the application log are set in the function module COM_PRWB_ADD_LOGMSG depending on the message type.

  • A = VERY HIGH
Means that the product cannot be saved (either as active or inactive version)
For example, a product ID does not exist - the traffic light is RED.
  • E = HIGH
Means that an active version of the product cannot be saved.
For example, foreign key errors - the traffic light is RED.
  • W = Medium
Means that an active version of the product can be saved.
For example, a warning - the traffic light is YELLOW.
  • I = Low
Means that an active version of the product can be saved.
For example, an I message - the traffic light is GREEN.
  • S, X, ' ' = none
Means that an active version of the product can be saved. The traffic light is GREEN.

Error messages with message type W and lower are not saved in the database. Warnings (message type I) should not be placed in the log as this will affect performance.

The process is basically as follows:

  • Initial phase: create the application log
An application log is made available in the main memory for the product currently being worked on. A new application log is created in the product workbench when the user switches to a different product.
(Function COM_PRWB_OPEN_LOG)
  • Processing phase: write error messages to the application log
The log handle and the set type GUID are stored in a global variable. If one of these values changes, the variables must be reset (function com_prwb_set_logsettype). All old log messages for the specified set type are deleted.
In check routines, error messages are appended as messages to the application log in the main memory.
(Function COM_PRWB_ADD_LOGMSG)
  • Display phase: process the application log online
The status of the application log is checked. If there is a message in the very high or high problem class then red_light (function COM_PRWB_CHECK_LOG) is returned.
The application log is displayed and the data field accessed with a double-click (function COM_PRWB_SHOW_LOG).
  • Final phase: exit processing, close the application log, and save it to the database
    (function com_prwb_dbsave_log )

Example

* Initial phase: make available application log for the inactive product GUID

CALL FUNCTION 'COM_PRWB_OPEN_LOG'

EXPORTING iv_product_guid = iProductGuid.

* Processing phase (repeatedly append messages to application log)

CALL FUNCTION 'COM_PRWB_SET_LOGSETTYPE'

EXPORTING

iv_settypeguid = gc_com_product_cond_guid. " Set set type and delete old messages !

call function example_check.

IF sy-subrc < > 0.

DATA lc_dummy type C,

,,,, lc_linenumber type COMT_PRWB_ROW. " Only for table control, otherwise does not apply

lc_linenumber = sy-tabix. " Only for table control, otherwise does not apply

,, MESSAGE E003(com_prcat) INTO lc_dummy.

CALL FUNCTION 'COM_PRWB_ADD_LOGMSG#,,

EXPORTING IV_FELDNAME = 'PRODUCT_ID#,,

,, IV_LINENUMBER = lc_linenumber "Only for table control, otherwise does not apply

,, ,, IV_PRWB_NAVIGATION = ON. "Navigate to field in product workbench

ENDIF.

* Display phase: display application log with all messages

CALL SCREEN 100 (SAPLCOM_PRWB_APPLOG_UI).

* Final phase: close and save application log

CALL FUNCTION com_prwb_dbsave_log

EXPORTING IV_UPDATE_TASK = 'X'.

Notes

Further information





Parameters

EV_LOG_HANDLE
IV_DOUBLECLICK_FUNC
IV_PRODUCT_CONTEXT
IV_PROD_GUID
IV_UPDATE_TYPE

Exceptions

INTERNAL_ERROR

Function Group

COM_PRWB_APPLLOG_UI

RFUMSV00 - Advance Return for Tax on Sales/Purchases   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 5103 Date: 20240523 Time: 110341     sap01-206 ( 63 ms )