cancel
Showing results for 
Search instead for 
Did you mean: 

how to work with javabean in NWDS as a model

Former Member
0 Kudos

Hi Fndz ...

can any1 tell how to work with javabean in NWDS as a model ..give an example 4 better understading

Rajesh Kumar

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos
Former Member
0 Kudos

The beans to be used must be available in the development environment, the Sap NetWeaver Developer Studio, so that you can implement your own Java model view. To make the bean classes available to the Web Dynpro application, proceed as follows:

...

1. To define a Web Dynpro object, proceed as described in the chapter Creating a Project.

2. Ensure that the JavaBeans to be used have been imported into the development environment, either in the form of referenced projects or as external .jar files. Switch to the Navigator view and choose the context menu entry Import.

3. Now import the required beans into the Web Dynpro environment. For this purpose, start the model assistant by placing the cursor on the subdirectory Models of the Web Dynpro project in the Web Dynpro Explorer view. Then choose the context menu option Create Model .

4. Choose the option Import JavaBean Model, and then Next.

Enter a name for the model and select the model package. In this project, you have a storage area for the Web Dynpro model. It does not concern the package of the original Java classes. In addition, the package must be empty. The model classes created during the import get the name and the package of the corresponding JavaBean classes.

5. Select the Java classes for the import.

6. Expand the relations, if required. All the model classes that need to be expanded are marked. In this way, for example, the Assistant provides support for expanding relations of the type java.util.Collection. Only when all relations are expanded or have been marked by the import as non-relevant can the model import begin subsequently.

7. The name of the respective methods is displayed in the JavaBean class in the Assistant. Now the relation between the Web Dynpro model definition and JavaBean implementation has been created.

8. The last window shows the importing process and supplies detailed information on the model object.

Remember that the import cannot be completed if error messages occur in the log.

9. Choose Finish to close the Assistant and thus initiate the model generation

Former Member
0 Kudos

Hi Rajeshkelam,

I think the following tutorial will be helpful for you.

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#20">Using Javabean Model</a>

This one uses a Java Bean Model for EJBs.

Hope it helps.

Regards,

Alka.

Former Member
0 Kudos

Hi Rajesh,

This is a simple work around I am suggesting:

1) Create External Library DC.

2) Add the jar under libraries folder in the DC.

3) Expose this jar as public part.While exposing select "Can be packaged in other build result (e.g. SDA)"

4)Define a dependency of the WD DC on this DC.

5)Then try to import.

Check out this Link

http://help.sap.com/saphelp_nw04/helpdata/en/c3/321b410210ef6fe10000000a1550b0/frameset.htm

Hope that is helpful

regards

Anil

Message was edited by:

Armin Reichert