Skip to Content
avatar image
Former Member

file creation

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Aug 22, 2007 at 10:57 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 10: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>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 10:59 AM

    Hi,

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

    Regards,

    Nagaraj

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 22, 2007 at 11:00 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 11:01 AM

    hi

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

    actually wht is ur requirement?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 11:02 AM

    Transaction AL11 can help you out.

    Regards,

    Sai

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 11:11 AM

    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,

    Add comment
    10|10000 characters needed characters exceeded