11-22-2005 6:19 AM
Hi all ,
I need to create a Dir and some sample files within it for some testing purpose,can any body tell me how to do it?(I follow al11 GUI options but its giving some error)
Or
Is there any FM by which we can do it directly to application server????
Its urgent requirement..
Thanx in advance
11-22-2005 6:34 AM
to create a file in appl server you have to use open dataset and close data set..
see the sample code
REPORT zanid_test MESSAGE-ID zz .
*
parameters: FULLPATH(128) obligatory lower case
default 'E:\usr\sap\put\file.txt'.
*you change the appl sever path as per your config.
DATA : BEGIN OF list_asc OCCURS 0,
msg(300) TYPE c,
END OF list_asc.
*
start-of-selection.
*---populating data
list_asc-msg = 'abcdefghijkl'. "your sample data
append list_asc.
list_asc-msg = 'faagoaagiagig'. "your sample data
append list_asc.
*
OPEN DATASET fullpath FOR OUTPUT IN TEXT MODE.
LOOP AT LIST_ASC.
TRANSFER LIST_ASC-MSG TO fullpath.
CLEAR LIST_ASC-MSG.
ENDLOOP.
CLOSE DATASET fullpath.
now if you go to appl server , you will find that file in that specified path..
to create a directory yu can go to transaction AL11 and click the 'konfigurieren'button, you then you can specify the directory attibutes to create a directory
and to load a file from your loacl pc to appl server you can use transaction CG3Y also, instead of the abap code.
plz rewrad points if it helps you.
03-11-2009 5:40 PM
How would I be able to get this file on the application server on to the presntaion server through the program directly. I have used open and closed data set to get the data on my application server but I need to get it from the application server to the prsesnation serevr directly through my program so that it can be easily seen by the users.
when 'X'. "X is application server
* TRANSLATE p_err USING '\/'." correct slash for unix
open dataset p_err2 for output in text mode encoding default.
if sy-subrc = 0.
loop at t_err into s_dls.
transfer s_dls to p_err2.
if sy-subrc ne 0.
message i010(ad) with p_err2 'Download Failed'.
endif.
endloop.
close dataset p_err2.
Is theer a way to use transaction CG3Y in my program by calling it and giving the application server file name as source file name and presention serevr file name in my destination file and it will directly run and bring in the file on the application serevr, or is sther any other way wherin I can bring in that application server file on to presentaion server file directly through my program.
Thanaks
03-11-2009 5:45 PM
03-11-2009 10:04 PM
How do I use this function module and where in my code part so that it automatically comes to a particular file location , never used it before.
open dataset p_err2 for output in text mode encoding default.
if sy-subrc = 0.
loop at t_err into s_dls.
transfer s_dls to p_err2.
if sy-subrc ne 0.
message i010(ad) with p_err2 'Download Failed'.
endif.
endloop.
close dataset p_err2.
.
else.
Thanks
03-11-2009 10:08 PM
And can I set this in the background itself so wafter the job is done it automatically transfers all the file there in the P drive after getting it from the application server.
11-22-2005 6:35 AM
11-22-2005 7:32 AM
Hi
Go to Al11 and in that you can see a tab Configure.
There you can create the Directory and say Add button
and then Save .
and after that Using
Open Data set ds1 for Output.
will create the File if it is not there .
you can specofy the path in which you can create the files.
you are telling it for Testing Purpose then Go for Dir_TMP
there you can create and test.
Regards
vijay
11-22-2005 9:09 AM
Hi,
or try that:
DATA: COMMAND(200).
DATA: BEGIN OF TABL OCCURS 0,
LINE(255),
END OF TABL.
command = 'mkdir /home/testdir1'.
CALL 'SYSTEM' ID 'COMMAND' FIELD COMMAND ID 'TAB' FIELD TABL-SYS.
regards Andreas
11-22-2005 7:39 AM
Hi
OPEN DATASET statement helps you to create a file..
NOTE:The file will be created at the appln server level..
Regards,
Abdul