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

Open Dataset is returning sy-subrc of 8!

Hello All,

I am running the program RSEINB00 to process an inbound file but getting an error at the open dataset statement in the below code. I had checked all the conentions and standards and they are correct. What are the possible reason of getting an error. I am getting sy-subrc of 8 after trying to open the file.

form open_dataset_for_input
   using  l_filename    type edi_path-pthnam
          l_os_message  type t_os_message
          l_unicode     type edi_unicod
          l_repchar     type edi_repchr
          l_rc          type sy-subrc.

clear l_rc.
if l_unicode = c_true.
    catch system-exceptions convt_codepage_init = 9.
    open dataset l_filename for input in text mode encoding utf-8
       replacement character l_repchar message l_os_message.
    l_rc = sy-subrc.
    endcatch.
  else.
    catch system-exceptions convt_codepage_init = 9.
    *open dataset l_filename for input in text mode encoding non-unicode*
      *replacement character l_repchar message l_os_message.*
    l_rc = sy-subrc.
    endcatch.
  endif.
  if sy-subrc = 9.
    l_rc = sy-subrc.
  endif.

endform.                    " open_dataset_for_input

Here are the input values I am passing to the program RSEINB00.

*
w01dvec02\sbxedi\chgbck01*

ZCLR

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2008 at 03:37 PM

    This means the user has no authority to open the Doc.

    Please check with the basis team.

    sy-subrc Description 
    0 File was opened. 
    8 Operating system could not open file

    Amandeep

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2008 at 03:38 PM

    I will tell you more about INPUT and OUTPUT:

    Input: The addition FOR INPUT opens the file for reading. By default, the file pointer is set at the start of the file. If the file specified does not exist, sy-subrc is set to 8.

    regards,

    venkat.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2008 at 03:43 PM

    Either the file does not exist or U don't have authorization to read the file ...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 05, 2014 at 02:45 PM

    Hi ALL,

    I was facing the same issue.

    Then I converted parameter like this.

    PARAMETERS: filename(200) TYPE c DEFAULT '/tmp/test1.xml' LOWER CASE.

    So, open dataset was able to find the file.

    Thank you.

    Bing

    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.