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

to download date to server in xls format

hi

i am using below code to download data to application server but its not getting the desired outpurt data is not comming correctly its corrupted

pls suggest code for it

form file_data.

DATA : w_extract(128).

CONCATENATE p_server p_flname p_fltyp INTO

w_extract.

IF NOT it_output[] IS INITIAL.

OPEN DATASET w_extract FOR OUTPUT IN TEXT MODE.

*If unable to open

IF sy-subrc <> 0.

MESSAGE e999(zmm) WITH 'Unable to open file'(009).

ENDIF.

*Transfer the data from internal table

LOOP AT it_output into wa_ty_output_file.

  • INTO wa_output.

TRANSFER wa_ty_output_file TO w_extract.

IF sy-subrc <> 0.

MESSAGE e999(zmm) WITH 'File not Transfered'(011).

ENDIF.

ENDLOOP.

ENDIF.

*For Close dataset.

CLOSE DATASET w_extract.

endform. " file_data

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jul 19, 2008 at 12:50 PM

    Hi Nishant,

    Why are u issuing arror message after transfer is success. Change this condition. It will work fine.

    LOOP AT it_output into wa_ty_output_file.

    INTO wa_output.

    TRANSFER wa_ty_output_file TO w_extract.

    IF sy-subrc 0.

    IF NOT sy-subrc IS INITIAL.

    MESSAGE e999(zmm) WITH 'File not Transfered'(011).

    ENDIF.

    Thanks,

    Vinod.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 18, 2008 at 01:57 PM

    Hi,

    How is the file corrupted? Can you paste a piece of it?

    Cheers,

    Marco Monteiro

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 01:47 PM

    problem solved

    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.