How To Fix WS335 - Messages are no longer included in the application log


SAP Error Message - Details

  • Message type: E = Error

  • Message class: WS - Supplier Billing Document

  • Message number: 335

  • Message text: Messages are no longer included in the application log

  • Show details Hide details
  • What causes this issue?

    Because of an internal error, messages are no longer transferred to the
    application log.

    System Response

    Processing continues without the application log.

    How to fix this error?

    As a rule, this is due to an internal program error.
    As this only affects the log function, processing continues.

    Procedure for System Administrators

    Please contact SAP.
    Function module &V2& produced the error code (exception) &V1&. It was
    called in function module &V3&.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message WS335 - Messages are no longer included in the application log ?

    SAP Error Message:
    WS335 - Messages are no longer included in the application log


    Cause:

    The error message WS335 occurs when an attempt is made to include or add messages to an application log that has already been closed or finalized. In SAP, application logs are used to record messages during processing, but once the log is closed (i.e., the log handle is released or the log is finalized), no further messages can be added. Trying to add messages after this point triggers the WS335 error.


    Explanation:

    • Application logs are created and managed using function modules such as BAL_LOG_CREATE, BAL_LOG_MSG_ADD, and BAL_LOG_CLOSE.
    • After the log is closed with BAL_LOG_CLOSE, the log handle becomes invalid for adding new messages.
    • If the program logic attempts to add messages after closing the log, the system raises WS335.

    Solution:

    1. Check the program flow:

      • Ensure that messages are added before the application log is closed.
      • Review the sequence of function module calls related to application log handling.
    2. Correct usage of function modules:

      • Use BAL_LOG_CREATE to create the log.
      • Use BAL_LOG_MSG_ADD to add messages.
      • Use BAL_LOG_CLOSE only after all messages have been added.
    3. Debugging:

      • Trace the program to find where BAL_LOG_CLOSE is called.
      • Verify that no BAL_LOG_MSG_ADD calls occur after the log is closed.
    4. Code adjustment example:

      DATA: log_handle TYPE bal_t_logh.
      
      CALL FUNCTION 'BAL_LOG_CREATE'
        EXPORTING
          object     = 'YOUR_OBJECT'
          subobject  = 'YOUR_SUBOBJECT'
          extnumber  = '0001'
        IMPORTING
          log_handle = log_handle.
      
      " Add messages here
      CALL FUNCTION 'BAL_LOG_MSG_ADD'
        EXPORTING
          log_handle = log_handle
          msgid      = 'ZMSG'
          msgno      = '001'
          msgty      = 'E'
          msgv1      = 'Some text'.
      
      " Close the log after all messages are added
      CALL FUNCTION 'BAL_LOG_CLOSE'
        EXPORTING
          log_handle = log_handle.

    Related Information:

    • Transaction SLG1: To view application logs.
    • Function Modules:
      • BAL_LOG_CREATE - Create application log.
      • BAL_LOG_MSG_ADD - Add message to log.
      • BAL_LOG_CLOSE - Close the log.
    • SAP Note: Check for any SAP Notes related to application log handling if the issue persists.
    • Documentation: SAP Help on Application Log (transaction SLG0 for configuration).

    Summary:

    • WS335 means you are trying to add messages to an application log that is already closed.
    • Fix by ensuring all messages are added before closing the log.
    • Review and correct the sequence of application log function module calls in your program.

    If you provide the specific code or scenario where this error occurs, I can help you pinpoint the exact fix.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Sign up for our Free Essentials Plan.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
ERPlingo's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker