2007 May 22 8:05 AM
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
2007 May 22 8:08 AM
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
2007 May 22 8:06 AM
Hi,
You can't use WS_DOWNLOAD in the background as it downloads the data on presentation server.
Reward points if useful.
Regards,
Atish
2007 May 22 8:07 AM
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.
2007 May 22 8:08 AM
hi,
U should provide the file path satatically in code,
Regards,
Suresh.D
2007 May 22 8:10 AM
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.........
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |