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

error while execution in background

Former Member
0 Likes
2,030

Hi all

when iam using file download function , it is working fine in foreground but giving

error dump while executing in background

plz reply , its urgent

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,123

Hello,

Are U downloading to APllication server. Since when a report is executed in Batch then the file path should be the application server path.

If u give the local presentation then the SAP will definely throw dump.

Check this,

Vasanth

7 REPLIES 7
Read only

Former Member
0 Likes
1,124

Hello,

Are U downloading to APllication server. Since when a report is executed in Batch then the file path should be the application server path.

If u give the local presentation then the SAP will definely throw dump.

Check this,

Vasanth

Read only

Former Member
0 Likes
1,123

Hi Swati,

If you are using GUI_DOWNLOAD fm to download, it will dump.

You cannot communicate with presentation server in background mode.

Better download it to an application server and later you can use CG3Z transaction to move the file.

Regards,

Ravi

Read only

Former Member
0 Likes
1,123

Hi Swati,

We can not use the WS_DOWNLAOD, GUI_DOWNLOAD, WS_UPLOAD and GUI_UPLOAD function modules in the Background, it always gives the error, so better to Download it to Unix server and later read it and download to your Desktop.

Regards

Sudheer

Read only

Former Member
0 Likes
1,123

Download function doesnt work in background mode. When u run a report in background mode, it runs on application server and download function tries to download teh same on presentation server. Since presentation server is not available dump is produced.Use open dataset, close dataset command and try to download the data onto application server.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
1,123

Hi Swati,

GUI_UPLOAD & GUI_DOWNLOAD works only in Foreground not in backgroung. In background you can download the data to Application server using OPEN DATASET.

Reward points if helpful answer.

Ashven

Read only

Former Member
0 Likes
1,123

Hi Check this link it will solves ur problem...

http://www.sap-img.com/ab004.htm

<b>i am pasting the same information below......</b>

GUI_* WS_* Function In Background, CSV Upload

GUI_* and WS_* function modules do not work in background

When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.

At anytime, a user can switch of the Personal Computers even though the job is still running in the background. Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer file.

To choose the correct download method to used, you can check the value of SY-BATCH in your code,

if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.

*-- Open dataset for reading

DATA:

dsn(20) VALUE '/usr/test.dat',

rec(80).

OPEN DATASET dsn FOR INPUT IN TEXT MODE.

IF sy-subrc = 0.

DO.

READ DATASET dsn INTO rec.

IF sy-subrc <> 0.

EXIT.

ELSE.

WRITE / rec.

ENDIF.

ENDDO.

ENDIF.

CLOSE DATASET dsn.

*-- Open dataset for writing

DATA rec(80).

OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.

TRANSFER rec TO '/usr/test.dat'.

CLOSE DATASET dsn.

What is the difference when we use upload, ws_upload, gui_upload function modules?

UPLOAD, WS_UPLOAD, GUI_UPLOAD, are used in BDC concepts. ie., Batch Data Communication.

Batch Data Conversion is a concept where user can transfer the Data from non SAP to SAP R/3. So , in these various Function Modules are used.

UPLOAD--- upload a file to the presentation server (PC)

WS_UPLOAD---- Load Files from the Presentation Server to Internal ABAP Tables.

WS means Work Station.

This is used upto SAP 4.6 version.

GUI_UPLOAD------- Replaces WS_UPLOAD. Upoad file from presentation server to the app server. From 4.7 SAP version it is replaced.

How to Upload csv file to SAP?

Common File Download Upload Questions:

How you upload the data from text file to sap internal table? From my knowledge its by upload or gui_upload.

How you download the data from sap internal table to text file?

How you upload the data from xls (excel) file to sap internal table how you download the data from sap internal table to xls(excel) file.

You can upload data from presentation server to an internal table using gui_upload. Use gui_download to download from internal table to flat file.

Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.

Use function module GUI_UPLOAD

The FILETYPE refer to the type of file format you need: For e.g 'WK1' - Excel format , 'ASC' - Text Format etc.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:\test.csv'

FILETYPE = 'ASC'

TABLES

DATA_TAB = itab

EXCEPTIONS

FILE_OPEN_ERROR = 1

FILE_READ_ERROR = 2

NO_BATCH = 3

GUI_REFUSE_FILETRANSFER = 4

INVALID_TYPE = 5

NO_AUTHORITY = 6

UNKNOWN_ERROR = 7

BAD_DATA_FORMAT = 8

HEADER_NOT_ALLOWED = 9

SEPARATOR_NOT_ALLOWED = 10

HEADER_TOO_LONG = 11

UNKNOWN_DP_ERROR = 12

ACCESS_DENIED = 13

DP_OUT_OF_MEMORY = 14

DISK_FULL = 15

DP_TIMEOUT = 16

OTHERS = 17.

Ramesh

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
1,123

Hi Swati,

File download functionality would definitely dump in background. This happens because it has screens which needs user's interaction.

<i>But if tou want to escape the DUMP, please write your FILE DOWNLOAD functionality inside the IF BLOCK with condition:-</i>

<b>IF SY-BATCH NE 'X'.

*File Download functionality..............

ENDIF.</b>

Note: Please reward points if you feel satisfied with the solution provided here :).

Thanks and regards,

RAVI .