08-22-2007 11:54 AM
HI,
I created report like this.
REPORT ZCREATEFILE.
TABLES: KNA1.
PARAMETERS:
OUTFILE(20) DEFAULT '\tmp\rakesh' LOWER CASE,
STATE LIKE KNA1-REGIO DEFAULT 'MA'.
DATA: BEGIN OF OUTREC,
KUNNR LIKE KNA1-KUNNR,
REGIO LIKE KNA1-REGIO,
TELF1 LIKE KNA1-TELF1,
END OF OUTREC.
OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE encoding default .
if sy-subrc <> 0.
message e001(z_error).
endif.
SELECT * FROM KNA1 WHERE REGIO = STATE.
MOVE-CORRESPONDING KNA1 TO OUTREC.
TRANSFER OUTREC TO OUTFILE.
ENDSELECT.
CLOSE DATASET OUTFILE.
My question is :
In the selection screen i gave the file name like this:\tmp\rakesh.
where this file stored in appication server.
08-22-2007 11:57 AM
AL11 is the tcode to see all the sequential file s stored in applicationserver...
08-22-2007 11:58 AM
Hi Rakesh,
Firstly, I am not finding any extension for the file that you've created.
Secondly, if you would want to check for that file, use the transaction AL11 and search for the directory <b>tmp</b>. Probablility is that you shall find your file there.
<b>Reward points if this helps,
Kiran</b>
08-22-2007 11:59 AM
Hi,
go to AL11 and give ur path name '\tmp\rakesh' and check.It might store in tmp directory.
Regards,
Nagaraj
08-22-2007 12:00 PM
Hi..Rakesh..
By default the files are stored in a Directory Called GLOBAL on Application Server.
You can See this Directory in Tcode AL11 (DIR_GLOBAL).
It is better if you change the code like this using Internal Table.
REPORT ZCREATEFILE.
TABLES: KNA1.
PARAMETERS:
OUTFILE(20) DEFAULT '\tmp\rakesh' LOWER CASE,
STATE LIKE KNA1-REGIO DEFAULT 'MA'.
DATA: BEGIN OF OUTREC,
KUNNR LIKE KNA1-KUNNR,
REGIO LIKE KNA1-REGIO,
TELF1 LIKE KNA1-TELF1,
END OF OUTREC.
DATA : IT_REC LIKE TABLE OF OUTREC.
OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE encoding default .
if sy-subrc <> 0.
message e001(z_error).
endif.
SELECT KUNNR REGIO TELF1
FROM KNA1 into table it_REC
WHERE REGIO = STATE.
Loop at it_REC into OUTREC.
TRANSFER OUTREC TO OUTFILE.
ENDLOOP.
CLOSE DATASET OUTFILE.
This code gives better performamce since we are not using SELECT *
and we are using ARRAY FETCH .
<b>Reward if Helpful</b>
08-22-2007 12:01 PM
hi
u r not storing the data into an internal table...
actually wht is ur requirement?
08-22-2007 12:02 PM
08-22-2007 12:11 PM
Hi Mr. Rakesh Dhudipala ,
In our Abap by defaultly the files are stored in a Directory on Application Server. You can use the transaction AL11 for (Sap Directories) and search for the directory tmp.
You can find your \tmp\rakesh.
Let me know If u need further help.
Thank you,