‎2012 Jan 17 3:16 PM
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.
‎2012 Jan 17 3: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
‎2012 Jan 17 3: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
‎2012 Jan 17 3: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
‎2012 Jan 17 4: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
‎2012 Jan 18 6: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