Skip to Content
avatar image
Former Member

ALV with OOPS purpose of creating a screen with custom container area..

This ques is purely on implementing ALV with OOPS.

My question is:

1) In ALV with OOPS why the process of creating a screen(se51) and adding a custom container & finally passing the object refernce to 'alv_grid' and finally calling 'ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY' is introduced as this was not present in normal ALV, what is the purpose of this approach & advantages of this approach.?

2)here report pgm is created as 'executable program' (instead of Module-pool) & still we are mapping the 'Module' coding created in the screen-painter into the report pgm,Is there any specific purpose/advantage behind this ?

plz DONT post answers related to normal ALV........

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 18, 2008 at 02:28 PM

    Hello Srikar

    In none of my sample reports I use a container on the screen (e.g. ZUS_SDN_TWO_ALV_GRIDS in ).

    In contrast, I link the parent container (usually a docking container) to the target screen.

    Advantage of this approach: If you want to link you ALV list to another screen or a different custom container then just do it - by using the LINK method again.

    The major disadvantages of the fm-based ALV lists are that the ALV list is always full-screen size and you cannot move to ALV list to a different place because it is displayed using a screen of the standard function group SLVC...

    The power of using the OO-approach can be seen in thread

    where a 2nd ALV grid can be easily hidden or displayed again on the main screen. Try this using the fm-approach...

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 19, 2008 at 05:14 AM

    Hi Srikar,

    In OOPS ALV, we first define screen then we define container on screen. Container means area on screen where you'll be placing your ALV.

      CREATE OBJECT r_cont
        EXPORTING
    
          container_name              = 'CONTAINER_1'  " Container name
        EXCEPTIONS
          OTHERS                      = 6
          .
    

    Now you assign reference of container to your grid. grid defines structure of your ALV.

      CREATE OBJECT r_grid
        EXPORTING
          i_parent          = r_cont
        EXCEPTIONS
          OTHERS            = 5
          .
    

    Now you call the method set_table_for_first_display of class cl_gui_alv_grid to define fieldcatalog, internal table etc. to display ALV. The reason behind using MODULE is that screen logic is always defined in MODULES. If the user is interacting with screen then screen logic will be defined in PAI of screen.

    One more thing is that in normal ALV you don't define screen and container. That means ALV will always be displayed at system defined place, but in OOP ALV, you define container(area) to define the place for your ALV.

    The advantage which I found in OOP ALV is that it is more flexible to use.

    Regards

    Abhijeet

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 19, 2008 at 04:37 AM

    Hello Srikar,

    Why do we require screens , containers and controls ? - The answer to this is because that's how the control frame works work.

    What is control frame works and How does it work ? - You can find some tutorials and examples here:

    1. [CFW Tutorials|http://www.abaplearning.com/abap-tutorials/abap-control-frameworks]

    2. [Screens, Containers and Controls|http://www.abaplearning.com/abap-tutorials/abap-control-frameworks/12-cfw/14-abap-cfw-screen-controls]

    Now coming to advantages and disadvantages:

    As Uwe has mentioned, the OO approach is much more flexible. You could do some cool stuff like have multiple ALV's on one screen, re-size them.

    You can have an ALV, A tree control, or for that matter any other control on the same screen.

    The other advantage that I felt was: Performance. The old approach of using FMs in not very good in terms of performance.

    In the new approach, If the content of one cell in ALV is updated, then only that area is refreshed. In other words complete ALV need not be re-drawn again.

    Some other advantages: Easy to code, easy to handle events etc.

    Cheers

    Varun

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 19, 2008 at 05:21 AM

    Hello Srikar

    The new object model (e.g. CL_SALV_TABLE ) combines both approaches. Using this class you can create an ALV list and display it in fullscreen mode without defining any screen, e.g.

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded