‎2014 Jan 10 11:50 AM
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
‎2014 Jan 10 12:00 PM
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
‎2014 Jan 10 12:44 PM
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
‎2014 Jan 10 12:03 PM
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
‎2014 Jan 10 12:23 PM
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...).