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

OOP ALV in SUBSCREEN

0 Likes
3,622

Dear all,

I want to display oop alv inside a sub screen.

So i have created a main screen and add button to display alv in a sub screen.

In the main screen there is a sub screen area. when user click on button in main screen I'm calling sub screen inside the PBO of main screen

call sub screen sub1 including sy-repid ssnum.

Then inside the PBO of sub screen , I have created a custom container and alv grid..

But its not displaying in the sub screen.. what could be the issue?

Thank you,

Pathum.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,877

This is the logic that has to be used for inserting an ALV in subscreen. Subscreen has to be defined in the PBO of main screen.

Lets say sub screen number is 200.

"--------------------------------------

"Declarations

data: g_custom_container type ref to cl_gui_custom_container,

        g_alv_grid_ref type ref to cl_gui_alv_grid.

"--------------------------------------

"Main screen

"call subscreen in PBO of main screen

PROCESS BEFORE OUTPUT.

  CALL SUBSCREEN sub_area    INCLUDING sy-repid '0200'.

PROCESS AFTER INPUT.

  CALL SUBSCREEN sub_area.

"--------------------------------------

"Subscreen

PROCESS BEFORE OUTPUT.

MODULE PBO_0200.

if g_custom_container is initial.

   "create custom container

   CREATE OBJECT g_custom_container

      EXPORTING

container_name              = 'CUSTOM_AREA'   "name of container name on screen layout (must be set in SUBSCREEN, not in MAIN SCREEN)

     CREATE OBJECT g_alv_grid_ref

         EXPORTING

i_parent          =  g_custom_container.

      CALL METHOD g_alv_grid_ref->set_table_for_first_display

            ....

else.

    CALL METHOD g_alv_grid_ref->refresh_table_display.

endif.

ENDMODULE.

Dear all,

I want to display oop alv inside a sub screen.

So i have created a main screen and add button to display alv in a sub screen.

In the main screen there is a sub screen area. when user click on button in main screen I'm calling sub screen inside the PBO of main screen

call sub screen sub1 including sy-repid ssnum.

Then inside the PBO of sub screen , I have created a custom container and alv grid..

But its not displaying in the sub screen.. what could be the issue?

Thank you,

Pathum.

1 REPLY 1
Read only

Former Member
0 Likes
1,878

This is the logic that has to be used for inserting an ALV in subscreen. Subscreen has to be defined in the PBO of main screen.

Lets say sub screen number is 200.

"--------------------------------------

"Declarations

data: g_custom_container type ref to cl_gui_custom_container,

        g_alv_grid_ref type ref to cl_gui_alv_grid.

"--------------------------------------

"Main screen

"call subscreen in PBO of main screen

PROCESS BEFORE OUTPUT.

  CALL SUBSCREEN sub_area    INCLUDING sy-repid '0200'.

PROCESS AFTER INPUT.

  CALL SUBSCREEN sub_area.

"--------------------------------------

"Subscreen

PROCESS BEFORE OUTPUT.

MODULE PBO_0200.

if g_custom_container is initial.

   "create custom container

   CREATE OBJECT g_custom_container

      EXPORTING

container_name              = 'CUSTOM_AREA'   "name of container name on screen layout (must be set in SUBSCREEN, not in MAIN SCREEN)

     CREATE OBJECT g_alv_grid_ref

         EXPORTING

i_parent          =  g_custom_container.

      CALL METHOD g_alv_grid_ref->set_table_for_first_display

            ....

else.

    CALL METHOD g_alv_grid_ref->refresh_table_display.

endif.

ENDMODULE.