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 file not storing

Former Member
0 Kudos

hi experts!!

i am working on the OPEN DATASET /READ dataset to create/Read files in server and when i debug i can see that successfully create the file and read the same. but when i see it in server drive where i have D:/appl_test(folder to save files) i am not seeing any files saved in the same. can any one please help me why my files are not saving in the folder.i am correctly mentioning the file path to create the files.

plz replye me.

thank you,

mahesh

12 REPLIES 12

Former Member
0 Kudos

Hi,

translate e_file to lower case.
  split fldnam at '|' into table it.
  open dataset e_file for output in text mode encoding default.

  split fldnam at '|' into table it.
*printing the Header line data
  loop at t_fieldcat into s_fieldcat.
    concatenate txtstr s_fieldcat-seltext_l ',' into txtstr.
  endloop.


  if txtstr is not initial.
    concatenate txtstr 'LastUpdate' into txtstr.
    transfer txtstr to e_file.
  endif.
*Printing the data
  loop at i_tab.
    clear txtstr.
    loop at t_fieldcat into s_fieldcat.
      concatenate 'I_TAB-' s_fieldcat-fieldname into txt.
      assign (txt) to <fs>.
      xval = <fs>.
      if xval ca sy-abcde.
        replace all occurrences of ',' in xval with '-' ignoring case.
      endif.
      if xval na sy-abcde and xval is not initial.
        shift xval left deleting leading '0'.
      endif.
      if s_fieldcat-fieldname+0(5) = 'DATE1' or s_fieldcat-fieldname+0(4) = 'CNT1' or
         s_fieldcat-fieldname+0(5) = 'AVLDT'.
        concatenate xval+6(2) '/' xval+4(2) '/' xval+0(4) into txt.
        xval = txt.
      endif.
      concatenate txtstr xval ',' into txtstr.
    endloop.

    transfer txtstr to e_file.
  endloop.

  close dataset e_file.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 10, 2008 4:24 PM

0 Kudos

hi

thanks for replye

i am doing something same as you replyed:

to_file = path.

res = 'Welcome.

OPEN DATASET to_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

TRANSFER res TO to_file.

CLOSE DATASET to_file.

but too its not storing the file 'to_file' in the server.

plz help me.

Edited by: mahesh s on Apr 10, 2008 12:30 PM

Former Member
0 Kudos

PERFORM output_data USING 'filename.txt'.

FORM output_data USING p_file.

DATA: lv_file(100) TYPE c,

lv_wa TYPE <database table>,

lv_output(150) TYPE c.

lv_file = <desitnation>.

CONCATENATE lv_file

sy-datum

sy-uzeit

p_file

INTO lv_file.

OPEN DATASET lv_file FOR OUTPUT IN TEXT MODE.

LOOP AT itab INTO lv_wa.

CLEAR lv_output.

CONCATENATE

lv_wa-field1

lv_wa-field2

INTO lv_output

SEPARATED BY '|'.

TRANSFER lv_output TO lv_file.

ENDLOOP.

CLOSE DATASET lv_file.

MESSAGE i999 WITH 'File downloaded to' lv_file.

WRITE:/ lv_file.

regards

0 Kudos

hi

thanks for replye

i am doing something same as you replyed:

to_file = path.

res = 'Welcome.

OPEN DATASET to_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

TRANSFER res TO to_file.

CLOSE DATASET to_file.

but too its not storing the file 'to_file' in the server.

plz help me.

Edited by: mahesh s on Apr 10, 2008 12:30 PM

0 Kudos

r u sure u checking in the right location...

0 Kudos

Hi Mahesh,

Check the SY-SUBRC value after OPEN DATASET , is it 0??

0 Kudos

ya i checked that and sy-subrc is 0 and when i debug and read the created file its succusfuly creating but when i see at server folder file is not there.do i need to mension any file extentions(.txt,.exl etc)

plz replye

,mahesh

0 Kudos

ya .. i am cheking on the location which i have given at path in program

i checked that and sy-subrc is 0 and when i debug and read the created file its succusfuly creating but when i see at server folder file is not there.do i need to mension any file extentions(.txt,.exl etc)

plz replye

,mahesh

vinod_vemuru2
Active Contributor
0 Kudos

Hi Mahesh,

R u checking in the right path in AL11 transaction?

Use transaction CG3Y to download the file from application to presentation server. U can see the complete data here. In application server(AL11 transaction) it is not possible to view the complete file.

Also after OPEN DATA SET, TRANSFER r u getting sy-subrc as 0? Check these things and revert back in case u need more info.

Also are u giving any file extensions like .xls, .dat, .txt etc.

Thanks,

Vinod.

Edited by: Vinod Kumar Vemuru on Apr 10, 2008 4:20 PM

0 Kudos

THANK YOU VINOD.

i can download the file as you replied.

i am using these statements in a class which interfaces with HTTP and i am processing the class using standard programs RSHTTP90 .

if i do that i am not getting file is saved. your answer help me a lot

let me know if u have any idea on the above.

thank you.

0 Kudos

Hi Mahesh,

I think the path u specified seems to be presentation server path(ur PC). Please check this once more. If it is application server file and if u r able to download the data using CG3Y then there is no way of missing the file. Please check carefully in AL11 transaction with correct path.

Please note that whole file path is case sensitive in case of

application server files. So give the proper file path with proper case and check.

U can use FM RZL_READ_DIR_LOCAL to get the file names in a directory.

Hope this will solve ur problem.

Thanks,

Vinod.

Former Member
0 Kudos

Hi mahesh,

Try to use a path created in the transaction AL11. For example .\. I have many problems with the same case of yours.

One case was that the ERP didn't have access to save in the folder. So I checked in the transaction AL11 the folder ".\" and in this folder the file had created with success.

In other case, the ERP's S.O was Unix, so I needed to use a command of UNIX CMOD '777'.

In all these cases the SY-SUBRC was 0 regarding open dataset command was 0. But ERP had not authorization to save the file.

Kind Regards,

Fernando