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

regardon file down laoding to application server

Former Member
0 Likes
970

Hi all,

i doveloped one program .

this program will generate output list .

i want to save that list in Application server as it is.

can anycody tell me the process for this.

or

is there any FM for this?

10 REPLIES 10
Read only

Former Member
0 Likes
941

Hi,

If your program generates a list output and you want to place that file in Application server then you need to create a folder (i.e path for application server ) . In that you can create files using OPEN DATASET file_name FOR OUTPUT IN TEXT MODE.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 5:09 PM

Read only

Former Member
0 Likes
941

Hi,

Adding to the previous reply , use al11 transaction to view the files in application server.

Regards,

Nisrin.

Read only

0 Likes
941

hiiiii,

i understand but we can send internal table .

in my output list i have alv display with list header.

my outputlist will consist the follwong

some derader

no of error rec

no od success rec

job started time

job ended time

now internal table display.

so according to u r mail i can display only internal table

i cont display header details.

i want entaire list in application server

Read only

Former Member
0 Likes
941

Hi,

You need to follow the following steps.

1.) Open the file using command OPEN DATASAET where you want to write the file in application server.

2.) Once file is opened loop at your internal table and move the data to the applicaation server using command TRANSFER DATASET.

3.) Once all data is transferred close the loop and use command CLOSE DATASET.

Once this is done, you can see your file on application server using tcode AL11.

Hope this answers your questions.

Regards,

Lalit Kabra

Read only

Former Member
0 Likes
941
Read only

former_member842213
Participant
0 Likes
941

f_path2 - application server path name ( /sap/asdf.txt')

t_table - your internal table

open dataset f_path2 for output in text mode encoding default.

if sy-subrc = 0.

loop at t_table into wa_table.

transfer wa_table to f_path2.

endloop.

endif.

Read only

Former Member
0 Likes
941

hii

you can write & read file on application server by using following code



DATA FNAME(60) VALUE 'myfile.txt'.

OPEN DATASET FNAME FOR OUTPUT in text mode encoding default.
LOOP AT TAB INTO LIN.
  TRANSFER LIN TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.

OPEN DATASET FNAME FOR inPUT in text mode encoding default.
DO.
  READ DATASET FNAME INTO LIN.
  IF SY-SUBRC <> 0.
    EXIT.
  ENDIF.
  WRITE: / LIN-COL1, LIN-COL2.
ENDDO.

CLOSE DATASET FNAME.

<REMOVED BY MODERATOR>

thx

twinkal

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 5:10 PM

Read only

Former Member
0 Likes
941

Hi ,

check this Function module SAP_CONVERT_TO_TXT_FORMAT.

This will help you a lot .

Read only

Former Member
0 Likes
941

Hi,

The files on application server only hold the data. The other parameters that you are displaying in output like the no.of success records and some header info need not be written into file. Please consult your functional and technical lead to confirm the requirement.

Read only

Former Member
0 Likes
941

If the list headers are constant.. you can just hard code it.. concatenate it manually using tab operator and write it to the application server at the first time, as first line.

the same filename can be opened in appending mode to transfer the contents of internal table.

Hope this will help!