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: 

open dataset

Former Member
0 Kudos

hi all,

i am doing a program which has to save the text file in the application server. can u tell me how to locate the file after it is been saved to the server. so that i can check whether it is saved correctly or not.

10 REPLIES 10

Former Member
0 Kudos

Goto transaction <b>AL11</b> then choose the file path u gave example

interface/...

U can go and check like this.

Also sample code for downloading to unix

DATA: v_filepht LIKE FILENAME-FILEINTERN, "Physical file for p_fnam2

* Open the file in application server
  OPEN DATASET v_filepht FOR OUTPUT IN TEXT MODE.
  IF sy-subrc <> 0.
    MESSAGE s185 WITH v_filepht.           " File opening error
    LEAVE LIST-PROCESSING.

  ENDIF.

   LOOP AT i_logfile INTO w_logfile.
    TRANSFER w_logfile TO v_filepht.
    CLEAR w_logfile.

  ENDLOOP.

   IF sy-subrc = 0.
    WRITE:/ text-055, v_filepht, text-056. " File successfully created
  ELSE.
    WRITE:/ text-057, v_filepht.           " Error creating file
  ENDIF.

 * Closing the file

  CLOSE DATASET v_filepht.

Hope this helps.

andreas_mann3
Active Contributor
0 Kudos

Hi,

fm EPS_GET_DIRECTORY_LISTING

or fm EPS_GET_FILE_ATTRIBUTES

regards Andreas

Former Member
0 Kudos

hi all,

first of all i am trying to print the values in presentation server. i have to save the values in a .txt file. i been able to get the values in a text file but i am not able to get the tabs. and also the titles should be aligned. can somebody help me in this.

0 Kudos

Hi,

do you need to save the file in txt format?

can you use a Excel format?

If yes, you can use the function module XXL_SIMPLE_API to export the data in data sheet, in this way you don't care about title, and layout.

bye enzo

0 Kudos

hi all,

i have to strictly download the file in '.txt' format. i am able to get the file saved. i need to save it as cols and rows. please suggest me if u know.... thanx for ur valuable time and suggestions.

Message was edited by: Ateeq K

0 Kudos

Hi

You can save your file as CSV format using ; to separate the field of cols.

Max

0 Kudos

let me understand your requirement.

you have a internal table which you want to store it in application server and when you read it back download it to presentation server it should be openable in excel right?

and also you wanted to download it in presentation server only with .txt extension.

if yes just try this,

data: temp type string .

loop at itab .

clear temp .

concatenate itab-field1 CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

itab-field2

CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

itab-field3 into temp .

concatenate temp CL_ABAP_CHAR_UTILITIES=>CR_LF into temp .

" now transfer tem instead of the itab work area to dataset

when you read this and download it using gui_download you can download it as .txt file but still be able to open it in excel with proper coloumn row formatting. (what i have done is created excel text tab delimited file).

Hope this helps.

Regards

Raja

0 Kudos

hai raj,

let me tell u clearly, i have to download the file in application server. first i am verifying it is saved properly or not in the presentation server... after that i gonna move the file to application server. the file should be saved in text (tab delimited) file. i am able to get the file saved in text format but the tab delimited part cannot be solved by me...

thanx for ur valuable suggestion and time....one and all

0 Kudos

Hi

You can upload the file, can't you?

Now I don't understand which is your true problem: you can't write a file with the right tab or you can't interpret the tab when you're reading the file?

Max

Former Member
0 Kudos

HI Ateeq

to find a file on applicatoin server (the server it self) you can use some function module eg.

F4_DXFILENAME_TOPRECURSION

F4_FILENAME_SERVER

bye enzo