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

Replace Table Control with ALV Grid Control using Classes

Former Member
0 Likes
1,358

I am trying to evaluate if the ALV Grid control can be used as a replacement for the normal table control in dynpro programmming. I am trying to understand

1) Can this in theory be done

2) Is there any downside to such kind of a replacement.

My curiosity stems from the fact that even the ALV Grid control has events which can be used for data validation. However can these completely replace the classic LOOP at TABLECONTROL technique.

Suggestions appreciated.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,002

Hello Amit

Of course it is possible to replace a table control with an ALV grid.

Last year I worked in a project where actually used this replacement: the client wanted to add his specific data to the material master data (displayed in a subscreen) and, at the same time, these data should be maintainable in a separate report (for mass-maintenance).

I used the ALV grid approach for two reasons:

(1) I cannot program table controls anymore because it is such an old-fashioned programming technique

(2) I did not want to two different solutions, but a single solution that could be used in both situations (material master data and mass-maintenance report).

Only the ALV grid approach allows such solutions because the container instance holding the Grid instance can be linked (using the container method LINK) to any dynpro. In my case I linked the ALV grid either to the subscreen in the material master data or to the dynpro in the mass-maintenance report.

Furthermore, as soon as the customer realized the potential of the ALV grid solution (which they had seen for the first time in material master data) they generated lots of additional requirements (particularly for validating data) which hardly could be realized using classical table controls.

Thus, my recommendation is: whenever you have the choice between a table control and an ALV grid choose the grid because its flexibility is much higher and new requirements can be implemented much easier and faster.

Regards

Uwe

6 REPLIES 6
Read only

abdul_hakim
Active Contributor
0 Likes
1,002

hi amit,

welcome to SDN.

The Concept of Table Control and ALV Grid are entirely different.so you cannot replace one with the other..

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
1,002

Hi Amit,

Yes we can replace Table control with ALV in Dynpro/Module pool programming.

The advantage of Table control is that you can directly link Database tables to table control using Loop..Endloop.

But in case of ALV, you need to create Field catalog and assign it. Also you need to create a container on the screen for ALV.

So the answers are :

1. Yes, in theory it can be done.

2. No downside as such. Infact ALV provides lots of features ( Auto sorting/ Summations -- ALV toolbar ) which table control doesnt provide.

I have done the same in one of our project, because Business Users wanted all the features provided by ALV in module pool program.

Best regards,

Prashant

PS : Please reward all helpful answers

Read only

0 Likes
1,002

Thank you Prashant,

Can you kindly send me a code example for this.

Would appreciate the same.

My email id is amit-kumar.behera@atosorigin.com

Read only

anversha_s
Active Contributor
0 Likes
1,002

hi amit,

I am with ALV in thi matter.

we can do anythin in ALV, as like a table control.

Kindly go to se38- > give BCALV_ and press f4.

u can c a lot of class programs.

if we go thru this programs carefully, we can c that we can do anything with ALV.

rgds

anver

if helped mark points

Read only

Former Member
0 Likes
1,002

Hi Amit,

ALV can be created using containers in the DynPros.

Just go through these documents and you will get good idea about working with ALV using OOPS.

http://esnips.com/doc/b708766f-a934-42a1-8064-c4de75b48fc4/Sample-Program-of-alv-using-oops.ppt

http://esnips.com/doc/a2e42503-cf0f-4418-94ee-580f5900a81f/alv-with-oop.doc

http://esnips.com/doc/2d953590-e8c5-490c-a607-d1ab7cf517d7/ALV.pdf

<b>Award points if found useful.</b>

Regards,

SP.

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,003

Hello Amit

Of course it is possible to replace a table control with an ALV grid.

Last year I worked in a project where actually used this replacement: the client wanted to add his specific data to the material master data (displayed in a subscreen) and, at the same time, these data should be maintainable in a separate report (for mass-maintenance).

I used the ALV grid approach for two reasons:

(1) I cannot program table controls anymore because it is such an old-fashioned programming technique

(2) I did not want to two different solutions, but a single solution that could be used in both situations (material master data and mass-maintenance report).

Only the ALV grid approach allows such solutions because the container instance holding the Grid instance can be linked (using the container method LINK) to any dynpro. In my case I linked the ALV grid either to the subscreen in the material master data or to the dynpro in the mass-maintenance report.

Furthermore, as soon as the customer realized the potential of the ALV grid solution (which they had seen for the first time in material master data) they generated lots of additional requirements (particularly for validating data) which hardly could be realized using classical table controls.

Thus, my recommendation is: whenever you have the choice between a table control and an ALV grid choose the grid because its flexibility is much higher and new requirements can be implemented much easier and faster.

Regards

Uwe