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

Custom Program getting error while in background

Former Member
0 Likes
693

Hi Experts,

I am retrieveing data using FM "ARCHIVOBJECT_GET_DT_VIA_TABLE", it is working well when running in foreground.

While I am running in background mode, it is giving error "ERROR_APPLICATION.

This error message may be getting generated from any of these FM "ARCHIVFILE_TABLE_TO_CLIENT" or "ARCHIVOBJECT_GET_TABLE".

Please advise.

Thanks & regards,
Sowmya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
576

We got the solution.

In the Function Module ARCHIVOBJECT_GET_DT_VIA_TABLE (copied as a custom FM), we used 'ARCHIVFILE_TABLE_TO_SERVER' instead of 'ARCHIVFILE_TABLE_TO_CLIENT'.

'ARCHIVFILE_TABLE_TO_CLIENT' had GUI_DOWNLOAD which will not work in background and causing the error.

This will resolve the issue.

Thanks & Regards,

Sowmya

4 REPLIES 4
Read only

hendrik_brandes
Contributor
0 Likes
576

Hi Sowmya,

you cannot download any data to a client, when running a program in background because your report has no client connection. The flag sy-batch indicates wethere a report runs in background or online.

Try to replace your coding with two variants for batch and online mode.

Kind regards,

Hendrik

Read only

Former Member
0 Likes
576

Sowmya,

Background job always runs on the server and you need to give the logical file path for that system to do any file operations. It does not have any client interfaces like that of front end program.

If you would like to have both foreground and background, then you need to provide 2 file paths. Check if sy-batch = 'X' means background mode, then take the file path from the server, otherwise take the filepath from the local PC.

Regards,

Hardik Mehta

Read only

Former Member
0 Likes
577

We got the solution.

In the Function Module ARCHIVOBJECT_GET_DT_VIA_TABLE (copied as a custom FM), we used 'ARCHIVFILE_TABLE_TO_SERVER' instead of 'ARCHIVFILE_TABLE_TO_CLIENT'.

'ARCHIVFILE_TABLE_TO_CLIENT' had GUI_DOWNLOAD which will not work in background and causing the error.

This will resolve the issue.

Thanks & Regards,

Sowmya

Read only

0 Likes
576

Hello Sowmya,

I used the following ABAB Code, which works in Background mode, as well as a foreground mode.

gruess leo