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: 

download from application server

Former Member
0 Kudos

any transaction which downloads file from application to presentation server

1 ACCEPTED SOLUTION

Former Member
8 REPLIES 8

Former Member
0 Kudos

Hi Nishant-

You can look at the below thread...I hope will solve your problem....

https://www.sdn.sap.com/irj/sdn/collaboration

Thanks,

Venky

0 Kudos

its an incomplete thread

0 Kudos

Nishant-

You can use - Cg3Y to download file from appln to presentation.

Thanks,

Venky

ferry_lianto
Active Contributor
0 Kudos

Hi Nishant,

You can use t/code <b>CG3Y</b> to download a file from application server to presentation server and t/code<b> CG3Z</b> to upload a file to a application server from presentation server.

You can also use this FM GUI_DOWNLOAD or method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD.

In the class CL_GUI_FRONTEND_SERVICES you can find others methods, for example:

FILE_GET_VERSION

FILE_OPEN_DIALOG

FILE_SAVE_DIALOG

GET_COMPUTER_NAME

GET_DESKTOP_DIRECTORY

Hope this will help.

Regards,

Ferry Lianto

Former Member

Former Member
0 Kudos

Hi Nishant,

1. CG3Y tcode - application server to front-end

2. CG3Z tcode - front-end to application server

regards,

amit m.

vinod_gunaware2
Active Contributor
0 Kudos

<b>1. CG3Y - application server to front-end

2. CG3Z - front-end to application server

3. AL11 SAP directories(to view file and directories)</b>

regards

vinod

Former Member
0 Kudos

Hai Nishant

Try with the following Code

REPORT ZTRAINING_FILE_UPLOAD_APPL message-id ztraining .

----


  • types

----


**-- types for data to be downloaded

types: begin of tp_kna1,

KUNNR type kna1-kunnr, " customer number

LAND1 type kna1-land1, " Country Key

NAME1 type kna1-name1, " customer name

ORT01 type kna1-ort01, " city

PSTLZ type kna1-pstlz, " postal code

REGIO type kna1-regio, " region

end of tp_kna1.

----


  • I n t e r n a l T a b l e s

----


**-- Internal table for data to be downloaded

data: it_kna1 type standard table of tp_kna1 with header line.

----


  • S e l e c t i o n S c r e e n

----


selection-screen begin of block b1 with frame title text-001.

parameters: p_afile type rlgrap-filename

default 'customer.txt'.

selection-screen end of block b1.

----


----


  • S t a r t o f s e l e c t i o n

----


start-of-selection.

*-- Upload the data from Sales Deal file

perform upload_app_file.

end-of-selection.

perform write_data.

*&----


*& Form upload_app_file

*&----


  • Upload the application server file data

*----


form upload_app_file.

data: l_msg(100). " error message

open dataset p_afile for input in text mode encoding default message

l_msg.

if sy-subrc <> 0.

message i004 with l_msg.

else.

do.

read dataset p_afile into it_kna1.

if sy-subrc = 0.

append it_kna1.

clear it_kna1.

else.

exit.

endif.

enddo.

close dataset p_afile.

endif.

endform. " upload_app_file

&----


*& Form write_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM write_data .

loop at it_kna1.

write:/ it_kna1-kunnr,

it_kna1-land1,

it_kna1-name1,

it_kna1-ort01,

it_kna1-pstlz,

it_kna1-regio.

endloop.

ENDFORM. " write_data

Thanks & Regards

Sreenivasulu P