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

doubt in dowloading data from application server

Former Member
0 Likes
537

Hi all,

Can we download data from application server based on some condition ?

if so how?

Thanks,

Praveena

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
510

use transactions cg3y or cg3z to down load and upload from applicationservers.

If <cond>

call transaction cg3y or cg3z using....................

else.

exit.

endif.

4 REPLIES 4
Read only

Former Member
0 Likes
511

use transactions cg3y or cg3z to down load and upload from applicationservers.

If <cond>

call transaction cg3y or cg3z using....................

else.

exit.

endif.

Read only

Former Member
0 Likes
510

Hi Sri Praveena,

=> You can download 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.

=> Use the transaction <i><b>CG3Y</b></i> for downloading the file from application server. This can also be used in programming.

This sort out your query.

PS Plz close the thread by rewarding each reply.

Regards

Message was edited by:

Sapna Modi

Read only

Former Member
0 Likes
510

Hi,

Check the following code:

  • Retrieve Data file from Application server(Upload from Unix)

DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.

OPEN DATASET i_file FOR INPUT IN TEXT MODE.

IF sy-subrc NE 0.

MESSAGE e999(za) WITH 'Error opening file' i_file.

ENDIF.

DO.

  • Reads each line of file individually

READ DATASET i_file INTO wa_datatab.

  • Perform processing here

  • .....

ENDDO.

Hope this helps.

Reward if helpful.

regards,

Sipra

Read only

Former Member
0 Likes
510

hi

try<b> cg3z</b> and <b>cg3y</b>

hope it help,

regards,