How To Fix 28087 - Data type error: formal parameter &1 is of type &2


SAP Error Message - Details

  • Message type: E = Error

  • Message class: 28 - Configuration

  • Message number: 087

  • Message text: Data type error: formal parameter &1 is of type &2

  • Show details Hide details
  • What causes this issue?

    The syntax check found an error in an entry for a table/function.
    Formal parameter &V1& is not of the same data type as the argument
    &V2&, entered with it.

    System Response

    The cursor marks the entry for a table/function that is incorrect.

    How to fix this error?

    A table is referred to by the keyword TABLE, the language-independent
    table name, and a list of arguments, each consisting of <Formal
    parameter = Arg>, for example:
    TABLE TEST_TAB(COLOR='red', PRICE=PRICE_1)
    COLOR and PRICE are formal parameters of the table, 'red' is a constant
    and PRICE_1 is a characteristic-specific variable.
    A function is identified by the keyword FUNCTION. The other entries are
    the same as for a table, for example:
    FUNCTION TEST_FUN(COLOR='red', PRICE=PRICE_1)
    The data type of each argument must be the same as that of the formal
    parameter. If COLOR is an alphanumeric characteristic (CHAR) in table
    TEST_TAB, for example, you cannot enter a figure as an argument. Check
    argument &V2& for formal parameter &V1& and correct the error.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message 28087 - Data type error: formal parameter &1 is of type &2 ?

    The SAP error message 28087, which states "Data type error: formal parameter &1 is of type &2," typically occurs when there is a mismatch between the expected data type of a formal parameter in a function module or method and the actual data type being passed to it. This can happen in various scenarios, such as when calling a function module, method, or when using BAPIs.

    Cause:

    1. Data Type Mismatch: The most common cause is that the data type of the variable being passed does not match the expected data type defined in the function module or method signature.
    2. Incorrect Parameter Passing: The parameter being passed may not be of the correct structure or type, such as passing a string when an integer is expected.
    3. Changes in Function Module: If the function module or method has been modified (e.g., updated to expect a different data type), and the calling program has not been updated accordingly, this error can occur.

    Solution:

    1. Check Parameter Types: Review the function module or method definition to confirm the expected data types for each parameter. Ensure that the variables you are passing match these types.
    2. Data Type Conversion: If necessary, convert the data type of the variable being passed to match the expected type. For example, if an integer is expected, ensure that the variable is indeed an integer.
    3. Update Calling Code: If the function module or method has been changed, update the calling code to ensure that it adheres to the new parameter definitions.
    4. Use Type-Safe Variables: When declaring variables, use the appropriate data types and structures to avoid mismatches.
    5. Debugging: Use debugging tools to step through the code and inspect the values and types of the parameters being passed to identify where the mismatch occurs.

    Related Information:

    • Function Module Documentation: Always refer to the SAP documentation for the specific function module or method you are using to understand the expected parameter types.
    • ABAP Data Types: Familiarize yourself with ABAP data types and structures to ensure proper usage in your code.
    • SAP Notes: Check SAP Notes for any known issues or updates related to the function module or method you are using, as there may be patches or recommendations available.

    By following these steps, you should be able to resolve the error message 28087 and ensure that your parameters are correctly defined and passed.

    • 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
The AI Support Assistant is great. It provides comprehensive assistance even on the most difficult issues. I highly recommend this service.
Rate 1
John Jordan
SAP Consultant & Author