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

Background task problem with alv grid display

Former Member
0 Likes
1,163

Hello !

I have a problem when executing my program in background.

In foreground I have no problem, my ALV appears. In the background I have a dump.

The current ABAP program "SAPLKKBL" had to be terminated because one of the statements could not be executed.

I use the function module 'REUSE_ALV_GRID_DISPLAY'

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
        i_callback_program      = gd_repid
        i_callback_user_command = 'F533_USER_COMMAND'
        is_layout               = gd_layout
        it_fieldcat             = fieldcatalog[]
        it_special_groups       = i_fgroup[]
        i_save                  = 'X'
        it_sort                 = gd_sort
        i_buffer_active         = ' '
        i_callback_pf_status_set = 'F534_SET_PF_STATUS'
     TABLES
        t_outtab                = mytab
     EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

I don't understand where the problem is. Please help me.

Thank you.

6 REPLIES 6
Read only

h_senden2
Active Contributor
0 Likes
761

You cannot use ALV in background !

regards,

Hans

Please reward all helpful answers !!!!!

Read only

Former Member
0 Likes
761

Hi,

Please refer this program of ALV in background:

/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job

Best regards,

Prashant

Read only

Former Member
0 Likes
761

I can not access your link.

Read only

0 Likes
761
Read only

former_member226419
Contributor
0 Likes
761

Can you try debugging the background job with command 'JDBG' and see where exactly problem is?

Read only

Former Member
0 Likes
761

Hi

check sy-batch for displaying alv or not.

SY-BATCH indicates if the current execution is a batch job (background) or a dialog job(foreground). If sy-batch is 'X', then the execution is in the background.