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

Blank screen while displaying alv report

Former Member
0 Likes
2,910

I am displaying a alv with 3 fields..Below is my code...The problem is while displaying the result, blank screen is opening up without any data even though all the internal tables are filled.

MODULE status_0101 OUTPUT.

SET PF-STATUS 'MAIN100'.

SET TITLEBAR 'xxx'.

p_repid = sy-repid.

  • §1.Create one ALV Control that shows the first table.

if custom_container is initial.

  • * create a custom container control for our ALV Control

create object custom_container

exporting

container_name = cont_on_dialog1

exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

if sy-subrc ne 0.

  • add your handling, for example

call function 'POPUP_TO_INFORM'

exporting

titel = p_repid

txt2 = sy-subrc

txt1 = 'The control could not be created'(510).

endif.

create object grid1

exporting i_parent = custom_container.

*

  • Set a titlebar for the grid control

*

it_alv_pictures[] = int_zbe_screenshots[].

gs_layout-grid_title = 'dialog'(100).

call method grid1->set_table_for_first_display

exporting i_structure_name = 'ZBE_ALV_PICTURES'

is_layout = gs_layout

changing it_outtab = it_alv_pictures.

endif. "IF custom_container IS INITIAL

call method cl_gui_control=>set_focus exporting control = grid1.

5 REPLIES 5
Read only

Former Member
0 Likes
1,400

Hi Priya,

You have created the object for the custom container.

you also need to create the object for the class CL_GUI_ALV_GRID

which is missing.

regards

Ramchander Rao.K

Read only

agnihotro_sinha2
Active Contributor
0 Likes
1,400

* Link container name from screen to container object.
    CREATE OBJECT gv_alv_cont
      EXPORTING
        container_name = 'CC_ALV'.
* Create ALV object
    CREATE OBJECT gv_alv_grid
      EXPORTING
        i_parent = gv_alv_cont.

*Display ALV grid object calling method.
    CALL METHOD gv_alv_grid->set_table_for_first_display
      EXPORTING
        is_layout                     = gwa_layout
        i_save                        = 'A'
        is_variant                    = gwa_variant
      CHANGING
        it_outtab                     = gi_final
        it_fieldcatalog               = gi_fcat
      EXCEPTIONS
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        OTHERS                        = 4.

    IF sy-subrc <> 0 .
      MESSAGE e000(zmm) WITH text-026.
    ENDIF.
  ELSE.
*** Refresh ALV object before next display
    CALL METHOD gv_alv_grid->refresh_table_display
      EXPORTING
        is_stable = gc_stable.
  ENDIF.        "lv_algv_cont IS INITIAL
Read only

Former Member
0 Likes
1,400

Hi,

You are not passing ur field catalog.

See this,

CALL METHOD o_alvgrid->set_table_for_first_display

EXPORTING

i_save = c_a

is_layout = p_wa_layout

CHANGING

it_outtab = p_i_final[]

it_fieldcatalog = p_i_fieldcat[]................field catalog

it_sort = p_i_sort[]

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Regards,

Kusuma.

Read only

0 Likes
1,400

How can I make fieldcat in this?

Read only

0 Likes
1,400

You have created the object for the custom container. Missing Points are

1. You also need to create the object for the class CL_GUI_ALV_GRID

2. You are not passing field catalog.

3. Make a Custom control block on Screen 0101 with screen name "<CC_ALV>".