Application Development and Automation 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: 
Read only

file creation

Former Member
0 Likes
878

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
Read only

Former Member
0 Likes
829

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

Read only

Former Member
0 Likes
829

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>

Read only

former_member404244
Active Contributor
0 Likes
829

Hi,

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

Regards,

Nagaraj

Read only

varma_narayana
Active Contributor
0 Likes
829

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>

Read only

Former Member
0 Likes
829

hi

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

actually wht is ur requirement?

Read only

Former Member
0 Likes
829

Transaction AL11 can help you out.

Regards,

Sai

Read only

Former Member
0 Likes
829

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,