Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

file creation

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

AL11 is the tcode to see all the sequential file s stored in applicationserver...

Former Member
0 Kudos

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>

former_member404244
Active Contributor
0 Kudos

Hi,

go to AL11 and give ur path name '\tmp\rakesh' and check.It might store in tmp directory.

Regards,

Nagaraj

varma_narayana
Active Contributor
0 Kudos

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>

Former Member
0 Kudos

hi

u r not storing the data into an internal table...

actually wht is ur requirement?

Former Member
0 Kudos

Transaction AL11 can help you out.

Regards,

Sai

Former Member
0 Kudos

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,