2008 Nov 27 9:42 AM
Hello,
I have a report that displays an ALV grid using;
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' IN BACKGROUND TASK
If the report runs as a foreground job everything is ok but if the report runs as a background job the resulting table contains only a line filled with 1 in every column.
Suggestions on what could be wrong?
Thanks.
2008 Nov 27 10:20 AM
hi
you can try the following code
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
<b>I_CALLBACK_PF_STATUS_SET = 'STATUS'</b>
<b>I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b>
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 50
I_SCREEN_END_LINE = 20
TABLES
T_OUTTAB = ITAB
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.
hope this helps
regards
Aakash Banga
2008 Nov 27 9:47 AM
HI.
You need to set page format if you run in background in the print parameters of the ALV FM.
Pass the LA_PRINT to the IS_PRINT in the Function module
DATA: LA_PRINT TYPE SLIS_PRINT_ALV.
set your page format which can bring your all columns
LA_PRINT-PRINT_CTRL-PRI_PARAMS-PAART = 'X_65_255'.
Regards.
Jay
2008 Nov 27 1:33 PM
tried that and it doesn't work.. must be something else...
And yes, the result can be displayed correctly in backgound jobs even using ALV grid...
2008 Nov 27 10:20 AM
hi
you can try the following code
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
<b>I_CALLBACK_PF_STATUS_SET = 'STATUS'</b>
<b>I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b>
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 1
I_SCREEN_END_COLUMN = 50
I_SCREEN_END_LINE = 20
TABLES
T_OUTTAB = ITAB
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.
hope this helps
regards
Aakash Banga
2008 Nov 27 10:25 AM
hi,
dont think ALV grid display can work in background , since it will require the ABAP list processor to execute the FM. but this processor is not available at backgrnd.... because of this many SAP GUI based operations cannot be carried out in background..
regards,
ags