09-08-2006 12:48 AM
Hi everybody
I am requested to save data from ABAP to a flat file in a <b>library</b> in OS/400. The name of the library is LEISAP. Searching around, I found out that I can access it using the path /QSYS.LIB/LEISAP.LIB/ and it already has some files. I am able to read the files in this library (for example the file MPSHR01606) using OPEN DATASET FOR INPUT with a filename like /QSYS.LIB/LEISAP.LIB/MPSHR01606.FILE/MPSHR01606.MBR.
But I can not figure out how to create a new file. What I am trying to do is:
OPEN DATASET file
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
where file has the value '/QSYS.LIB/LEISAP.LIB/TEST.FILE/TEST.MBR', but it fails with sy-subrc = 8.
Any idea if it is possible to create a file in a libary in OS/400 from ABAP at all and how?
Thank you
Andreas
09-08-2006 12:52 AM
09-08-2006 12:52 AM
09-08-2006 12:57 AM
If it's not possible, I will have to suggest to save the file somewhere else. But I would like to find out if it's possible to save it in the library or if there any valid reasons (security, whatever) not to do so before throwing in the towel...
Andreas
09-08-2006 12:59 AM
09-08-2006 1:23 AM
09-08-2006 10:57 PM
Hi
Just to update the status: I was able to create file members with OPEN DATASET inside files that already exist. So all I am missing is how to create the files in the library.
Andreas
10-20-2006 2:08 AM
It passed quite some time since my question and I had lost track of the thread, but here is the status:
There is no native way to create the file in the library from ABAP, the only way seems to be by using native OS/400 commands. This can be executed from ABAP too using CALL 'SYSTEM', but in our case we decided to create the files at the OS level so they can be accessed from SAP like any other regular file.
10-20-2006 2:12 AM
Hi Andreas,
Check your aurhorization for creation of new file. You might not have proper access to create a new file.