cancel
Showing results for 
Search instead for 
Did you mean: 

Code Inspector error of DB_SELECT

Former Member
0 Kudos

hello,

when i am running code Inspector of my dynpro Apllication, i am getting error of DB_delect

Information for that error as follows :

Definition

Within Web Dynpros, the data model must be strictly separated from the display logic. For this reason, you must avoid accessing database tables directly.

Use

This checks Web Dynpro code for the following statements.

IMPORT FROM/ EXPORT TO (DB)

SELECT FROM (DB)

UPDATE/MODIFY/DELETE (DB)

EXEC SQL

Solution

The corresponding statements must be encased in a functional unit (model).

How to

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Absolutely!

Although WD does not enforce MVC, it is still a good idea to do it. And direct DB access within the view/controller code is definately not MVC!

Put your SQL code in a method of the assistance class of the controller - then access it by calling the assistance class from your view/controller.

- Chris

Former Member
0 Kudos

how to create assistance class and how to call .

Can you please explain as i have not too knowledge of webdynpro

Former Member
0 Kudos

You can create a Assistance class from se24 by giving CL_WD_COMPONENT_ASSISTANCE as superclass. Once you create an assistance class you should click on WD object name in SE80 and give the assistance class name in class tab , it will create wd_assist in your controller and you can use the methods of the assistance class in your WD component by giving

WD_assist->method name.

Hope it helps you

ChrisPaine
Active Contributor
0 Kudos

Click on your component - type in a class name (starts with Z has some other characters) - this will generate the class including the required superclass.

Alternatively - search this forum for advise - there are lots of posts about this, look at some of the excellent tutorials.

Posting a question should not be your first reaction - no matter how experienced or new you are.

- Chris

Former Member
0 Kudos

I created assitance class for the same but when i am calling the method in a view i am getting error

zget is unknown or protected or private why ?

call method wd_assist->zget

importing

lt_type = lt_type.

ChrisPaine
Active Contributor
0 Kudos

Mark your method as public.

Answers (0)