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: 

Need to Download Files on to App Server

Former Member
0 Kudos

Hi SDN,

I am using the T code f110. I need to download the files onto the Application Server. The application uses WS_DOWNLOAD functional module. I can give the ftp path of the server and download the files( eg.
<ip address>\<directory>. But the app server machine is a UNIX Machine and has UNIX path.

I know the directory on the Unix Machine. I can see the path in al11, that appears to be /usr/sap/...

Can anyone tell me what path shall I give to the Download File, passing to the F Module WS_Download so that the files get downloaded to the correct directory on the machine.

Helpful answers will be rewarded with points!!!

Thanks,

Manu

8 REPLIES 8

former_member187255
Active Contributor
0 Kudos

Manu,

you need to use OPEN DATASET to read file from App Server.

Chandra.

0 Kudos

I need to write the file to App Server. The Standard Functionality uses ws_download. Just the correct path and things will work.

Any clues.

Thanks,

Manu

Former Member
0 Kudos

Hi,

Create a logical path for the particular application server directory(As u know that),what u want, in the Tcode "FILE" and selet the path.

Creating and Defining Logical Paths

You can link a logical path to any logical filename. The logical path provides a platform-specific physical path for any logical filename. To create a logical filename, choose Logical file path definition from the Navigation group box in Transaction FILE. On the screen, you can then define a new logical path as shown below:

Save the logical path.

In the Navigation group box, choose Assignment of physical paths to logical path. This allows you to link logical paths to physical paths and syntax groups. You can now either choose a logical path and maintain its link to a syntax group, or choose New entries to create new links. The physical path for the syntax group UNIX might be defined as follows:

You can display lists of possible entries for the Logical path and Syntax group fields. When you create the physical path, you can use reserved words (enclosed in angled brackets). These are replaced by the appropriate values at runtime. To display a list of reserved words, place the cursor on the input field and choose Help. The physical path must always contain the reserved word <FILENAME>. It is replaced at runtime by the logical filename used by the logical path. The value of the reserved word <PARAM_1>, used in the previous example, is an import parameter of the function module FILE_GET_NAME.

Hoep this helps u,

Arunsri

0 Kudos

Thanks a lot for you help. Sounds it should work Could you please elaborate a lot.

You can mail me the other details at kapurmanu@gmail.com.

Thanks a lot,

Manu

0 Kudos

Hi Manu,

Please check this forum.

[forum|;

I hope this helps.

Regards,

Abdullah

Former Member
0 Kudos

Refer to the code below.

Use function GUI_DOWNLOAD to download required file into int. table.

Then use the following code to read and write into appl. Server

data: p_path type rlgrap-filename value file_path.

constant : file_path type rlgrap-filename

value 'D:\usr\sap\RES\DVEBMGS00\work'.

( This path is taken from AL11).

This code is to read file from Appl. Server.

open dataset p_path for input in text mode encoding default.

do.

read dataset p_path into result.

if sy-subrc 0.

close dataset p_path.

message i007.

exit.

else.

append result to i_prog1.

endif.

enddo.

To write file into appl. Server.

concatenate p_path '\' 'FILE1' into p_path.

open dataset p_path for output in text mode encoding default.

if sy-subrc 0.

close dataset p_path.

message e004.

exit.

endif.

loop at i_prog into wa_prog.

transfer wa_prog to p_path.

endloop.

close dataset p_path.

message i006.

OR

&----


*& Report ZTESTPROGRAMFORDOWNLOAD

*&

&----


*&

*&

&----


report ztestprogramfordownload.

tables:zupload.

data:it_pa0002(200).

types: begin of ty_pa0002 ,

pernr like pa0002-pernr,

begda like pa0002-begda,

endda like pa0002-endda,

vorna like pa0002-vorna,

nachn like pa0002-nachn,

end of ty_pa0002.

data:begin of it_error occurs 0 ,

pernr like pa0000-pernr,

end of it_error .

data:it_final type standard table of ty_pa0002 with header line.

data:it_temp type standard table of ty_pa0002 with header line.

parameters:p_file like rlgrap-filename default 'F:\usr\sap\EC6\DVEBMGS00\work\entiraledu1'.

start-of-selection.

open dataset p_file for input in text mode encoding default.

do.

read dataset p_file into it_pa0002.

if sy-subrc = 0.

it_final-pernr = it_pa0002+0(8).

it_final-begda = it_pa0002+18(8).

it_final-endda = it_pa0002+36(8).

it_final-vorna = it_pa0002+54(40).

it_final-nachn = it_pa0002+104(40).

append it_final.

clear it_final.

else.

exit.

endif.

enddo.

if not it_final[] is initial.

sort it_final by pernr begda descending.

delete adjacent duplicates from it_final comparing pernr .

select pernr

begda

endda

vorna

nachn

from pa0002

into table it_temp

for all entries in it_final

where pernr = it_final-pernr.

endif.

loop at it_temp.

zupload-pernr = it_temp-pernr.

zupload-begda = it_temp-begda.

zupload-endda = it_temp-endda.

zupload-vorna = it_temp-vorna.

zupload-nachn = it_temp-nachn.

insert zupload.

clear it_temp.

clear zupload.

endloop.

close dataset p_file.

Reward points..

Former Member
0 Kudos

Hai Manu Kapur,

Just USe This Function Module C13Z_APPL_TO_FRONT_END

it Will just ASk For File paths.

If Found Helpfull.

Do Reward.

Regards.

Eshwar.

Former Member
0 Kudos

Thanks!!!