[7806] in SAPr3-news

home help back first fref pref prev next nref lref last post

Re: WS_DOWNLOAD

daemon@ATHENA.MIT.EDU (Hans Eenink)
Fri Sep 11 23:47:26 1998

To: sapr3-news@MIT.EDU
Date: Sat, 12 Sep 1998 00:51:53 GMT
From: sap@NOSPAM.ebit.nl (Hans Eenink)

On 8 Sep 1998 19:45:53 GMT, simonbls@aol.com (Simonbls) wrote:

>Hello,
>I have a program that is set up run as a job every hour.  It basically reads
>data from a table and then calls WS_DOWNLOAD to dump it to a file on the
>server. When run as a job it dumps within the form ws_query (this must get
>called by ws_download).  It dumps on the following code:
>if sy-batch ne space.
> raise no_batch.
>endif.
>If I run this program in online, everything is fine.  Can WS_DOWNLOAD not be
>used in batch?
>Thanks for any help.
>Brad

Hi Brad
You're right: WS_DOWNLOAD can't be used in batch!
Actually, WS stands for 'Workstation', which is the 'terminal' that
runs the presentation server.
Since there's no terminal involved in a batch process, SAP wouldn't
know where to download the data to!
Therefore you'll have to use another technique to write to a file
which is accessible for the application server.
The following piece of code opens dataset p_dsn from the application
server, writes entries of internal table t_testtab to the dataset one
by one, and then closes the dataset.
Although not in the example, you shouldn't forget to check the
returncodes (sy-subrc) ...
I'm sure this will work!
Hans Eenink, Ebit/Sc

open dataset p_dsn for output in text mode.
loop at t_testtab.
  transfer t_testtab to p_dsn
endloop.

close dataset p_dsn.


home help back first fref pref prev next nref lref last post