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

ABAP program with subscreen in background

Former Member
0 Likes
1,965

Hi all

Is it possible to run ABAP program with subscreens area including ALV in background

the program is timing ou in foreground processing

Thanks

1 ACCEPTED SOLUTION
Read only

manish_shankar
Participant
0 Likes
1,466

Hi Malu,

In subscreen area create one container (Custom or docking). You can create your alv there using CL_GUI_ALV_GRID class and set_table_for_first_display method of that class.

- Manish.

10 REPLIES 10
Read only

manish_shankar
Participant
0 Likes
1,467

Hi Malu,

In subscreen area create one container (Custom or docking). You can create your alv there using CL_GUI_ALV_GRID class and set_table_for_first_display method of that class.

- Manish.

Read only

Former Member
0 Likes
1,466

Hi, if u r using container, then u can not run program in back ground mode,Rather will get cancel. here is job log

04.10.2012 13:31:18 Job started                                                                        00       516      S
04.10.2012 13:31:18 Step 001 started (program BCALV_GRID_11, variant &0000000000000, 00       550      S
04.10.2012 13:31:18 Control Framework: Fatal error - GUI cannot be reached                             DC       006      W
04.10.2012 13:31:18 ABAP/4 processor: RAISE_EXCEPTION                                                  00       671      A
04.10.2012 13:31:18 Job cancelled                                                                      00       518      A
Read only

0 Likes
1,466

Hi Vipin,

But how you'll display an alv in screen/subscreen without using containers. If you want to display alv in screen/subscreen, then you have to go for containers.

- Regards,

Manish Shankar.

Read only

0 Likes
1,466

correct, agree.

Read only

0 Likes
1,466

Hi mansih

The program is fully working with subsscreen and container , it is working fine in the foreground but

I want to run it in the background because it times out.

Thanks

Read only

0 Likes
1,466

is it possible for u to paste the code here ?

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,466

Yes, you have to check in the program if it is executed in background or not, then create or not the container and only then the alv grid.

* create container if online

IF cl_gui_alv_grid=>offline( ) is initial.

    CREATE OBJECT g_dock. " docking container or container defined in subscreen

ENDIF.

* then create grid (orphan if background)

CREATE OBJECT g_grid

    EXPORTING I_PARENT = g_dock.

Off course don't CALL SCREEN too in background

Regards,

Raymond

Read only

Amarpreet
Active Participant
0 Likes
1,466

Just dont call the Sub-screen when the program is being executed in the background.

you can check if the program is running in the background by checking the system field SY-BATCH.

hope this helps

good luck

Read only

Former Member
0 Likes
1,466

Hi again

I getting his error when runing in background

SET SCREEN not allowed in subscreens

this is my code


l_container_name(30) type c,

l_custom_container type ref to cl_gui_custom_container,

data:
  customer_grid type ref to cl_gui_alv_grid,

  l_container_name = 'MAT'.

  create object l_custom_container
    EXPORTING
      container_name              = l_container_name


....


create object customer_grid
    EXPORTING
      i_parent = l_custom_container.

call method customer_grid->set_table_for_first_display
    EXPORTING
      is_layout            = ls_layout
      i_save               = 'A'
      is_variant           = ls_variant
      it_toolbar_excluding = lt_excludes
    CHANGING
      it_sort              = it_sort
      it_outtab            = it_dat
      it_fieldcatalog      = gtfc.

I hope you can help

Read only

0 Likes
1,466

Thanks

closing