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

alv display background

Former Member
0 Likes
772

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
737

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

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.

4 REPLIES 4
Read only

Former Member
0 Likes
737

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

Read only

0 Likes
737

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...

Read only

Former Member
0 Likes
738

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

Read only

agnihotro_sinha2
Active Contributor
0 Likes
737

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