‎2009 May 06 7:53 AM
Hi,
In my program i want to define file path in application directory. using that file i want to upload the records as per my requirement.
I want to open and close that file in every time, but open time the file should be initial. how to write the code...please help me.
‎2009 May 06 8:00 AM
‎2009 May 06 8:00 AM
‎2009 May 06 8:02 AM
The AL11 File path i need to define in my program.
how to write the coding.....
‎2009 May 06 8:03 AM
Hi,
Open Dataset.
loop at table
Transfer work area.
endloop.
Closedataset.
If u open the same file then for every opening data in file will be cleared and new data wil transfered to file
If u want to dine new path then,
Goto Tcode -- > FILE, there u can create new file path.....
Kiran.
Edited by: kiran vempati on May 6, 2009 9:03 AM
‎2009 May 06 8:03 AM
Hi,
To access the Application server directory using AL11 tcode. and the file will be created by tbe basis people.
In the program write the below code
Open dataset p_file for input encoding default (in ECC version)
you can write the code
transfer the data from internal to application server
Close dataset
Regards
Ramakrishna Pathi
‎2009 May 06 8:07 AM
Hello,
all the application files r stored in AL11 tcode...
to open those
OPEN DATASET
for delate
DELETE DATASET
for transfer
TRANSFER DATA...
Thanks
Jay........
‎2009 May 06 8:13 AM
Hi ,
To get the file at application server with no data in it each time when u r going for download use stmt
OPEN DATASET.
eg:
OPEN DATASET V_FILE FOR OUTPUT IN BINARY MODE. (where V_FILE is application server path)
IF SY-SUBRC NE 0.
MESSAGE E002 WITH 'Error while opening File'.
EXIT.
ELSE.
*---Data is downloaded to the application server file path
LOOP AT <IT> ."INTO wa_tab2.
TRANSFER <IT> TO V_FILE.
ENDLOOP.
IF SY-SUBRC EQ 0.
MESSAGE S002 WITH 'Data successfully downloded to application server'.
ENDIF.
ENDIF.
CLOSE DATASET V_FILE.
The keyword "FOR OUTPUT" in open dataset indicates that if the specified file already exists, its content is deleted
To append the data u can use "FOR APPENDING".
regards,
ajit.
Edited by: AJIT THAKUR on May 6, 2009 9:17 AM
Edited by: AJIT THAKUR on May 6, 2009 9:18 AM
‎2009 May 06 8:34 AM
Hi,
Use the syntax:
DATA FNAME(60) VALUE 'myfile'.
DATA NUM TYPE I.
OPEN DATASET FNAME FOR OUTPUT.
DO 10 TIMES.
NUM = NUM + 1.
TRANSFER NUM TO FNAME.
ENDDO.
CLOSE DATASET FNAME.
If the file does not already exist, it is created automatically. If it does already exist, but is closed,
its contents are overwritten. If the file exists and is already open (for read or write access, or for
appending), the position is reset to the beginning of the file. If the system can open the file
<dsn> successfully, SY-SUBRC is set to 0. If not, it is set to 8.
‎2009 May 06 11:25 PM
Santosh,
Is this what you are looking for
PARAMETERS: p_file(128) MODIF ID 001.
declare a parameter that opens Application server.
and then use FM
F4_DXFILENAME_TOPRECURSION
to get the file path from the search directories.
Regards,
ARS