Skip to Content

A proposal to improvement for EJB Model Web Dynpro

When using the NWDS CE, we can create a model for Web Dynpro based on Enterprise Java Bean, this is very good for developers that access services using EJB instead only RFC Models.

I’m using Web Dynpro to develop many GUI for EJB backend, I’ll explain the situation that has conduced my proposal.

For this scenario an Entity (Foo)  and a Session Bean (FooService) will be used:

Foo (Entity)


 FooServiceBean (SessionBean)

After, the import of EJB Model can be done on Web Dynpro. After import of Model we have the model like bellow image:



Suppose we have some requirements to Web Dynpro UI like: beginDate (dd/MM/yyyy), name(len=30 and UPPERCASE)  to do it, we need to create two new types, FooDate and FooName on dictionary with the specified requirements. After create the types, just associate it with the model Foo object.



Now, the Web Dynpro UI will get the definitions to render the components.
But try to modify the model and do a reimport of EJB Model, we will see that model will be recreated, and the definitions will lost.
I will change the Foo entity including a new property. After reimport the model will apppear like bellow.


So we need to set the type again, it is a inconvenient and a source of errors on delivery of application, the developer can forget of set the types and it can cause UI appears like no desired.

My proposal is that specific Annotations for Dictionary type were created and used like pseudo code bellow:


On the pseudo code, we can see the annotation SapDict, so when the import or reimport model occurs the type can be created/setted based on attribute annotation.

Pros: The large development with EJB and Web Dynpro can be more productive.

Cons: With this solution the POJO will be annotated with SAP specific, so the dependency must be considered to deploy EJBs on other server.

You must be Logged on to comment or reply to a post.
  • Hi Isaias Cristiano Barroso

    Could you explain hw did you managed to edit the imported Model? Web Dynpro CMI Models are immutable entities and are not supposed to be edited.

    • Hi Dhawal Josh,

      I think are you asking about to edit the Types of EJB Model Object, right? Example, Changes type of name property to FooName type as showed on sample. If yes it is possible directly on Model Object, it is muttable, but just it.
      This change was done directly by properties model on Developer Studio and saved normally.

      If I misunderstood your question, let me know.

      Best regards