Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with pathname while creating file with OPEN DATASET

Former Member
0 Likes
1,529

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.

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
850

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

4 REPLIES 4
Read only

former_member214857
Contributor
0 Likes
850

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

Read only

ThomasZloch
Active Contributor
0 Likes
851

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

Read only

Former Member
0 Likes
850

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

Read only

Former Member
0 Likes
850

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