Skip to Content
author's profile photo Former Member
Former Member

File Handling

Dear All,

Please help me in below topic:

I have to create one text file through my Report and load it to given logical path. How to do it?

Thanks in advance,

Prasad

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 12:03 PM

    Hi,

    You can write a report to create a text file...guess that will be nothing hard..Then use the function module WS_FILENAME_GET to get the file and load it in the path. This is one way to get this done.

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 12:08 PM

    hiPrasad,

    select the data from SAP tables whuch ever u want to download into the file.

    use the fm GUI_DOWNLOAD to put the data into the specified file.

    to get the file from presentaion server use fm WS_FILENAME_GET

    <b>Reward points if useful</b>

    Chandra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 12:11 PM

    I want the FM name to load the file on given logical path

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 12:24 PM

    hi

    i think u can use CG3Z transaction for downloading file to application server

    and CG3Y for presentation server...

    there u can specify both source patha and target path...

    hope it helps..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 12:27 PM

    hi,

    create a internal table and using select populate data into that table

    and use Gui_download fm for downlaoding data n WS_FILENAME_GET for selecting path for download

    as

    data: p_file type rlgrap-filename.

    CALL FUNCTION 'FILENAME_GET'

    EXPORTING

    filename = p_file

    title =

    • IMPORTING

    • FILENAME =

    .

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    • BIN_FILESIZE =

    filename = p_file

    FILETYPE = 'ASC'

    • APPEND = ' '

    WRITE_FIELD_SEPARATOR = ' X'

    • HEADER = '00'

    • TRUNC_TRAILING_BLANKS = ' '

    • WRITE_LF = 'X'

    • COL_SELECT = ' '

    • COL_SELECT_MASK = ' '

    • DAT_MODE = ' '

    • CONFIRM_OVERWRITE = ' '

    • NO_AUTH_CHECK = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • WRITE_BOM = ' '

    • TRUNC_TRAILING_BLANKS_EOL = 'X'

    • IMPORTING

    • FILELENGTH =

    tables

    data_tab = itab

    • FIELDNAMES =

    • EXCEPTIONS

    • FILE_WRITE_ERROR = 1

    • NO_BATCH = 2

    • GUI_REFUSE_FILETRANSFER = 3

    • INVALID_TYPE = 4

    • NO_AUTHORITY = 5

    • UNKNOWN_ERROR = 6

    • HEADER_NOT_ALLOWED = 7

    • SEPARATOR_NOT_ALLOWED = 8

    • FILESIZE_NOT_ALLOWED = 9

    • HEADER_TOO_LONG = 10

    • DP_ERROR_CREATE = 11

    • DP_ERROR_SEND = 12

    • DP_ERROR_WRITE = 13

    • UNKNOWN_DP_ERROR = 14

    • ACCESS_DENIED = 15

    • DP_OUT_OF_MEMORY = 16

    • DISK_FULL = 17

    • DP_TIMEOUT = 18

    • FILE_NOT_FOUND = 19

    • DATAPROVIDER_EXCEPTION = 20

    • CONTROL_FLUSH_ERROR = 21

    • OTHERS = 22

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    if helpful reward some points.

    with regards,

    Suresh Aluri.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 18, 2007 at 01:37 PM

    Could anyone tell me what value should be passed to 'has_field_seperator' parameter of FM GUI_UPLOAD, to uplaod text file, having fields seperated by SPACE in internal table?

    Prasad.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 06:20 AM

    Hi Marvin,

    Yes exactly, I want to load data on the application server in text format(*.txt). Do u know the code/FM for this?

    Thanks in advance.

    Prasad

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.