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: 

OO ALV Popup

Former Member
0 Kudos

Hi all,

There is an FM REUSE_ALV_POPUP_TO_SELECT.

Is there a similar functionality in OO ALV. But I just want to display the contents.

Thank you in advance.

6 REPLIES 6

Former Member
0 Kudos

Hi,

Yes you can do that, instead of using a custom container while developing a ALV report, use a DIALOG CONTAINER and the rest of the process is same.

/people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls-control-layouts--part-ii

This weblog shows how to use the Custom container, just replace that with a DIALOG container.

CL_GUI_DIALOGBOX_CONTAINER is the class you will have to use instead of CL_GUI_CUSTOM_CONTAINER

Regards,

Ravi

Note : Please mark the helpful answers.

Message was edited by: Ravikumar Allampallam

Former Member
0 Kudos

*Create object reference

DATA:

o_alvgrid TYPE REF TO cl_gui_alv_grid,

o_custcntr TYPE REF TO cl_gui_custom_container.

  • Object of the Container

CREATE OBJECT o_custcntr

EXPORTING

container_name = lc_custcntr_sum '( Name of the container on the screen )

.

  • Creating ALV Grid instance

CREATE OBJECT o_alvgrid

EXPORTING

i_parent = o_custcntr

  • Use the following method of the objcet

CALL METHOD o_alvgrid->set_table_for_first_display

EXPORTING

i_bypassing_buffer = space

i_save = 'A'

is_layout = layout_structure

CHANGING

it_outtab = lit_data_table

it_fieldcatalog = lit_fieldcatlog_table

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Hope this will help you

Message was edited by: Manoj Gupta

former_member188685
Active Contributor
0 Kudos

Hi ,

Did you check this example <b>BCALV_EDIT_01</b>

this is the example will show the report in popup.

just check it.

Regards

Vijay

former_member188685
Active Contributor
0 Kudos

Hi,

BCALV_EDIT_01 in OO and the output is in the popup, the same logic you can use it for your purpose. check that example.

you can do the same logic.

Regards

Vijay

0 Kudos

... just one difference to be taken into account:

A traditional popup screen will freeze the program where it is initiated, you must leave (close) the popup befor you can continue.

An OO dialog box is an independent object and the interaction with the calling program must be established using events.

The advantage is, that you can scale the size of the dialog box using the mouse, this never works with screen popups.

The program does not freeze; you can even create another dialog box without closing the existing one(s).

Just for display it works great: use the edit control in a dialog box in display mode, you can even search, select, copy (to clipboard) or download the contents. I used that function to display (AL11-like) file contents, i.e. compare two files by displaying and dragging them side-by side...

But: The calling program will not wait.

regards,

Clemens

Former Member
0 Kudos

* Hi, hier ist eine andere alternative ALV popup OO kein fieldcatlog nee conteiner.

DATA: BEGIN OF wa_t001,

   bukrs LIKE t001-bukrs,

   butxt LIKE t001-butxt,

   waers LIKE t001-waers,

   ktopl LIKE t001-ktopl,

END OF wa_t001.

DATA: t_t001 LIKE STANDARD TABLE OF wa_t001.

*----------------------------------------------------------------------*

*       CLASS CL_EVENT_HANDLER DEFINITION

*----------------------------------------------------------------------*

CLASS cl_event_handler DEFINITION.

   PUBLIC SECTION.

     CLASS-DATA:

       lo_alv_object TYPE REF TO cl_salv_table.

     CLASS-METHODS on_function_click

       FOR EVENT if_salv_events_functions~added_function

         OF cl_salv_events_table IMPORTING e_salv_function.

ENDCLASS.                    "cl_event_handler DEFINITION

*----------------------------------------------------------------------*

*       CLASS CL_EVENT_HANDLER IMPLEMENTATION

*----------------------------------------------------------------------*

CLASS cl_event_handler IMPLEMENTATION.

   METHOD on_function_click.

     CASE e_salv_function.

       WHEN 'GOON'.

         lo_alv_object->close_screen( ).

*       do action

       WHEN 'ABR'.

         lo_alv_object->close_screen( ).

*       cancel

     ENDCASE.

   ENDMETHOD.                    "on_function_click

ENDCLASS.                    "cl_event_handler IMPLEMENTATION

*--------------------------------------------------------------------*

* START-OF-SELECTION.

*--------------------------------------------------------------------*

START-OF-SELECTION.

   DATA: lo_columns    TYPE REF TO cl_salv_columns_table,

         lo_column     TYPE REF TO cl_salv_column,

         lo_alv_object TYPE REF TO cl_salv_table,

         lo_functions  TYPE REF TO cl_salv_functions,

         lo_events     TYPE REF TO cl_salv_events_table.

* Llenar Tabla Interna de Ejemplo con Sociedades

   SELECT bukrs butxt waers ktopl INTO TABLE t_t001

     FROM t001

     WHERE land1 = 'CL'

     ORDER BY bukrs.

   TRY.

       CALL METHOD cl_salv_table=>factory

         IMPORTING

           r_salv_table = lo_alv_object

         CHANGING

           t_table      = t_t001.

* Asignar Eventos

       lo_events = lo_alv_object->get_event( ).

       SET HANDLER cl_event_handler=>on_function_click FOR lo_events.

* Guardar Regerencia de acceso al objeto

       cl_event_handler=>lo_alv_object = lo_alv_object.

* Usar status gui ST850 del programa SAPLKKB

       lo_alv_object->set_screen_status( pfstatus = 'ST850'

                                         report   = 'SAPLKKBL' ).

* Dimenciones Popup

       lo_alv_object->set_screen_popup( start_column = 25    " Columna de Inicio

                                        end_column   = 90    " Ancho Ventana

                                        start_line   = 5     " Fila de Inicio

                                        end_line     = 10 ). " Largo Ventana

       lo_columns = lo_alv_object->get_columns( ).

       lo_columns->set_optimize( 'X' ).

* Visualizar ALV

       lo_alv_object->display( ).

     CATCH cx_salv_msg.

       MESSAGE 'Error: ALV exception CX_SALV_MSG' TYPE 'I'.

     CATCH cx_root.

       MESSAGE 'Error: ALV exception desconosida' TYPE 'I'.

   ENDTRY.