How To Fix MN842 - Data record length of external file & incorrect


SAP Error Message - Details

  • Message type: E = Error

  • Message class: MN - Message class for subsequent settlement (Purchasing)

  • Message number: 842

  • Message text: Data record length of external file & incorrect

  • Show details Hide details
  • What causes this issue?

    External file &V1& cannot be read, due to an incorrect data record
    length.
    The data records in the file &V1& have the length &V2&, whereas the data
    records of the underlying structure 'WBONI_MCKONA_LINE' have the length
    &V3&.
    This is not allowed.

    System Response

    The external file cannot be processed.

    How to fix this error?

    Possible reasons:

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

    Error during creation of file (record layout is incorrect)
    Change to structure 'WBONI_MCKONA_LINE' (e.g. change to price
    determination structure 'KOMG').
    The system tries to read a Unicode formatted file. This is not possible.
    Check the programs for compiling the external data file. If the
    structures are changed in the system, you must adapt the programs for
    creating the external data files to the new record layout.
    Make the changes. Create a data file with the correct data record
    length.
    Contact your system administrator.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message MN842 - Data record length of external file & incorrect ?

    The SAP error message MN842 indicates that there is an issue with the data record length of an external file being processed. This error typically occurs during the import of data into SAP, particularly when dealing with flat files or external data sources.

    Cause:

    The error message MN842 is triggered when the length of the data records in the external file does not match the expected length defined in the SAP system. This mismatch can occur due to several reasons:

    1. Incorrect File Format: The external file may not be formatted correctly, leading to discrepancies in record length.
    2. Field Length Mismatch: The fields in the external file may not align with the expected field lengths in the SAP data structure.
    3. Delimiter Issues: If the file uses delimiters (like commas or tabs) incorrectly, it can lead to unexpected record lengths.
    4. Corrupted File: The file may be corrupted or improperly generated, resulting in unexpected data lengths.
    5. Configuration Issues: The configuration settings in SAP for the data import may not match the structure of the external file.

    Solution:

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

    1. Check File Format: Ensure that the external file is in the correct format as expected by SAP. Verify that it is a plain text file and adheres to the required specifications.

    2. Validate Record Length: Compare the record length of the external file with the expected record length in SAP. You can do this by checking the data structure definition in SAP.

    3. Review Field Definitions: Ensure that the fields in the external file match the definitions in SAP, including data types and lengths.

    4. Inspect Delimiters: If the file is delimited, check that the delimiters are used correctly and consistently throughout the file.

    5. Test with Sample Data: Create a small sample file that adheres to the expected format and test the import process with it to isolate the issue.

    6. Use Data Conversion Tools: If necessary, use data conversion tools or scripts to transform the external file into the correct format before importing it into SAP.

    7. Consult Documentation: Refer to SAP documentation or guides related to data import processes for specific requirements regarding file formats and record lengths.

    8. Error Logs: Check SAP error logs for additional details that may provide more context about the error.

    Related Information:

    • Transaction Codes: Depending on the context of the error, you may be using transaction codes like LSMW (Legacy System Migration Workbench) or BAPIs for data import.
    • SAP Notes: Search for relevant SAP Notes in the SAP Support Portal that may address known issues or provide additional guidance on handling this error.
    • Community Forums: Consider checking SAP Community forums or other user groups for similar issues and solutions shared by other users.

    By following these steps, you should be able to identify and resolve the cause of the MN842 error in SAP.

    • 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