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

problem with pathname while creating file with OPEN DATASET

Hi All,

I have to create a file into a folder in a directory using OPEN DATASET.

here is the problem...when enteing path name during the execution of the progrm with slash (/) then it is giving error says that the can not be created.

for ex: if the path is /test/new/org.txt then it is throwing error.

Please advise how to handle with '/'.

Thanks,

Madhu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jan 17, 2012 at 03:37 PM

    How do you know that the slash is the problem? Does the target directory exist at all on the application server? Is there available space? Authorizations? Did you observe exact lower and upper case spelling?

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2012 at 04:03 PM

    what i understand from your question is you want to create the directory(folder) inside another directory first and then create a file inside the newly created directory. is it correct?

    the portion where you are going wrong is open dataset is for file not for directory.

    you can use fm WBMR_CREATE_APPL_FOLDER to create folder in app server or check the below thread to call OS command directly

    once done.. then you go for open dataset with the file path

    hope this helps

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17, 2012 at 03:20 PM

    Hi MAdhu

    When using PATH as /test/file.txt system is writing exaclty on this path. And first thing is system show have access to this folder.

    Usually it is better use full path when writting

    Best regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2012 at 06:08 PM

    Hi Madhu,

    parameter:filenme1 TYPE rlgrap-filename.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filenme1.

    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

    EXPORTING

    directory = '\tmp'

    • FILEMASK = ' '

    IMPORTING

    serverfile = filenme1

    EXCEPTIONS

    canceled_by_user = 1

    OTHERS = 2

    .

    using the above code, for the parameter filename1 you can give the f4 search-help ,which will take you to the exact directory in AL11.

    but your required directory should be specified in the field directory = ' ' . """"""""""""""""""

    note:directory = '.' is mandatory with in the function """"""""""""'""

    this might help you.

    Edited by: Ambika KS on Jan 18, 2012 7:11 PM

    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.