Skip to Content
avatar image
Former Member

ABAP Unit Test Wizard Local class not showing

Hello All,

Could you please kindly help me with understanding how to solve issue?

I have created sample class via se24 . All activated with no issues. When I try to create via wizard Unit test class with option Local class field "Local Class Name" is empty and wizard doesn't let me go further. I as well tried to create local test class in include for local test classes, activated it but when again run wizard still when I choose "Local Class Name" - drop down list is still empty.

Best Regards,

Maria.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 04, 2017 at 04:15 PM

    As Mike already said, forget the wizard, you don't need it. Some years ago, there was a kind of wizardmania, but it seems that in some situations they hinder more than help. In fact, I even didn't know or I forgot about that one.

    Simply code your test class(es) by hand in the test include. Simple and straightforward.

    Add comment
    10|10000 characters needed characters exceeded

    • From the documentation:

      A test class is usually a local class. Global test classes (visible in se24 ) can be created for reusing complex test preparations. Global test classes should always be abstract and can only be used in local test classes. Currently, all instance methods of a global test class are automatically test methods.

      So you understand correctly.

      Also for a global test class, do it directly. Create it in SE24, you don't need the wizard. A local test class can then inherit from the global test class.

  • Nov 29, 2017 at 11:05 AM

    If i understand correctly you are trying to fill in the name of the "Local class" of the global class.

    You should just select the option "Global class" and click continue.

    In the next step, you'll get the option of either selecting an existing test class(from the dropdown list) or creating a new one.

    BR,

    Suhas

    PS - I would recommend you to switch to Eclipse (ADT), if possible. In ADT you can use a template which will generate the Test Class for you. Much easier!

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 29, 2017 at 11:22 AM

    It's asking you what class you want to test. As you don't have any local classes this is empty. If you have other local classes they will appear here.

    Select global class to generate a test class for your ZCL... global class. You define the test class details in the following steps.

    Add comment
    10|10000 characters needed characters exceeded

    • Don't confuse local classes and local test classes. In the wizard screen, the local class mentioned is not a local test class!

      A class pool contains by default only one class which is named the global class (same name as the class pool). A local class is an additional class that may be used only from the global class (or by another local class of the same class pool).

      So, if you don't have any local class (I'm not talking of a local test class), do as Suhas suggested, create a local test class to test the global class.