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

Problem while downloading data in excel file.

Former Member
0 Likes
912

Hi ,

I m having a Problem while downloading data in excel file while running the program in background. I m using WS_DOWNLOAD for downloading the data of internal table in a file. The job CANCLES every time when i run it in background.

But when i run the same program in foreground it runs sucessfully.

pls tel me how can i download data while running the program in background

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
874

hi,

U should provide the file path satatically in code,

Regards,

Suresh.D

Hi ,

I m having a Problem while downloading data in excel file while running the program in background. I m using WS_DOWNLOAD for downloading the data of internal table in a file. The job CANCLES every time when i run it in background.

But when i run the same program in foreground it runs sucessfully.

pls tel me how can i download data while running the program in background

Regards

4 REPLIES 4
Read only

Former Member
0 Likes
874

Hi,

You can't use WS_DOWNLOAD in the background as it downloads the data on presentation server.

Reward points if useful.

Regards,

Atish

Read only

0 Likes
874

If you want to download the data when the job runs in background you have to downlaod it on application server using OPEN DATASET...and related keywords.

Read only

Former Member
0 Likes
875

hi,

U should provide the file path satatically in code,

Regards,

Suresh.D

Read only

Former Member
0 Likes
874

Hi

You Can't use WS_Upload in Back ground...Use open dataset and write itto a file..This will work in background...See the sample code below...

DATA : var_msg(50).

DATA: e_lfile LIKE rlgrap-filename .

DATA : flname(500) TYPE c.

CONCATENATE p_spath 'LOG' sy-datum sy-uzeit '.LOG' INTO flname.

e_lfile = flname.

SELECT MAX( crdate ) INTO g_date FROM zirl01_day_bal2 WHERE crdate <= p_date.

IF sy-subrc = 0.

IF ( g_date <> p_pdate AND p_skipw <> 'X' ).

CONCATENATE g_date ' is the available maximum date ' INTO var_msg.

  • var_msg = ''.

log_line = var_msg.

APPEND log_line TO itab_log.

OPEN DATASET e_lfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc <> 0.

PERFORM log_writing.

ENDIF.

MESSAGE e398(00) WITH var_msg.

ENDIF.

ENDIF.

FORM log_writing.

IF NOT itab_log[] IS INITIAL.

LOOP AT itab_log.

TRANSFER itab_log TO e_logfile.

ENDLOOP.

CLOSE DATASET e_logfile.

ENDIF.

ENDFORM. "LOG_WRITING

Change the variable and internal table names and do like this,....this will workk

Reward All Helpfull Answers.........