How To Fix 5P358 - Decision field and comparative value or field are not of the same length


SAP Error Message - Details

  • Message type: E = Error

  • Message class: 5P - Error Messages for Schema, Pers.Calc.Rule and Feature Checks

  • Message number: 358

  • Message text: Decision field and comparative value or field are not of the same length

  • Show details Hide details
  • What causes this issue?

    You have formulated a comparison for a field within a decision
    operation as follows:
    field+off(length)?'value' or field1+off(length)?field2+off(length)
    The lengths of field+off(length) and 'value' and/or field1+off(length)
    and field2+off(length) are not identical. Please correct the lengths
    accordingly.

    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?


    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message 5P358 - Decision field and comparative value or field are not of the same length ?

    The SAP error message 5P358, which states "Decision field and comparative value or field are not of the same length," typically occurs in the context of decision-making processes within SAP, such as in the use of decision tables, rules, or conditions in workflows or business processes. This error indicates that there is a mismatch in the data types or lengths of the fields being compared in a decision-making context.

    Cause:

    1. Data Type Mismatch: The fields being compared may have different data types (e.g., one is a character field while the other is a numeric field).
    2. Length Mismatch: The lengths of the fields being compared are not the same. For example, if one field is defined as a CHAR(10) and the other as CHAR(5), this will lead to the error.
    3. Incorrect Configuration: The configuration of decision tables or rules may not align with the expected data structure, leading to comparisons that are not valid.

    Solution:

    1. Check Field Definitions: Review the definitions of the fields involved in the decision-making process. Ensure that they are of the same data type and length.
    2. Adjust Data Types: If necessary, modify the data types or lengths of the fields to ensure they match. This may involve changing the field definitions in the database or adjusting the logic in the decision-making process.
    3. Review Decision Logic: Examine the decision logic or rules to ensure that the comparisons being made are valid and that the fields being compared are intended to be compared.
    4. Testing: After making adjustments, test the decision-making process to ensure that the error no longer occurs and that the logic behaves as expected.

    Related Information:

    • SAP Documentation: Refer to SAP's official documentation for more details on decision tables, rules, and data types.
    • Transaction Codes: Use transaction codes like SE11 (Data Dictionary) to check field definitions and SE80 (Object Navigator) to review the relevant programs or configurations.
    • Debugging: If the error persists, consider using the debugging tools in SAP to trace the execution and identify where the mismatch occurs.

    By addressing the data type and length mismatches, you should be able to resolve the error and ensure that your decision-making processes function correctly.

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