How To Fix PG166 - No company code assigned to employee


SAP Error Message - Details

  • Message type: E = Error

  • Message class: PG - Error Messages for Master Data Programs

  • Message number: 166

  • Message text: No company code assigned to employee

  • Show details Hide details
  • What causes this issue?

    The system could not determine the company code from the
    organizational unit assigned to the position in Personnel Planning
    (infotype 1008) or from the personnel area (T500P). You must assign a
    company code to the employee.

    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 PG166 - No company code assigned to employee ?

    The SAP error message PG166 "No company code assigned to employee" typically occurs when you are trying to perform an action related to an employee in the Human Capital Management (HCM) module, but the system cannot find a company code associated with that employee. This can happen in various scenarios, such as when creating or modifying employee records, processing payroll, or generating reports.

    Cause:

    1. Missing Company Code Assignment: The employee record does not have a company code assigned in the infotype 0001 (Organizational Assignment).
    2. Incorrect Data Entry: The employee's organizational assignment may have been entered incorrectly or not at all.
    3. Data Migration Issues: If data was migrated from another system, the company code might not have been properly assigned during the migration process.
    4. Employee Status: The employee might be in a status that does not allow for company code assignment (e.g., inactive or terminated).

    Solution:

    1. Check Employee Record:

      • Go to the employee's master data using transaction code PA30 (Maintain HR Master Data).
      • Check infotype 0001 (Organizational Assignment) to ensure that a valid company code is assigned.
    2. Assign Company Code:

      • If the company code is missing, you can assign it by editing the infotype 0001. Make sure to enter the correct company code and other relevant details.
    3. Review Data Migration:

      • If the issue arose after a data migration, review the migration process to ensure that all necessary data, including company codes, was transferred correctly.
    4. Check Employee Status:

      • Ensure that the employee is in an active status. If the employee is inactive or terminated, you may need to reactivate or create a new record.
    5. Consult with HR or IT:

      • If you are unsure about making changes or if the issue persists, consult with your HR department or IT support team for further assistance.

    Related Information:

    • Infotype 0001: This infotype contains the organizational assignment details of the employee, including the company code, personnel area, and personnel subarea.
    • Transaction Codes:
      • PA30: Maintain HR Master Data
      • PA20: Display HR Master Data
      • PA40: Personnel Actions
    • Authorization: Ensure that you have the necessary authorizations to make changes to employee records in SAP.

    By following these steps, you should be able to resolve the PG166 error and ensure that the employee has the correct company code assigned.

    • 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