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: 

Use: REUSE_ALV_GRID_DISPLAY in batch

Former Member
0 Kudos
1,115

Hallo,

I have a problem by using this function in batch.

In online there are no problems, but in batch i get allways an Abap-Dump.

*

Can anyone give me a tip where are my mistake.

Thanks Dieter

Here my Abap-Code:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = PROGNAME

  • I_CALLBACK_PF_STATUS_SET = 'MAIN'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE_GRID'

IS_VARIANT = VARIANT

IS_LAYOUT = LAYOUT

IT_FIELDCAT = FIELDCAT

IT_SORT = SORT

IT_FILTER = FILTER

I_SAVE = 'A'

IT_EVENTS = EVENTS

IT_EVENT_EXIT = EVENT_EXIT

IS_PRINT = PRINT

TABLES

T_OUTTAB = ITAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

*

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
193

hi,

you cannot control the GRID in background , since it calls alv controls.

if sy-batch = 'X'.

call function 'REUSE_ALV_LIST_DISPLAY'
.....

else.
call function 'REUSE_ALV_GRID_DISPLAY'

endif.

Regards

vijay

8 REPLIES 8

former_member181962
Active Contributor
0 Kudos
193

HI Dieter,

The usage of 'USER_COMMND' parameter mean that it is a interactive list.

In online , it is ok to have a user interactive list ,but it is meaningless when it is in background.

Probably that may be a reason.

Anyways, what does the dump analysis say?

Regards,

Ravi

Former Member
0 Kudos
193

Hi,

It is a common problem in background you can't use ALV GRID. so in background you print in ALV list format and in foreground you can print in GRID format. by checking system field sy-batch you can do that.

rajkumar abbu.

former_member188685
Active Contributor
0 Kudos
194

hi,

you cannot control the GRID in background , since it calls alv controls.

if sy-batch = 'X'.

call function 'REUSE_ALV_LIST_DISPLAY'
.....

else.
call function 'REUSE_ALV_GRID_DISPLAY'

endif.

Regards

vijay

0 Kudos
193

Hi vijay,

I did it like your example and it works correct.

thanks for your help

Dieter

Former Member
0 Kudos
193

Hi Dieter,

Please check standard program <b>BCALV_FULLSCREEN_DEMO</b>. I tried executing this in bj it didnt dump for me.

Please check this hope it will help you.

Thanks&Regards,

Siri.

Former Member
0 Kudos
193

Hi Dieter,

i executed my ALV program in background it didnt give me a dump.

here is the code:


form alv_grid_display .
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program       = sy-repid
i_callback_pf_status_set = 'POPUP'
i_callback_user_command  = 'HANDLE_USER_COMMAND'
i_callback_top_of_page = 'TOP-OF-PAGE'
it_fieldcat              = it_fieldcat
TABLES
t_outtab                 = itab
EXCEPTIONS
program_error            = 1
others                   = 2.
if
sy-subrc  = 0.
endif.
endform.                    " alv_grid_display

regards,

Kinshuk

0 Kudos
193

surprisingly i saw that GRID_DISPLAY FM does work in FM.

Is it that SAP has changed it in later releases? I am on 4.7.

I remember that in 4.6 it gave a dump....

yes_sapteam
Participant
0 Kudos
193

The question needs to be asked is what do you need an ALV in backgroud for?

If this program sometimes run in backgroud just don't use ALV


if sy-batch = 'X'.
   ...
endif.

If you need your table result even when running in background just print it to the spool (never tried it but it should not be a big deal).

enjoy

ayal.