cancel
Showing results for 
Search instead for 
Did you mean: 

DB statements in button actions in view

Former Member
0 Kudos

can i write the code of select, update etc statements in BUTTON Ui element in a View.

is it mandatory to write the code using Classbuilder(SE24)(OO ABAP) in WD4A.

just a simple question, i am new to WDABAP.

clarify me.

thanks n reagrds

rk

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I would agree with Shaira, Technically , you can write your SQL statement in wda methods but It is better practice to have your Business logic ,data extraction abstracted from Presentation layer .

Former Member
0 Kudos

@shaira and bhaskaran....

ok, thanks for ur reply..

my question is, in the realtime how u people develop the components in WDA.

whether using Classes(methods) or in button actions (for select statements).

Former Member
0 Kudos

Hi Ramakrishna,

WD is based on MVC architecture... It tells seperation of Presentation and Bussiness Logic. If you follow this you need to seperate business logic.

That depends on project, and Client, You can write Select statements in methods also, but Recomendable is Follow MVC.

Check this about MVC..

http://wiki.sdn.sap.com/wiki/display/WDABAP/ArchitectureofWebdynproforABAP

Cheers,

Kris.

Edited by: kissnas on Apr 19, 2011 6:52 AM

Former Member
0 Kudos

We use classes and function modules, we do not code database handling in the Webdynpro.

Former Member
0 Kudos

@all

thanks for ur reply....

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ram ,

As per Web Dynpro architecture, We should not do any DB related things(Select,Insert,Update and Delete...etc...) within Web Dynpro Compoent and Views. We should use Function modules or Class methods for accessing DB.

Thanks and Regards,

Vijay

former_member389677
Active Participant
0 Kudos

Hi,

There is no problem in writing the select / update statement in the click event for BUTTON Ui element in a View.

We are going for OOPs concept to make code reusable and more structured .

Regards

Shaira

former_member450736
Active Participant
0 Kudos

Hi Shaira,

i agree with you there will not be any change even if we write select statements in view methods anyways it is not suggested by architecture, however one of my collegue told me that performance will be degraded if we write database specific statemnts in view methods:

every controller or for that matter view controller will have separate memory to hold temporay objects at runtime, so if we write selects in the view methods this temporary data will occupy most of the memory of this controller, so it degrades rendering of view etc., i am not sure of this...

may be correct or may be not!!!

Former Member
0 Kudos

@all

but some persons asked me, without having the knowledge on OOPs how u develop the components in WDA. those componnets are of MVC architecture. For a stable WDA component u should write the Business logic in Classes and methods..

they told me like that...

but i know only through view button actions..

finally i concluded that, we can follow both the ways based on the req..

to follow MVC we should write the Business logic in Classes...

thanks for ur answers...

regards

rk