How To Fix OO035 - The typing method can be 'Like', 'Type', or 'Type Ref To'


SAP Error Message - Details

  • Message type: E = Error

  • Message class: OO - Class Builder/API

  • Message number: 035

  • Message text: The typing method can be 'Like', 'Type', or 'Type Ref To'

  • Show details Hide details


  • Self-Explanatory Message

    Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.

    To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.

    Unfortunately, there isn't any extra information in this error notice.



    What else can you do?

    First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).

    Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.

    You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.


Smart SAP Assistant

  • What is the cause and solution for SAP error message OO035 - The typing method can be 'Like', 'Type', or 'Type Ref To' ?

    The SAP error message OO035 indicates that there is an issue with the way a data type is being defined in ABAP (Advanced Business Application Programming). This error typically arises when the syntax used for defining a variable or a type is incorrect. The message suggests that the typing method should be one of the following: 'Like', 'Type', or 'Type Ref To'.

    Cause:

    The error can occur due to several reasons:

    1. Incorrect Syntax: The syntax used for declaring a variable or type is not following the expected format.
    2. Invalid Type Specification: The type specified does not exist or is not accessible in the current context.
    3. Misuse of Typing Methods: Using a typing method that is not appropriate for the context, such as trying to use 'Like' when a 'Type' or 'Type Ref To' is expected.

    Solutions:

    To resolve the OO035 error, you can take the following steps:

    1. Check Syntax: Review the line of code where the error occurs and ensure that the syntax is correct. For example:

      • Use DATA: variable_name TYPE data_type. for defining a variable with a specific type.
      • Use DATA: variable_name LIKE reference_variable. to define a variable that takes the same type as another variable.
      • Use DATA: variable_name TYPE REF TO class_name. for defining a reference to an object of a class.
    2. Verify Type Existence: Ensure that the data type you are trying to use is defined and accessible in the current scope. If you are using a custom type, make sure it is declared properly.

    3. Use Appropriate Typing Method: Depending on what you are trying to achieve, choose the correct typing method:

      • Use LIKE when you want to create a variable that has the same type as an existing variable.
      • Use TYPE when you want to define a variable with a specific data type.
      • Use TYPE REF TO when you are working with object-oriented programming and need to create a reference to an object.

    Example:

    Here’s an example of how to correctly declare variables using the different typing methods:

    DATA: lv_variable TYPE i.                " Using TYPE
    DATA: lv_reference_variable TYPE i.      " Another variable of type i
    DATA: lv_like_variable LIKE lv_reference_variable.  " Using LIKE
    DATA: lo_object TYPE REF TO cl_my_class. " Using TYPE REF TO

    Related Information:

    • ABAP Documentation: Refer to the official SAP ABAP documentation for detailed information on data types and variable declarations.
    • SAP Community: Engage with the SAP Community forums for discussions and solutions related to ABAP programming errors.
    • Debugging Tools: Use the ABAP debugger to step through your code and identify where the error is occurring.

    By following these guidelines, you should be able to resolve the OO035 error and correctly define your data types in ABAP.

    • 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:

Click on this link to search all SAP messages.


Rating
ERPlingo simplifies finding the accurate answers to SAP message errors. I now use every week. A must have tool for anyone working with SAP! Highly recommended!
Rate 1
Kent Bettisworth
Executive SAP Consultant