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: 

alv in background

Former Member
0 Kudos

HI ,

Can we run Alv report in background.

9 REPLIES 9

suresh_datti
Active Contributor
0 Kudos

YES.

Suresh

Former Member
0 Kudos

ALV cannot be run in background

0 Kudos

It can be run successfully in the background.. you will see the output like a normal ABAP list without the ALV features.. that is what I mean by YES.

Regards,

Suresh Datti

Former Member
0 Kudos

use docking container to run in background

former_member188685
Active Contributor
0 Kudos

Hi,

Yes you can Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..

if sy-batch = ' '.

call 'REUSE_ALV_GRID_DISPLAY'.

else.
call 'REUSE_ALV_LIST_DISPLAY'.

endif.

if you are using OO alv then write this code..

CALL METHOD cl_gui_alv_grid=>offline
                RECEIVING e_offline = off.
    IF off IS INITIAL.
      CREATE OBJECT g_custom_container
             EXPORTING container_name = g_container.
    ENDIF.

Regards

vijay

Message was edited by: Vijay Babu Dudla

0 Kudos

Hi Vijay,

I have created 2 ALV Grids in one screen - one below another using DOCKING CONTAINER.

I am getting the foreground output as expected with 2 ALV Grids.

While executing in background (F9), I am getting only output of first ALV grid. Second ALV is not getting displayed in BACKGROUND(F9) mode.

You have mentioned to use 'cl_gui_alv_grid=>offline'

How and where to use this. Help me with some part of code.

Regards,

Viji.

former_member927251
Active Contributor
0 Kudos

Hi Hazam,

I can help you if you are using OO ALV.

Just before creating the custom container check for the following condition.

  • Batch or Web Reporting

IF cl_gui_alv_grid=>offline( ) IS INITIAL.

CREATE OBJECT o_custcontainer

EXPORTING

container_name = lc_custcontrol

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

OTHERS = 6

.

ENDIF.

You can see the output in Spool in transaction SP01.

Regards,

Amit Mishra

Former Member
0 Kudos

Hi,

YES you can run the ALV report in background mode.

To run the report in background do F9 instead of F8, then give immediate and save.

Now goto Sm35 goto job overview and view the job listed

Choose the job and press the spool button. It will show the list created on the next page. When u clcik the list u can see the ALV output.

To see this the job should be in the finished status.

How to define Periodic Jobs

1.Execute transaction SM36

2.Define Job name, Job class, Target server

3.Click on 'START CONDITION' button

4.Click on 'Date/Time' button

5.Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.

6.Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE

7.Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.

8.Click on 'Job overview' button or execute SM37 transaction.

9.Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.

10.You will now see all your scheduled JOBS.

Also, let me know if u need a sample alv code which runs in Background.

Reward points and close the thread if ur problem got solved.

Regards,

Anjali

Former Member
0 Kudos

hi,

if run in background, the column header is repeated on each page. how to make it a list with only 1 column header.

if run foreground and download to local will not have this problem.

any help.

thanks