cancel
Showing results for 
Search instead for 
Did you mean: 

How to add inner class in Custom Controller

Former Member
0 Kudos

Hi,

Im new to this Developer Studio.

I need to implement and inner class in Custom Controller. How can I add an inner class in Custom controller. I tried in UML diagram, Select Class->Right click->New->Inner Class, after typing the name of the class and saved, inner class is disappearing.

How can I create or define an inner class here?

Pramod B

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank you VS. Im able to do it.

Pramod

Former Member
0 Kudos

Hi jitender,

I already followed the same steps that you have mentioned in your post. But on creating a inner class using context menu and press save all metadata, inner class disappears. This is the problem Im facing.

Kindly let me know what Im missing.

Thank you for your reply.

Pramod B

Former Member
0 Kudos

Pramod,

Every WD controller has special coding areas where you can place your custom code.

At the very bottom of controller file find the following:

//@@begin others

//@@end

Place your inner class code between these lines, for ex.:

//@@begin others

static class MyRunnable implements Runnable

{

public void run() { System.out.println("Running"); }

}

//@@end

VS

Dheerendra
Participant
0 Kudos

Hi Pramod...

Hope the following Link will be help-full for u in creating inner class in Custom Controller....

http://help.sap.com/saphelp_erp2005/helpdata/en/98/cd04cbe46b8d4091cadbe0e674ab09/frameset.htm

former_member205624
Contributor
0 Kudos

hi, pramod

try this it will help ful for you.

-


Working with Inner Classes and Interfaces

Both inner classes and inner interfaces in diagrams display within their own compartment field within the class, as shown:

<b>Creating</b>

To create an inner class (when the class already exists), drag it over another class and drop it.

You can also use one of the following methods:

Using the context menu:

Right click on the parent class.

Select New > Inner Class from the context menu.

Using Cut, Copy, and Paste:

Use the clipboard operations to either Cut or Copy an existing inner class.

Select the parent class.

Use the clipboard operations to Paste the selected class into the parent class.

TIP: You can use drag and drop or clipboard operations to remove inner classes from the parent class, transforming them into a normal class. Classes do not keep the same visibility after removing them from the parent class.

<b>Editing</b>

To edit an inner class:

From the menubar, select Window > Show View > Properties.

Select the element from either the UML Navigator or Diagram view.

Edit the fields in the Properties view as necessary.

<b>Renaming</b>

To rename an inner class, choose one of the following methods:

Using in-place editing:

In the Diagram view, double click the element's name to enable in-place editing.

Enter the new name.

Click Enter, or click in the diagram to apply the changes.

Using the context menu:

Right click on the element in either the UML Navigator or Diagram view.

Select Rename from the context menu.

Enter the new name.

Click Enter, or click in the diagram to apply the changes.

Using the Properties view:

From the menubar, select Window > Show View > Properties.

Select the inner class.

Edit the name field in the Properties view.

Press Enter, or click in the UI to apply the changes.

-


please let me know whether or not that will solve your prob.

regards

jitender