Application Development 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: 

Splitter Container

Former Member
0 Kudos
1,944

Hi All,

Is it possible to have a splitter container using CL_SALV ?

If yes please explain the steps how to go about making the splitter container using this class.

Regards,

Darpana.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
266

Hi,

I have understood what Uwe and Pratik have said.

I will have to pass the parameter accordingly to the CL_SALV_TABLE.

But the problem is that i do not know the steps of how to go about making the splitter container also.

Regards,

Darpana

7 REPLIES 7

uwe_schieferstein
Active Contributor
0 Kudos
266

Hello Darpana

It is not the splitter container which uses the class but on the contrary the class which uses the container instances of the splitter container.

Method CL_SALV_TABLE=>FACTORY has an optional IMPORTING parameter R_CONTAINER.

If you fetch the container instances of your splitter container and provide them when calling method FACTORY then I believe it should work the same way like for class CL_GUI_ALV_GRID.

Regards

Uwe

Former Member
0 Kudos
266

Hi Darpana,

As Uwe said container is not depended on class. You can obviously use container with cl_salv_table class.

It is one of the optional parameters for that class.

Go to Patterns -> choose radiobutton ABAP Object Patterns -> Ok -> (Now you will see different patterns for ABAP Objects) -> choose radio button Call method -> enter Class/Interface : CL_SALV_TABLE -> Method :FACTORY.

Now you will see container as a optional exporting parameter of a class.

Hope it clear your doubts.

Just let me know if you are having any more queries.

Regards,

Pratik Vora

Former Member
0 Kudos
267

Hi,

I have understood what Uwe and Pratik have said.

I will have to pass the parameter accordingly to the CL_SALV_TABLE.

But the problem is that i do not know the steps of how to go about making the splitter container also.

Regards,

Darpana

0 Kudos
266

Hi darpana,

Go through follwing.

Create a screen.

Make Custom Control area on the screen.

Now in screen PBO call method wtih cotainer as explained.

Setting Up Display Type in a Simple, Two-Dimensional Table

In the CL_SALV_TABLE class, the FACTORY method gets the following parameters that are relevant for the display type:

·        LIST_DISPLAY

·        R_CONTAINER

·        CONTAINER_NAME

You determine how the table is displayed with a combination of these parameters.

Parameter Settings for the Display Type

Display type                                 In the Container
 LIST_DISPLAY                            ABAP_FALSE
 R_CONTAINER                            Reference to container; type CL_GUI_CONTAINER
 CONTAINER_NAME                    Name of the container

Hope it helps you,

Kindly inform if more inputs required.

Regards,

Pratik Vora

0 Kudos
266

Hi Darpana,


data: g_custom_container TYPE REF TO cl_gui_custom_container, "custom container
        g_splitter_container TYPE REF TO cl_gui_splitter_container,       "splitter container
        g_top_container TYPE REF TO cl_gui_container,        "top container
        g_bottom_container TYPE REF TO cl_gui_container,   "bottom one
        g_slav_table TYPE REF TO cl_salv_table.


 "create custom container placed in CUSTOM AREA defined on screen
    CREATE OBJECT g_custom_container
      EXPORTING
        container_name              = 'CUSTOM_AREA'
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    "now split the container into two independent containers
    CREATE OBJECT g_splitter_container
      EXPORTING
         parent            = g_custom_container
         rows              = 2   
         columns           = 1
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    "get top container 
    CALL METHOD g_splitter_container->get_container
      EXPORTING
        row       = 1
        column    = 1
      RECEIVING
        container = g_top_container.

    "get bottom container for ALV grid
    CALL METHOD g_splitter_container->get_container
      EXPORTING
        row       = 2
        column    = 1
      RECEIVING
        container = g_bottom_container.

    "create alv control instance placing it on the top container
    TRY.
      CALL METHOD cl_salv_table=>factory
       EXPORTING
          r_container    = g_top_container
      IMPORTING
          r_salv_table   = g_slav_table
     CHANGING
         t_table           =  "your_table_here
    .
    CATCH cx_salv_msg .
   ENDTRY.

"here you can use bottom container to place some ohter GUI control
...

Regards

Marcin

Former Member
0 Kudos
266

Thanks so much.

I got the answer myself on what steps to follow to make the container splitter container.

Regards,

Darpana.

uwe_schieferstein
Active Contributor
0 Kudos
266

Hello Darpana

You may have a look at sample report ZUS_SDN_TWO_ALV_GRIDS in thread

in order to see how to work with splitter containers.

Regards

Uwe