Application Development 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: 

Output from spool to a a specific folder

Former Member
0 Kudos
1,010

Hi,

I have a requirement to do the following:

Create a background job with some specific transactions and output to spool. Then take this output and write it to a specific shared directory in the users PC.

regards

Aveek

5 REPLIES 5

andreas_mann3
Active Contributor
0 Kudos
245

Hi,

try that:

1) fm job_open

2) submit your_report

... TO SAP-SPOOL

3) job_close

4) fm list_from_memory

5) fm CONVERT_OTFSPOOLJOB_2_PDF (look abap RSTXPDFT4)

/or fm LIST_TO_ASCI and fm gui_download

-> look oss-note 190669

regards Andreas

0 Kudos
245

Hi,

I will try it out and have rewarded with points. I will let you know later about the issue.

regards

Aveek

0 Kudos
245

Hi,

Another way:

....

call function 'CLOSE_FORM'

TABLES

otfdata = ZOFTDATA

EXCEPTIONS

ERR_MAX_LINEWIDTH

=1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3.

call function 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

IMPORTING

BIN_FILESIZE = NUMBYTES

TABLES

OTF = ZOFTDATA

LINES = ZPDF

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = NUMBYTES

FILENAME = FILE

FILETYPE = 'BIN'

IMPORTING

FILESIZE = NUMBYTES

TABLES

DATA_TAB = ZPDF

EXCEPTIONS

OTHERS = 9.

You should keep in mind that FM 'GUI_DOWNLOAD' can not be used in background. To store a file in background you should use DATASET.

Svetlin

0 Kudos
245

Hi,

Is there any othet alternate function module that can be used for dwownloading to a specific folder of a PC with the background job and sppol.

regards

Aveek

0 Kudos
245

Read this thread. There is some helpful info.

Svetlin