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

CALL FUNCTION 'GUI_DOWNLOAD'

Former Member
0 Likes
1,293

i use this function to download file to my desktop.

now-> i want to download it to server it's the same?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,019
hi Rani,

   Welcome back,,,after long time!!

  U can use CG3Z transaction or

  OPEN DATASET 

  TRANSFER 
 
  CLOSE DATASET
8 REPLIES 8
Read only

amit_khare
Active Contributor
0 Likes
1,019

Hi,

For downloading on server we use Open Dataset.

For example.

OPEN DATASET P_OUT1 FOR OUTPUT IN TEXT MODE.

TRANSFER it_BUFFER TO P_OUT1.

CLOSE DATASET P_OUT1.

Regards,

Amit

Read only

Former Member
0 Likes
1,019

if u want to transfer it to the application server then u cant use this function module

u have to use

OPEN DATASET <filename> FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

loop at <itab>.

TRANSFER <itab> TO <filename>.

endloop.

CLOSE DATASET <filename>

statements to transer the data into application server.

Thanks

Elan

Read only

Former Member
0 Likes
1,020
hi Rani,

   Welcome back,,,after long time!!

  U can use CG3Z transaction or

  OPEN DATASET 

  TRANSFER 
 
  CLOSE DATASET
Read only

0 Likes
1,019

i use this

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = filename

  • FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = i_tab

.

can you give me an examp

Read only

gopi_narendra
Active Contributor
0 Likes
1,019

small piece of code on the same. please check it

  • Open Dataset

catch system-exceptions DATASET_CANT_OPEN = 8.

open dataset UNIX_FILE for output in text mode encoding default.

endcatch.

  • Write to Dataset

loop at IT_STR into IS_STR.

catch system-exceptions DATASET_NOT_OPEN = 0 .

transfer IS_STR-STR to UNIX_FILE.

endcatch.

clear : IS_STR.

endloop.

if SY-SUBRC eq 0.

message S138(ZSM) with 'Data in Unix File ' UNIX_FILE.

" Change the status of PO Header

IS_PO-PO_STATUS = 'ACK'.

modify ZES_PO from IS_PO_FINAL.

endif.

  • Close Dataset

close dataset UNIX_FILE.

Regards

- Gopi

Read only

Former Member
0 Likes
1,019

hi

if u want to download it to the application server u have to use the following statement

syntax. open dataset filename for output in text mode encoding default.

for knowing much about this write 'OPEN DATASET' press f1 u will get clear idea.

Read only

Former Member
0 Likes
1,019

Hi Rani,

You cannot use the same function for downloading file to server. The FM doesnot provide this facitlity.

For downloading to server, you need to use

1. OPEN DATASET p_file_path FOR OUTPUT.

2. TRANSFER

3. CLOSE DATASET.

For more details refer to the SAP help.

Regards,

Chetan.

PS:Reward points if this helps.

Read only

Former Member
0 Likes
1,019

Hi,

The FM's GUI_UPLOAD, GUI_DOWNLOAD both are used to file to upload and download data from internal table to presentation server and viceversa.

The Tcodes CG3Y,CG3z both are used to file to upload and download data from Presentation server file to applciaiton server and viceversa.

If you want to acheive same use

OPEN DATASET

READ DATASET

CLOSE DATASET

Use above three statements to store data in application server file.

Regards

Bhupal Reddy