How To Fix 28036 - Object variable expected


SAP Error Message - Details

  • Message type: E = Error

  • Message class: 28 - Configuration

  • Message number: 036

  • Message text: Object variable expected

  • Show details Hide details
  • What causes this issue?

    The syntax check found an error. An object variable is expected at the
    cursor.
    In preconditions, selection conditions, procedures, and actions, you
    can use the following object variables:
    $ROOT for the highest level object in a multi-level configuration
    $SELF for the object currently being processed
    $PARENT for the object immediately above current object $SELF in a
    multi-level configuration
    The object variable is separated from the characteristic by a period:
    $ROOT.COLOR
    In constraints, you can define object variables under OBJECTS.
    T IS_A (300)TABLE
    You can also define your own variables for characteristics in
    constraints. You then use these variables to refer to the
    characteristics.
    If you have not defined object variables for the characteristics of the
    object, you must define which object the characteristic belongs to. In
    this case, the system expects an object variable before the
    characteristic.
    T.Material = 'oak'

    System Response

    The system issues an error message and will not allow you to continue with this transaction until the error is resolved.

    How to fix this error?

    Check your entry and correct it as appropriate. Please note also other
    possible causes of error (messages).

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message 28036 - Object variable expected ?

    The SAP error message "28036 Object variable expected" typically occurs in the context of SAP ABAP programming, particularly when dealing with object-oriented programming. This error indicates that the program is trying to use an object reference that has not been properly instantiated or is set to NULL.

    Cause:

    1. Uninitialized Object Reference: The most common cause is that an object variable has been declared but not instantiated. For example, if you declare an object of a class but do not create an instance of that class using the CREATE OBJECT statement.

    2. Incorrect Object Assignment: If you are trying to assign an object reference from another variable that is not properly initialized, this can also lead to this error.

    3. Scope Issues: The object might have gone out of scope, or it might not be accessible in the current context.

    Solution:

    1. Instantiate the Object: Ensure that you have created an instance of the object before using it. For example:

      DATA: lo_object TYPE REF TO your_class.
      CREATE OBJECT lo_object.
    2. Check Object Initialization: Before using the object, check if it is initialized:

      IF lo_object IS NOT BOUND.
        CREATE OBJECT lo_object.
      ENDIF.
    3. Review Object Assignments: Make sure that any assignments to object references are done correctly and that the source object is properly instantiated.

    4. Debugging: Use the debugger to step through your code and check the state of your object references at runtime. This can help identify where the object is not being initialized.

    5. Scope Management: Ensure that the object is within the correct scope and is not being destroyed or going out of scope before you attempt to use it.

    Related Information:

    • ABAP Documentation: Refer to the official SAP documentation for more details on object-oriented programming in ABAP.
    • SAP Community: Engage with the SAP Community forums for discussions and solutions related to similar issues.
    • Error Handling: Implement error handling in your code to gracefully manage situations where an object might not be initialized.

    By following these steps, you should be able to resolve the "28036 Object variable expected" error in your SAP ABAP programs.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:
  • 28035 Key expected
    What causes this issue? In the source code of the dependency, a key is expected. However, you did not enter a valid key. A valid key comprises alphan...

  • 28034 Boolean expression expected
    What causes this issue? A boolean expression is an expression that is evaluated as true or false. The syntax check found an error. A boolean expressi...

  • 28037 Logical expression required
    What causes this issue? The syntax check found an error. A logical expression, such as a value comparison, is expected at the cursor.System Response ...

  • 28038 Numeric expression required
    What causes this issue? The system check found a syntax error. At the cursor, the system expects a numeric expression, such as a figure, a numeric ch...

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