Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Container ALV not working in background

Hi all,

I created an ALV grid, which runs fine foreground. In the background however the spool is created but cancelled.

REATE OBJECT g_custom_container

EXPORTING

container_name = 'G_CUSTOM_CONTAINER'

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.

  • Error in custom container instantiation. ALV cannot be displayed

MESSAGE e000 WITH text-015.

ENDIF.

CREATE OBJECT g_dyndoc_id

EXPORTING

style = 'ALV_GRID'.

  • Create a splitter and split the container for

  • the two parts of ALV contents

CREATE OBJECT g_splitter

EXPORTING

parent = g_custom_container

rows = 2

columns = 1.

  • Get container for top half of the report

CALL METHOD g_splitter->get_container

EXPORTING

row = 1

column = 1

RECEIVING

container = g_container_top.

  • Set the height of container for top half of the report

CALL METHOD g_splitter->set_row_height

EXPORTING

id = 1

height = 20.

  • Get Container for bottom half of the report

CALL METHOD g_splitter->get_container

EXPORTING

row = 2

column = 1

RECEIVING

container = g_container_grid.

  • Instantiate ALV grid main report

CREATE OBJECT g_grid

EXPORTING

i_parent = g_container_grid

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

OTHERS = 5.

IF sy-subrc <> 0.

  • Error in grid instantiation. ALV caanot be displayed

MESSAGE e000 WITH text-016.

ENDIF.

  • Build field catalogue

PERFORM build_field_cat.

  • Inatntiate Top-of-Page event

CREATE OBJECT g_events.

SET HANDLER g_events->handle_top_of_page FOR g_grid.

    • IF it_comparednomatch[] IS INITIAL.

    • MESSAGE s000 with text-003.

    • EXIT.

    • ELSE.

  • Print ALV Contents of first half of report

g_grid->set_table_for_first_display( EXPORTING i_default = 'X'

CHANGING it_outtab = it_comparednomatch

it_fieldcatalog = it_fldctdrl

EXCEPTIONS invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4 ).

IF sy-subrc <> 0.

  • Error in displaying ALV

MESSAGE e000 WITH text-017.

ENDIF.

  • ENDIF.

ENDIF.

      • Call top-Of-Page

CALL METHOD g_grid->list_processing_events

EXPORTING

i_event_name = 'TOP_OF_PAGE'

i_dyndoc_id = g_dyndoc_id.

Please help me out.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question