This website is not affiliated with, sponsored by, or approved by SAP AG.

4.6c ALV OO vs Function

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

4.6c ALV OO vs Function

Postby claprise » Wed Sep 24, 2003 3:18 pm

Bonjour!

I'm trying to get my client to use ALV as the standard for its reports. I'm creating a template and now I'm in a dilema. Should I use functions or should I use OO?

What I was told so far was that it was easier to code with functions. This is not really a criteria for me as I assume that once you have the hang of it, it should be almost as easy.

So here are my questions:
1. Pros and cons
a) is there some situation I should use one vs the other?
2. Is there some stuff I can do with one, I can't do with the other
3. Is there one solution that
a) Is more memory consuming?
b) Is more cpu intensive?
Au plaisir and have a nice day!
claprise
 
Posts: 73
Joined: Wed Oct 23, 2002 9:53 am
Location: Quebec, Canada

Postby sgabaper » Wed Sep 24, 2003 8:27 pm

I could find couple of advantages of using OO comapred to the FM.

If you are using a screen and if you want to embed the ALV to the screen, the you can embed the ALV to a custom container while instantiating the ALV object using the OO.

Also, you can have more than one ALV in the same screen (basically you can create more than 1 instance of the same class and embed to differenct containers) and display different data.

Though I havent tried it by myself (I have tried the first one, embedding the ALV to a custom container), with the OO concept this is possible.
Cheers!
Sgabaper
sgabaper
 
Posts: 120
Joined: Sun Oct 20, 2002 11:42 pm
Location: Singapore

Postby RosieBrent » Thu Sep 25, 2003 3:19 am

I'll counter it with a disadvantage of OO approach...(although everyone here knows I am not an ALV expert!)

In some cases (where there is GUI Control communication) your ALV won't run in background mode. With the FM's this is not an issue.

Of course you can get round this limitation by checking the SY-BATCH field before processing and educating your users (so it's not a show-stopper), but it is something to be aware of.
Kind Regards

Rosie Brent

Please remember to search the forum and check the FAQ before posting questions, thank you.

Tuly Idiot most of the time, part-time Guru Image
RosieBrent
 
Posts: 6197
Joined: Mon Oct 21, 2002 3:04 am
Location: Darlington

Postby claprise » Tue Sep 30, 2003 5:12 pm

Bonjour!

Thanks. My conclusion are the following:

I will use functions for 'normal' report as it eliminates the need to create a window and it works in background.

I will look into OO when more flexibility is needed, this however should not be 'the norm' ... :-)

If someone reads this and can tell me there is a fullproof way to get OO ALV work in the background, I will reconsidere ...
Au plaisir and have a nice day!
claprise
 
Posts: 73
Joined: Wed Oct 23, 2002 9:53 am
Location: Quebec, Canada

ALV FM versus OO

Postby Larry » Mon Oct 06, 2003 12:47 pm

My 2 cents?

OO is a lot of work for darned near the same outcome. Sure, you can embed multiple ALV reports using containers (you can also use the ALV list block to do this), but the effort required to create an OO ALV report versus a FM ALV report, to me, has been significant.

Unfortunately, SAP doesn't support the FM method of grid ALV as well as they have the OO method. There are some things that you would THINK FM ALV can do and can't, but does in the OO method, such as accepting input. And they have yet to document the OO method while the FM method has documentation to it.

ALV lists are very well built out, but look simplistic compared to the grid.

Bottom line, six of one, half dozen of the other, but OO is a lot more work to do 95% of the same thing.
Larry
 

Postby Guest » Mon Oct 06, 2003 1:13 pm

I've tried both and have ended up using the FM ALV grid. Why? Performance wise, the FM is better compared with the OO. Besides, an instructor once said that performance will always be a problem with OO.
Guest
 

Postby Guest » Tue Oct 07, 2003 2:57 am

Anonymous wrote:I've tried both and have ended up using the FM ALV grid. Why? Performance wise, the FM is better compared with the OO. Besides, an instructor once said that performance will always be a problem with OO.


I am suprised at this - OO takes considerably less data management than traditional programming techniques....Now if the instructor said that programming in OO messes with your head, well that I could believe quite easily :D
Guest
 


Return to ABAP

Who is online

Users browsing this forum: No registered users and 8 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.