Skip to Content
author's profile photo Former Member
Former Member

OPEN DATASET file not storing

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 10:22 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 10:26 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Posted on Apr 10, 2008 at 10:48 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 01:50 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.