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: 

CL_ALV_GUI_GRID with 3 columns

Former Member
0 Kudos

Hi Experts, I have requirement to create 3 container ALV on single screen.

In which 2 columns are autofilled, and 3 column will be filled on User command.

On selecting entries when user press execute button then data needs to be filled in the 3 column of ALV container.

I did the coding, but failed to get data in column 3 on execute.

I think the problem is with container of column 3.

because system not able to identify in which column data needs to be show.

because column 2 and column 3 right.

NOTE : Column 1 is divided into 2 rows;

Code is as follows;

* Create docking container

   CREATE OBJECT go_docking

     EXPORTING

       parent = cl_gui_container=>screen0

       ratio  = 90

     EXCEPTIONS

       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.

* Create splitter container

   CREATE OBJECT go_splitter

     EXPORTING

       parent            = go_docking

       rows              = 1

       columns           = 3

*      NO_AUTODEF_PROGID_DYNNR =

*      NAME              =

     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 cell container

   CALL METHOD go_splitter->get_container

     EXPORTING

       row       = 1

       column    = 1

     RECEIVING

       container = go_cell_left.

   CALL METHOD go_splitter->get_container

     EXPORTING

       row       = 1

       column    = 2

     RECEIVING

       container = go_cell_right.

   CALL METHOD go_splitter->get_container

     EXPORTING

       row       = 1

       column    = 3

     RECEIVING

       container = go_cell_right2.

* Create 2nd splitter container

   CREATE OBJECT go_splitter_2

     EXPORTING

       parent            = go_cell_left

       rows              = 2

       columns           = 1

*      NO_AUTODEF_PROGID_DYNNR =

*      NAME              =

     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 cell container

   CALL METHOD go_splitter_2->get_container

     EXPORTING

       row       = 1

       column    = 1

     RECEIVING

       container = go_cell_top.

   CALL METHOD go_splitter_2->get_container

     EXPORTING

       row       = 2

       column    = 1

     RECEIVING

       container = go_cell_bottom.

* Create ALV grids

   CREATE OBJECT go_grid1

     EXPORTING

       i_parent = go_cell_top

     EXCEPTIONS

       OTHERS   = 5.

   IF sy-subrc <> 0.

*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

   CREATE OBJECT go_grid2

     EXPORTING

       i_parent = go_cell_bottom

     EXCEPTIONS

       OTHERS   = 5.

   IF sy-subrc <> 0.

*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

   CREATE OBJECT go_grid3

     EXPORTING

       i_parent = go_cell_right

     EXCEPTIONS

       OTHERS   = 5.

   IF sy-subrc <> 0.

*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

* Display data

   CREATE OBJECT go_grid4

     EXPORTING

       i_parent      = go_cell_right2

     EXCEPTIONS

       OTHERS        = 5.

   IF sy-subrc <> 0.

*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.



-Regards

Rohit

1 REPLY 1

Former Member
0 Kudos

Closing the thread. Corrected the issue.