Stop googling SAP errors. Use our Free Essentials plan instead - no credit card needed. Start Now

Close

How To Fix WD385 - Class '&' must have 'public' entered as the instance generation


SAP Error Message - Details

  • Message type: E = Error

  • Message class: WD - Workflow definition

  • Message number: 385

  • Message text: Class '&' must have 'public' entered as the instance generation

  • 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 WD385 - Class '&' must have 'public' entered as the instance generation ?

    The SAP error message:

    WD385 Class '&' must have 'public' entered as the instance generation

    typically occurs in the context of Web Dynpro ABAP development.


    Cause

    This error arises when a Web Dynpro component or controller class is defined with an incorrect instance generation visibility. In Web Dynpro ABAP, certain classes (especially controllers and components) must be declared with public instance generation to allow the framework to instantiate them properly.

    If the class is set to protected or private instance generation, the Web Dynpro runtime cannot create instances of the class, leading to this error.


    Explanation of Terms

    • Instance Generation: This refers to the visibility of the constructor of the class, i.e., who can create instances of the class.
    • Public Instance Generation: The class can be instantiated from anywhere.
    • Protected/Private Instance Generation: The class can only be instantiated from within the class itself or its subclasses (protected) or only within the class itself (private).

    Solution

    1. Change the instance generation of the class to public:

      • Go to the ABAP Class Builder (transaction SE24).
      • Enter the class name mentioned in the error message.
      • Choose Change mode.
      • Go to the Properties tab.
      • Find the Instance Generation setting.
      • Set it to Public.
      • Save and activate the class.
    2. If the class is generated by Web Dynpro (e.g., component controller, window controller), ensure that the component/controller is properly generated and not manually changed to protected/private instance generation.

    3. Regenerate the Web Dynpro component if necessary:

      • Sometimes, after changes in the component or its controllers, regeneration is needed.
      • Use the Web Dynpro component editor to regenerate the component.

    Additional Information

    • This error is common when manually creating or modifying Web Dynpro classes or when importing components from other systems.
    • The Web Dynpro framework requires public instance generation to instantiate controllers and components dynamically at runtime.
    • If you are working with custom controllers or components, always ensure their instance generation is public.
    • This error can also appear during runtime if the class definition is inconsistent with the Web Dynpro framework expectations.

    Summary

    Aspect Details
    Cause Class instance generation is not public
    Effect Web Dynpro runtime cannot instantiate class
    Solution Set class instance generation to public in SE24
    Related Areas Web Dynpro ABAP components, controllers

    If you provide the exact class name or context, I can help with more specific instructions.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Sign up for our Free Essentials Plan.


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