Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Suggestion on object oriented design pattern

Former Member
0 Likes
728

Hi All,

I am trying to write a report using Object oriented paradigm but not sure on how to lay the design for it.

Its a report which extracts  data from 15 tables and displays in the form of ALV and also one can download it in the share path.

Now I had thought of creating a local class with methods :  get _data , display_data , and download_data.

Can someone suggest me a better design other than this??

thanks

Faiz


4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
694

I think OO design patterns are overkill for this simple "read data" and "display result as ALV" sort of task.

Also see the recent discussion here:

Looks like the "traditional way" is way sufficient here. The bigger challenge will be to effectively read and combine data from 15 tables. Use joins as much as possible.

Downloading is built-in ALV functionality, you don't need to code this again.

Thomas

Read only

0 Likes
694

I Agree with Thomas.

But if you really wanted to code the report according to some architecture while utilizing OO, I would suggest you have a look at the MVC design/architecture concept that WDA uses.

Have a look at:

Architecture of Webdynpro for ABAP - Web Dynpro ABAP - SCN Wiki

Harry

Read only

former_member183069
Active Participant
0 Likes
694

Hi Faiz,

For report this pattern is enough ,

Just create the class with the above method in addition to that add the "process_data"  method  for processing the records,


follow the following order:

Create the instance and then

Call the method "get_data" inside the start of selection and end of selection.

Call the the method "process_data" after end of selection and call the method display_data after that.

Based on sy-ucomm call the method download data.

Also try to use SALV.

Regards,

KK

Read only

0 Likes
694

There is no need to specify END-OF-SELECTION unless you use logical database (which is not common...). F1 for more details

To topic: there could be used "factory" (EDIT sorry, was not meant to be "factory", but something like MVC, but it is overkill yes) design to output data in different ways (ALV, frontend CSV, e-mail...).

-- Tomas --