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

Upload/Download @ Application Server

Former Member
0 Likes
904

Hi All,

I urgently require a program, which can upload or download text file from application Server.

Please help me through code.

Thnks

Rohit

1 ACCEPTED SOLUTION
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
860

Hi

Use

<b>OPEN DATASET v_file_listings FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files

READ DATASET v_file_listings INTO single_line. "Reading the content of file into line

CLOSE DATASET v_file_listings. "Closing the files</b>

Or

Use Tcodes : <b>CG3Y/CG3Z</b>

Regards,

Sree

Hi

Use

<b>OPEN DATASET v_file_listings FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files

READ DATASET v_file_listings INTO single_line. "Reading the content of file into line

CLOSE DATASET v_file_listings. "Closing the files</b>

Or

Use Tcodes : <b>CG3Y/CG3Z</b>

Regards,

Sree

6 REPLIES 6
Read only

Former Member
0 Likes
860

Check T-code

CG3Y - to download file from application server.

CG3Z - to upload file from presentation server to application server.

Regards,

Santosh

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
861

Hi

Use

<b>OPEN DATASET v_file_listings FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files

READ DATASET v_file_listings INTO single_line. "Reading the content of file into line

CLOSE DATASET v_file_listings. "Closing the files</b>

Or

Use Tcodes : <b>CG3Y/CG3Z</b>

Regards,

Sree

Read only

Former Member
0 Likes
860

Hi,

=> You can download/upload data from Application server using the statements <i><b>OPEN_DATASET & CLOSE_DATASET.</b></i>

DATA FNAME(60) VALUE 'myfile'.
 
OPEN DATASET FNAME FOR INPUT.
 
IF SY-SUBRC = 0.
  WRITE / 'File opened'.
  .....
ELSE.
  WRITE / 'File not found'.
ENDIF.

This example opens the file "myfile" for reading. From here, the file is open in read access mode as per your requirement. Similarly, you can open it for WRITE mode.

=> Use the transaction <i><b>CG3Y for downloading & CG3Z for uploading</b></i> the file from application server. This can also be used in programming via <i><b>CALL TRANSACTION</b></i> statement.

CALL TRANSACTION 'CG3Z'  AND SKIP FIRST SCREEN
          USING LT_TABLE.

This sort out your query.

PS Plz close the thread by rewarding each reply and marking the thread Sovled..

Read only

Former Member
0 Likes
860

HI,

CALL FUNCTION 'GUI_UPLOAD'

CALL FUNCTION 'GUI_DOWNLOAD'

THAT IS ALL

Read only

Former Member
0 Likes
860

Thanks