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

Download Problem

Former Member
0 Likes
752

How to download file from SAP TO LOCAL PC IN BACKGROUND?

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
654

This can be done by keeping a shared folder in your system will full authorization provided.

But are you sure that the local computer will switched on all the time.

You can provide the IP address as path, jus like you give it in your explorer.

Also your server and pc must be in the same domain.

You can aslo use a unix script command for moving the file from app server to presentation, but you must place the file in App server first and the you have to move it.

4 REPLIES 4
Read only

Former Member
0 Likes
654

.

Read only

prabhu_s2
Active Contributor
0 Likes
654

by direct usage of any function module there is no way of doing it...yet by having a NFS mount on ur local drive u will be able to have download to local via background processing.....i have not worked on this but have learnt that it is doable.

Read only

Former Member
0 Likes
654

Hi Easy,

Download do not work in backgrnd.

See the below matter.

How to create or write to a file

Use ABAP statements OPEN DATASET with FOR OUTPUT keyword, TRANSFER, CLOSE DATASET.

How to read a file

Use ABAP statements OPEN DATASET with FOR INPUT keyword, READ DATASET and CLOSE DATASET.

Checking file existence

either OCS_GET_FILE_INFO function module

or "OPEN DATASET" ABAP statement

How to get list of files in a directory

To read the names of files present in a particular path on the application server we may use SUBST_GET_FILE_LIST or EPS_GET_DIRECTORY_LISTING function modules.

Is there a search help for selecting a file

F4_DXFILENAME_TOPRECURSION function module may be used to display a search help to choose a file

Snippet

Best practice

Instead of hardcoding the file names, it is possible to define generic names which are called "logical filenames". They may be defined using FILE transaction code, and used using FILE_GET_NAME function module.

Miscellaneous

sdn contribution : ABAP Server Side File Access, by Thomas Jung (class ZCL_ES_SERVER_FILE_ACCESS)

Note 752859: sapiconv - a tool for converting the encoding of files

Working with files on presentation server

How to create or write a file

either GUI_DOWNLOAD function module

Snippet

or CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD method

Snippet

Note: DOWNLOAD and WS_DOWNLOAD function modules are obsolete

How to read a file

either GUI_UPLOAD function module

Snippet

or CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD method

Note: UPLOAD and WS_UPLOAD function modules are obsolete

Checking file existence

either DX_FILE_EXISTENCE_CHECK function module

or CL_GUI_FRONTEND_SERVICES=>FILE_EXIST method

How to get list of files in a directory

either TMP_GUI_DIRECTORY_LIST_FILES function module

or CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES method

Is there a search help for selecting a file or directory

For selecting a *file", you may use:

CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG method (Basis, 4.6 and after): displays list as a popup with title "Open", and returns the name of selected file

CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG method (Basis, 4.6 and after): displays list as a popup with title "Save", and returns the name of selected file

Snippet

WS_FILENAME_GET function module (Basis, any release)

F4_FILENAME function module (R/3 and ECC only)

For selecting a directory, you may use:

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE method

Is it possible to work in background?

No, this functionality is not supplied because presentation servers may be switched off at any time without guarantee (see Note 7925 - Graphics, Upload, Download do not work in backgrnd).

Workarounds may be:

Work with files on application server. The user may copy files from or to the application server when he is connected

If you take decisions to make the presentation server work as a server (always the same computer, and it would be switched on), consider it is an RFC server: see SDN article Communication to Presentation Server in Background Mode for more information.

Regards,

Raj.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
655

This can be done by keeping a shared folder in your system will full authorization provided.

But are you sure that the local computer will switched on all the time.

You can provide the IP address as path, jus like you give it in your explorer.

Also your server and pc must be in the same domain.

You can aslo use a unix script command for moving the file from app server to presentation, but you must place the file in App server first and the you have to move it.