2006 Apr 10 11:13 AM
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.
*
2006 Apr 10 11:26 AM
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
2006 Apr 10 11:20 AM
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
2006 Apr 10 11:22 AM
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.
2006 Apr 10 11:26 AM
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
2006 Apr 10 2:33 PM
Hi vijay,
I did it like your example and it works correct.
thanks for your help
Dieter
2006 Apr 10 12:06 PM
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.
2006 Apr 10 12:13 PM
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
2006 May 05 3:37 AM
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....
2006 Apr 10 12:23 PM
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.