Skip to Content
author's profile photo Former Member
Former Member

OO ALV + EASY_SPPLITER in background

Hi,

I am trying to run a spplited dynpro with two ALVs reports in background.

I have readed with attention the messages related with the topic OO ALV in background job Nov 18-19, and I have tryed to apply it to my code.

At moment I use the function module REUSE_ALV_GRID_DISPLAY

twice, one for each ALVs (this sends two spool orders), but after the reading of theses messages, I'm sure that exists a easier way to do it ...

At first, I try to do it no creating the container if I'm on-line. But the job was canceled out with error message Control Framework: Fatal error - GUI cannot be reached. I think this occurs because the sppliter needs too a screen (=frontend) for processing.

Now, I'm trying the same, but no creating the splitter. And the job isn't cancelling, but only the first ALV is sended to spool for printing.

Here is my code:

****************************************************

REPORT ZTESTSFP .

data: grid_left TYPE REF TO cl_gui_alv_grid,

grid_right TYPE REF TO cl_gui_alv_grid,

custom_container TYPE REF TO cl_gui_custom_container,

cont_on_100 TYPE scrfname VALUE 'BCALVC_TOOLBAR_D100_C1',

splitter TYPE REF TO cl_gui_easy_splitter_container,

container_left TYPE REF TO cl_gui_container,

container_right TYPE REF TO cl_gui_container,

gs_variant type disvariant,

gs_layout TYPE lvc_s_layo,

gt_fieldcatalog type LVC_T_FCAT,

gt_bkpf type table of bkpf,

gt_bseg type table of bseg.

tables bkpf.

parameters p_bukrs like bkpf-bukrs obligatory

memory id buk.

select-options s_belnr for bkpf-belnr.

start-of-selection.

select * into table gt_bkpf from bkpf

where bukrs = p_bukrs and

belnr in s_belnr.

select * into table gt_bseg from bseg

where bukrs = p_bukrs and

belnr in s_belnr.

set screen 100.

MODULE pbo_100 OUTPUT.

  • Set a titlebar for the grid control

IF custom_container is initial.

*
For background processing

IF cl_gui_alv_grid=>offline( ) IS INITIAL.

  • create a container for the splitter control

CREATE OBJECT custom_container

EXPORTING

container_name = cont_on_100.

  • create the splitter control

CREATE OBJECT splitter

EXPORTING parent = custom_container

orientation =

cl_gui_easy_splitter_container=>orientation_horizontal.

  • get the containers of the splitter control

container_left = splitter->top_left_container.

container_right = splitter->bottom_right_container.

  • crea. the ALVs c inside the containers of the splitter

endif.

  • create an instance of alv control

CREATE OBJECT grid_left

EXPORTING i_parent = container_left.

gs_variant-report = sy-repid.

gs_variant-handle = '100L'.

gs_layout-sel_mode = ''.

CALL METHOD grid_left->set_table_for_first_display

EXPORTING

i_structure_name = 'BKPF'

is_layout = gs_layout

is_variant = gs_variant

i_save = 'A'

CHANGING

it_outtab = gt_bkpf.

CALL METHOD grid_left->set_toolbar_interactive.

CALL METHOD cl_gui_control=>set_focus

EXPORTING

control = grid_left.

CALL METHOD cl_gui_cfw=>flush

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2.

IF sy-subrc <> 0.

  • error handling

ENDIF.

  • create an instance of alv control

CREATE OBJECT grid_right

EXPORTING i_parent = container_right.

gs_variant-report = sy-repid.

gs_variant-handle = '100R'.

gs_layout-sel_mode = ''.

CALL METHOD grid_right->set_table_for_first_display

EXPORTING

i_structure_name = 'BSEG'

is_layout = gs_layout

is_variant = gs_variant

i_save = 'A'

CHANGING

it_outtab = gt_bseg.

CALL METHOD grid_right->set_toolbar_interactive.

CALL METHOD cl_gui_control=>set_focus

EXPORTING

control = grid_right.

CALL METHOD cl_gui_cfw=>flush

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2.

IF sy-subrc <> 0.

  • error handling

ENDIF.

else.

CALL METHOD grid_left->refresh_table_display.

CALL METHOD grid_right->refresh_table_display.

endif.

ENDMODULE. " PBO_100 OUTPUT

**************************************************

Thanks in advadced

Sandra

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 20, 2004 at 10:14 AM

    Sandra,

    in my opinion you are right - splitter simply do not work in background.

    I guess still both spools are created - maybe there is the possibility to merge the data (I would try to play around with NEW-PAGE keep in spool options)

    On the other hand I wonder, if it would not make more sense to consider an conventional output (using the good old write statements) in background.

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Christian,

      I only want to know if there is an easier way like don't pass any instance of some of the implied classes, or any special method that I do not find yet ...

      I prefer the solution with the fm REUSE_ALV_GRID_DISPLAY with two spools that consider an conventional output.

      Regards

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.