2013 Dec 12 1:39 PM
Hi,
I have a logical path ( ZLPATH ), logical file (ZFILE) and physical path ( ZPPATH) defined in the system via T.Code FILE.
Physical path do exist on the windows server [ \\pqrs\SID ].
Now I want to create a ABAP program, which will use logical path or logical file and create a test file in Physical path ( ZPPATH )
I know there is functional module FILE_GET_PATH but I don't know how to use it to create test file on server in Physical Path.
Please let me know if anybody has ABAP code for such thing?
Regards,
Arpit.
2013 Dec 12 2:00 PM
Hi Arpit,
Take a look at the ABAP statement OPEN DATASET, it's pretty easy from there.
Edit: Or the class CL_GUI_FRONTEND_SERVICES if your file location is not on the SAP server (from the example you gave I assume it is).
Regards,
Nick
2013 Dec 12 2:18 PM
Hi,
OPEN DATASET will create the file if it does not exits in the path you provide.
TRANSFER will write in the file.
CLOSE DATASET will finish the writing process in the opened file.
Martin
2013 Dec 12 2:55 PM
Some links you should read:
Using Logical Files in ABAP Programs (SAP Library - ABAP Programming (BC-ABA))
HTH,
Neal
2013 Dec 12 3:24 PM
Hi Neal,
I already gone through those link but I am not ABAP programmer so I could understand little.
Is there any standard code available ?
Regards,
Arpit
2013 Dec 13 1:39 AM
How are you going to use it if you are not a coder? If I give you standard code, you've got to add it to a program. That requires a coder, doesn't it?
So, Nick suggested the "Standard code" class CL_GUI_FRONTEND_SERVICES. I could pick out a piece of code that uses it and give it to you. But you'd then have to adapt it to your program. You must feed it the correct parameters with the correct context that are filled the correct way. These are the adaptations that I am talking about. How will you do this without an ABAP programmer?
Neal
2013 Dec 13 1:50 AM
Hi ,
Check this it may be useful..
Steps to create logical path and logical file in TCode FILE
1. Open transaction FILE and click on Logical File Path Definition -> New Entries
2. Enter name of New Logical Path and Save
It will ask a Transport Request to save.
3. Now select the newly created Logical Path and double click on ‘Assignment of Physical paths to
Logical path’
4. A new screen appears to select the syntax group. Click on New Entries.
5. Enter the syntax group and Physical path as below:
This physical path corresponds to the path in AL11 where we need to store our file.
Please note that tag <FILENAME> is mandatory.
Click on save and go back to the initial screen.
6. Now we need to set the Logical File.
Double click on ‘Logical File name definition, Cross client’ and click on New Entries
7. Give name for Logical file and enter the converted file’s name in LSMW in Physical file column.
Give Logical Path previously created in the Logical Path column. And save.
8. While specifying files in LSMW, use the logical path and logical file names.
And save.