Open dataset exception not triggered

hello folks i'm having a dump because i can't open the dataset, but
when i use this code
open dataset p_file for output in text mode encoding default message mes.
if sy ne 0.
message mess type E.
endif.
the error is triggered but if i use:
TRY.
       OPEN DATASET p_file FOR OUTPUT
            IN TEXT MODE ENCODING DEFAULT.
     CATCH cx_dynamic_check  INTO gr_err.
       gs_msg = gr_err->get_text( ).
   ENDTRY.
in debug i can see sy-subrc = 8 but the catch is not trigger, i have also try with   cx_sy_file_authority but nothing, i'm in ECC6 unicode.
Regards

hy all thanx for you reply, i've also try to catch all the possible exception like this:
data gr_err TYPE REF TO cx_root,
TRY.
       OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
     CATCH cx_sy_file_open INTO gr_err.
       gs_msg = gr_err->get_text( ).
     CATCH cx_sy_file_authority   INTO gr_err.
       gs_msg = gr_err->get_text( ).
     CATCH cx_dynamic_check  INTO gr_err.
       gs_msg = gr_err->get_text( ).
   ENDTRY.
still nothing catch and sy-subrc still 8.

Similar Messages

  • Open dataset is not working in background in PRD

    Dear All,
    Open dataset is not working in background in PRD .
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Whike running in foregroundits working dev as well as prd.
    but when i am running in background  its giving error like file not found .
    but al11 is working (i mean my file path is working ).
    Thanks N Regards,
    Srinivasa Reddy

    your authority team shall check the batch user of that abap!
    Could you please tell us the detailed error message?
    grx
    Andreas

  • Open Dataset :  File Not Created In The Directory

    Hi Guru's,
    I have a small question, I try  trough my code  to create a file but when I use the "open dataset" nothing produces. I have no errors and in the debug mode the sy-subrc is always to "0".
    w_locdrive    = 'C:\RECON_SUP\'.
    w_rec         = '5499728464709 '.     "AO
    w_mess        = 'RECON_SUP'.
    SELECT /bic/ricr1_003  /bic/ricr1_061
           /bic/ricr1_010 /bic/ricr1_091 /bic/rikr2_001
          INTO CORRESPONDING FIELDS OF TABLE i_2006 FROM /bic/aro_r200600.
    CONCATENATE w_mess '.' w_send '.' w_rec '.' sy-datum sy-uzeit '.txt' INTO w_name.
    CONCATENATE w_locdrive w_name INTO w_path.
    IF i_2006[] IS NOT INITIAL.
      SORT i_2006 BY /bic/ricr1_003.
    *Open my file.
      OPEN DATASET w_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    * Put all records in the file output.
      LOOP AT i_2006 INTO wa_2006.
        w_rikr2_001 = wa_2006-/bic/rikr2_001. " Convert the Volume in char Field.
        CONCATENATE wa_2006-/bic/ricr1_003 ';' wa_2006-/bic/ricr1_061 ';' wa_2006-/bic/ricr1_010 ';'
                    wa_2006-/bic/ricr1_091 ';' w_rikr2_001
                    INTO  w_string.
        IF sy-subrc = 0.
          TRANSFER w_string TO w_path.
          CLEAR w_string.
        ENDIF.
      ENDLOOP.
    Thank you in advance for your help,
    Mohamed.

    Can you try like this
    OPEN DATASET w_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc = 0."<---Add here
    * Put all records in the file output.
      LOOP AT i_2006 INTO wa_2006.
        w_rikr2_001 = wa_2006-/bic/rikr2_001. " Convert the Volume in char Field.
        CONCATENATE wa_2006-/bic/ricr1_003 ';' wa_2006-/bic/ricr1_061 ';' wa_2006-/bic/ricr1_010 ';'
                    wa_2006-/bic/ricr1_091 ';' w_rikr2_001
                    INTO  w_string.
        IF sy-subrc = 0. "<---Remove here
          TRANSFER w_string TO w_path.
          CLEAR w_string.
        ENDIF."<---Remove here
      ENDLOOP.
    endif."<---Add here

  • Exception not triggered after 4 acknowledgement failures.

    Hi,
       I have an FTP Sender, When i am sending the file to FTP site. the send step is defined as throwing send exception and send exception is handled in send exception handler where i cancel the process. The send step is defined with acknowledgement as "Transport".
    I have FTP address wrongly spelt.
    So the BPM tries 4 times, with 5 min duration between retires. Then after the 4tn try i am expecting the send step to throw send exception. It does not do that.
    Could you please let me what changes i have to do to catch this acknowledgement exception.
    I also have a deadline exception. but i dont want this to go into the deadline exception. Can i catch this exception in send exception.
    Regards,
    Vinay.

    Hi,
    In IMG - Materials Management- Purchasing-Messages - Fields relevant to Print out of changes
    Enter Table EKPO , Reference Field LOEKZ, tick on change print relevant for purchase order,in routine enter 03.
    Now your Output will be triggered with a change indicator and you can process it using ME9F.
    Regards
    Chandra Shekhar

  • Open Dataset for XML not reading the XML file, Returning Code 8.

    Dear all,
    Im trying to open an XML file using Open Dataset, since i have to execute this report in background and GUI_upload doesnt work in background.
    The XML file is available in my C:\, say, C:\xmlfile.xml.
    But  the open dataset is not reading any value into the g_xml_line . it is returning sy-subrc = 8.
    Below is my code for that, can anybody help me out to resolve.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_input.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc ne 0.
        WRITE:/ 'invalid file'.
      else.
      DO.
        READ DATASET lv_filename INTO  g_xml_line.
        IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET lv_filename.
       ENDIF.
    TYPES: BEGIN OF t_xml_line,
            data(256) TYPE x,
          END OF t_xml_line.
    DATA: g_xml_table       TYPE TABLE OF t_xml_line,
          g_xml_line        TYPE t_xml_line,
          g_xml_table_size  TYPE i.
    GET REFERENCE OF gt_person INTO gs_result_xml-value.
      gs_result_xml-name = 'IPIX'.
      APPEND gs_result_xml TO gt_result_xml.
    Perform the XSLT stylesheet
      TRY.
          CALL TRANSFORMATION zaum_manh_sync_rpt
          SOURCE XML g_xml_table
          RESULT (gt_result_xml).
        CATCH cx_root INTO gs_rif_ex.
          gs_var_text = gs_rif_ex->get_text( ).
          MESSAGE gs_var_text TYPE 'E'.
      ENDTRY.
    Kindly suggest me a solution. Points assured
    regs,
    raja

    After saving the file , below is the code i wrote, but it gives a runtime error with message
    No roll storage space of length 3788808 available for internal storage.
    ***Coding****
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/DEV/SYS/global/XMLABAP2.XML'.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_file.
      DATA: l_fname TYPE filename-fileintern. " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_file
          filemask         = '*'
        IMPORTING
          serverfile       = l_fname
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    */usr/sap/DEV/SYS/global/substanc
      lv_filename = l_fname.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        WRITE:/ 'invalid file'.
      ELSE.
        DO.
          READ DATASET lv_filename INTO  g_xml_line.
       IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
       ELSE.
         EXIT.
       ENDIF.
        ENDDO.
        CLOSE DATASET lv_filename.
      ENDIF.

  • Lucreate zfs BE dataset does not exist

    Hi guys,
    I'm trying to upgrade a Solaris 10 full zfs with liveupgrade but unfortunatly after one day search and after re-reading all sunDocs I block on and I cannot create a new BE.
    The final objective is to have the server on release 10 10/09 for VDI3.1.1
    If someone get an idea would be so great.
    tks
    Please find here all informations:
    SunOS lima 5.10 Generic_142900-02 sun4v sparc SUNW,Sun-Blade-T6340
    Solaris 10 10/08 s10s_u6wos_07b SPARC
    NAME USED AVAIL REFER MOUNTPOINT
    rpool 15.0G 119G 94K none
    rpool@install 0 - 94K -
    rpool/ROOT 5.83G 119G 18K legacy
    rpool/ROOT@install 0 - 18K -
    rpool/ROOT/s10s_u6wos_07b 5.83G 113G 5.71G /
    rpool/ROOT/s10s_u6wos_07b@install 127M - 5.70G -
    rpool/ROOT/s10s_u6wos_07b@sol10_u8 394K - 5.71G -
    rpool/ROOT/sol10_u8 0 119G 5.71G /.alt.tmp.b-.7.mnt/
    rpool/dump 2.00G 119G 2.00G -
    rpool/export 112K 1024M 20K /export
    rpool/export@install 16K - 20K -
    rpool/export/home 75.5K 1024M 56.5K /export/home
    rpool/export/home@install 19K - 31K -
    rpool/flar 4.38G 3.62G 4.38G /var/flar
    rpool/flar@install 67K - 68K -
    rpool/opt 134M 890M 133M /opt
    rpool/opt@install 200K - 89.0M -
    rpool/tarantella 2.61G 397M 1.11G /opt/SUNWvda
    rpool/tarantella@install 491M - 491M -
    rpool/tarantella/var 1.02G 397M 1.02G /var/tarantella
    Boot Environment Is Active Active Can Copy
    Name Complete Now On Reboot Delete Status
    old yes yes yes no -
    sol10_u8 no no no yes -
    The errors :
    root@ lima #lucreate -n sol10_u8
    Analyzing system configuration.
    Comparing source boot environment <old> file systems with the file
    system(s) you specified for the new boot environment. Determining which
    file systems should be in the new boot environment.
    Updating boot environment description database on all BEs.
    Updating system configuration files.
    Creating configuration for boot environment <sol10_u8>.
    Source boot environment is <old>.
    Creating boot environment <sol10_u8>.
    Cloning file systems from boot environment <old> to create boot environment <sol10_u8>.
    Creating snapshot for <rpool/ROOT/s10s_u6wos_07b> on <rpool/ROOT/s10s_u6wos_07b@sol10_u8>.
    Creating clone for <rpool/ROOT/s10s_u6wos_07b@sol10_u8> on <rpool/ROOT/sol10_u8>.
    Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/sol10_u8>.
    ERROR: cannot open ' ': dataset does not exist
    ERROR: cannot mount mount point </.alt.tmp.b-.7.mnt/opt> device < >
    ERROR: failed to mount file system < > on </.alt.tmp.b-.7.mnt/opt>
    ERROR: unmounting partially mounted boot environment file systems
    ERROR: cannot mount boot environment by icf file </etc/lu/ICF.2>
    ERROR: Unable to mount ABE <sol10_u8>
    ERROR: Unable to clone the existing file systems from boot environment <old> to create boot environment <sol10_u8>.
    ERROR: Cannot make file systems for boot environment <sol10_u8>.

    In fact the /opt were seperated to include this in the / resolve the issue.

  • Err with scheduling an abap program using open dataset

    issue: have an abap program which uses "open dataset ... for input ..." to read the file. 
    - with manual ly running it, receive the following message "dataset_not_open".  
    - with scheduling it, receive same message
    attempting to run an abap program as part of a process chain (ie scheduling a background job) in BI.
    the abap performs the following fxns:
    1) read a file on the server
    2) removes delimiter, renames it
    3) rewrites the file onto the server
    initially used ws_upload for reading and ws_download for writing the file. 
    - both fxns worked fine if it is run manually --> but failed as a  background (part of process chain)
    - note 7925 states can't use ws_upload, download for background jobs
    -so switched to "open dataset"
    Any suggestions as to why the "open dataset" does not work is greatly appreciated it.
    B.A.

    Thank you for all responses. here is more info about the err message:
    sy-subrc = 8
    'invalid argument'
    I looked up the invalid argument in note 99155 --> due to "The destination file is no longer available during repeated file access. "   So, the following steps were taken:
    - file was regenerated and
    - file was placed on the server to be read
    have the following code:
    OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE encoding default
                          MESSAGE D_MSG_TEXT.
    also have tried the following:
       OPEN DATASET d1 for input in text mode encoding default.
       open dataset d1 for output in text mode encoding NON-UNICODE..
       open dataset d1 for output in text mode  encoding utf-8.
    none had worked.  system --> status shows no unicode.
    THanks again for any suggestions.

  • Open dataset for input don't work after upgrade from 46C to 47

    We did an upgrade from 46C to 47, after that all the Z programs that have the sentence "open dataset for input" alwas send a sy-subrc = 8, the curios things is that the sentece "open dataset for output" works ok.
    Please I need help to solve this?
    En example of code.
    PARAMETERS: P_ARCHF(60) OBLIGATORY DEFAULT
                'C:\20050900.txt' LOWER CASE.
    OPEN DATASET P_ARCHF FOR INPUT IN TEXT MODE.
    IF SY-SUBRC <> 0. MESSAGE i001 WITH ARCHIVO. stop. endif.

    Well, it's telling you that the datset doesn't exist. From the help in 4.7:
    OPEN DATASET
    Addition 1a
    ... FOR INPUT
    Effect
    OPEN ... FOR INPUT opens the file in read mode.
    If the file does not exist, OPEN ... FOR INPUT fails with Return Code SY-SUBRC = 8.
    Note
    If OPEN DATASET is not executed in a Unicode program and if the user has write authorization for the file, the file is opened in read and write mode. Otherwise, it is only opened in read mode.
    Rob

  • File not found in shared folder when transferred through Open Dataset

    Dear Experts,
    I am transferring a file to a shared folder using open dataset .
    The sy-subrc value returns as 0 . But i am not able to find the file in the destined path.
    But when i try to retrieve the file from the same path through CG3Y to my local PC ,  i am able to retrieve the file.
    Could you please throw some light into this as to why this is happening.
    With Regards,
    Syed Ibrahim G

    Hi venkat,
    Sorry for the delayed response . The Authority check FM also returns the sy-subrc value 0 .
    But still not able to find the File . I am Trying to paste the data through FTP_R3_To_SERVER . But it is not supporting Non-English Characters. Is there any way to paste the file through FTP ( with Non English Characters ).
    {code}
    call function 'FTP_CONNECT'
       exporting
         user            = user
         password        = pwd
         host            = host
         rfc_destination = dest
       importing
         handle          = hdl.
    if sy-subrc = 0.
       CALL FUNCTION 'FTP_R3_TO_SERVER'
         EXPORTING
           handle               = hdl
           fname                = FNAME
    *      BLOB_LENGTH          =
          character_mode       = 'X'
    TABLES
    *  BLOB                 =
          text                 = it_data1
        EXCEPTIONS
          tcpip_error          = 1
          command_error        = 2
          data_error           = 3
          OTHERS               = 4.
    endif.
    {code}
    With Regards,
    Syed Ibrahim G

  • Open/Transfer/Close Dataset file not downloading

    Hello people apologies if this running rampant for me. I did post this from an attatched topic of mine but im guessing, due to its number or replies, that many people felt that it was pretty much covered. It was but another problem has riseng during my initial question.
    My plan is to download a report in a file, (hopefully in background), as it is. Obviously WS_Download would not work because (1) it doesnt seem to function in background proccessing and (2) the layout is not aligned properly. After checking this out, in this forums as well as other sits, I realized Open Dataset ought to be the best approach. Im not touching the more complex ones yet you because I plan to take this step by step. 
    So far I have searched the net and stuff and decided that I will use WWW_LIST_TO_HTML since I want to download it the way it is. I am also going to use open/close dataset as many of you have mentioned.
    SO far Im just trying it out with a simple report program to see its funcitonalities. My code goes like this.
    <b>REPORT Z**** NO STANDARD PAGE HEADING LINE-COUNT 100 .
    DATA: IFIELDS TYPE TABLE OF W3FIELDS WITH HEADER LINE.
    *DATA: ihtml TYPE TABLE OF w3html WITH HEADER LINE.
    DATA: IHTML TYPE TABLE OF W3_HTML WITH HEADER LINE.
    DATA: BEGIN OF I_TAB OCCURS 0,
    MATNR LIKE MAKT-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    END OF I_TAB.
    SELECT-OPTIONS: SO_MATNR FOR I_TAB-MATNR.
    SELECT MATNR MAKTX
    FROM MAKT
    INTO TABLE I_TAB
    WHERE MATNR IN SO_MATNR..
    LOOP AT I_TAB.
    WRITE: / I_TAB-MATNR,
    I_TAB-MAKTX.
    ENDLOOP.
    CALL FUNCTION 'WWW_LIST_TO_HTML'
    EXPORTING
    list_index = sy-lsind
    TABLES
    HTML = IHTML.
    DATA: FILE TYPE LOCALFILE.
    FILE = '/usr/test.html'.
    OPEN DATASET FILE FOR OUTPUT IN BINARY MODE.
    LOOP AT IHTML.
    TRANSFER IHTML TO FILE.
    ENDLOOP.
    CLOSE DATASET FILE.</b>
    NOw the problem now though is that the file isnt downloading or saving at all. I cant seem to get what is wrong since the path does exist and the this seems the universal way to implement the program. Im guessing the problem lies in the file name, because everything seems to work fine. Hope to hear again soon. Sorry if people have see this twice. Again my sinceriest apologies.

    for example,  open IE,  in the address bar, I enter
    \SXXXXXX
    ,   SXXXXXX is my host name.  I hit enter.  now i see folders, one of which is USR,  then I click on the usr folder and there is my file that I created with your program. 
    Maybe ask your basis person what the host name is.
    Regards,
    Rich Heilman

  • OPEN DATASET FOR OUTPUT IN LEGACY TEXT MODE not working!

    Hi All,
    I need your expertise to help me with my problem.
    The program passed through the code OPEN DATASET ... FOR OUTPUT IN LEGACY TEXT MODE. Then it gave an error message "Error Accessing File /home/sap/sample.txt".
    I would like to know what are the causes of this error. Please explain to me further why the program gives an error message specified above because I'm not familiar in OPEN DATASET.
    Please reply asap since the issue need to be resolved immediately.
    Thanks in advance,
    Carina

    Hi Carmey,
    The Problem will u need toi get Open Dataset Authorisation from ur Basis Team from the Specified Path.
    Regards,
    Morris Bond.
    Reward Points if Helpful.

  • Not able to open Dataset when adding Encoding Default

    Hi Experts,
    I have an urgent requirement . I wanted to make one programs Unicode Complaint
    I had to change the statement
      open dataset gv_string in text mode  for output.
    to
      open dataset gv_string in text mode encoding default for output.
    But after this change the sy-subrc is becoming 8 and not able to open the .Can any one please help
    Thanks
    Arshad

    HI,
    Maybe there is no authorization for you to write the file onto the app.server.
    Check with basis about your authorizations.
    Or could be the directory does not exist.
    Regards,
    Subramanian
    Edited by: Subramanian PL on Jun 27, 2008 1:24 AM

  • Open Dataset for input in BINARY MODE not working after ECC 6.0 upgrade

    Hi All,
    Our requirement is to download an XML file from the application server and there is a customized program to download these files.
    This program uses the statement,  Open dataset ...for input in BINARY MODE
    and it works perfect for 4.7. There were no issues. But, after the upgrade to ECC 6.0 this does not work.
    When the data is read in ECC 6.0 , it is shown in some special characters and it could not be opened with XML editor and the file is not completely downloaded. I read through the forum and tried the following statement as well,
    Open dataset....for input in LEGACY BINARY MODE.
    After this statement, there were no special characters, but there is a blank space introduced before every character.
    Example : TEST(actual)
                      T E S T (After the legacy binary mode)
    Could you please let me know if there is any solution to rectify this problem. Appreciate your help.
    Thanks a million.
    Edited by: Manikd on May 12, 2011 3:52 PM

    But this program was already using BINARY MODE and after upgrade this is not working. I know, it may work in TEXT MODE. However, I cannot change the whole program to TEXT mode now.

  • CG3Z working not open dataset for output

    Hi,
    I am trying to upload data into the application server for which m using the OPEN DATASET statement. My file name is as follows in lowercase.
    p_file = '/usr/upi/out/test_20100220.dat'. TYPE c.
    While trying to execute this i am getting a short dump 'DATASET_NOT OPEN'.
    I tried to upload a file through tcode CG3Z with the same file path and its working fine whereas through the below code its not working at all.
    open DATASET w_filename_unix for INPUT in TEXT MODE ENCODING DEFAULT.
        LOOP AT i_fieldnames INTO wa_fieldnames.
          TRANSFER wa_fieldnames TO w_filename_unix.
        ENDLOOP.
        LOOP AT i_output INTO wa_output.
          TRANSFER wa_output TO w_filename_unix.
        ENDLOOP.
      if sy-subrc NE 0.
        WRITE: 'Error'.
      ENDIF.
      CLOSE DATASET w_filename_unix.
    Please help.
    Regards herwin..

    hii,
    Why is it W_filename...??? it should be p_file ...... after opendataset...

  • Open dataset for file output does not work

    I have the following code
    OPEN DATASET MY_FILE FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
    MY_FILE is a selection parameter for the filename but when I put any file name, say C:\tmp\test.txt, the code does not create the file for writing. If I create the file manually from windows so that I am sure it exists (Right click-> New -> Text File -> test.txt), SAP still does not open the file for writing.
    Am I doing something wrong?
    I have searched the net and the forums but I can't seem to get a useful answer...
    Thanks in advance!
    Kyle

    Hey Prabhu,
    Thanks. I kinda missed this from the documentation:
    The file must be accessible from the application server. You cannot use OPEN DATASET to process files on the current presentation server (whether PC or workstation). The function modules WS_DOWNLOAD and WS_UPLOAD exist for this purpose.
    [http://help.sap.com/saphelp_40b/helpdata/en/34/55cad198482bc0e10000009b38f91f/content.htm]
    Points have been awarded. Thank you.
    Kyle

Maybe you are looking for

  • AR Duplicate invoice number

    Hi From past many years we have been getting duplicate transaction numbers in Oracle AR. Because of this the new invoices get stuck in the interface table(ra_interface_lines_all) with the error Duplicate Invoice Number. To address this we are changin

  • Why can't I insert a 3D pdf file in an InDesign Document?

    I am working on a presentation for a client and need to insert some 3D pdf files to it but I always get an error message from OnDesing. What should I do?

  • Wireless Disconnect Issue

    How big a problem is this? I've been hearing about this issue in forums all over and I'm not sure if it's a widespread issue or an issue only because I've been snooping around on Apple troubleshooting forums. I ask because I'm about to pick up a new

  • Improving effiency on following piece of code?

    Hello I was wondering is there a way in which i can improve the effiency on the following piece of code: public void addShapes(int x, int y, shape s){           if(s instanceof circle){           circle d = new circle();           d.setX(x);         

  • Text variables in query not taken over into univers

    Dear all, We are working with text variables in our SAP BI queries ( &ZVAR001& ) for example, which are translated to 01.2008 02.2008 etc at query execution time. When we build the BO Univers on top of such query, the text variables are not dynamical