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

dataset

Former Member
0 Likes
622

Hi all,

I need to place the contents of an internal table to the application server.

I have the file path.

can anybody tell me in which modes i have to open the dataset and the procedure for doing it.

Thanks,

Praveena.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
599

Hey praveena

U need to write pice of code for this.

Try This transaction. CG3Z or CG3Y(ANY one will these tcode used to upload data to App. server.

Reward me its helpful

Ravi

5 REPLIES 5
Read only

Former Member
0 Likes
599

data p_file(128) type c.

open dataset p_file for output in text mode .

loop at uritab.

transfer to p_file

endloop.

close dataset p_file

Read only

Former Member
0 Likes
600

Hey praveena

U need to write pice of code for this.

Try This transaction. CG3Z or CG3Y(ANY one will these tcode used to upload data to App. server.

Reward me its helpful

Ravi

Read only

former_member196280
Active Contributor
0 Likes
599

data file(128) type c value 'file.txt'.

open dataset file for output in <b>text</b> mode .

loop at <itab>."where your data is in

transfer itab TO file

endloop.

close dataset file .

Reward points to all useful answers.

Regards,

SaiRam

Read only

Former Member
0 Likes
599

hi Praveena,

do this way ...


*   Download internal table to Application server file(Unix)
DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.      

  open dataset e_file for output in text mode.
  lOOP AT it_datatab......
    transfer it_datatab to e_file.
  ENDLOOP.
 
  close dataset e_file.

CG3Y - to download file from application server.

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

Regards,

Santosh

Read only

Former Member
0 Likes
599

Hi Praveena,

Find the code below which explains the sytax to put data into the application server. Here "P_FILE2" is a parameter which would contain the name of the file in application server.

Name of the internal table is it_main1 here all the fields are converted into the text format and "TRANSFER" syntax is used.

-


OPEN DATASET p_file2 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

MESSAGE text-015 TYPE 'E'.

ENDIF.

LOOP AT it_main1 INTO x_main1.

TRANSFER x_main1 TO p_file2.

ENDLOOP.

CLOSE DATASET p_file2.

-


Reward points if useful.

Thanks,

Tej..