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

How to down load the output of smart form into .XLS(spreadsheet) File.

Hi All,

We have one requirement like we need to down load the output of smart form into .XLS(spreadsheet) File.

This output is related to Shipment(VT03N) in the output we are not displaying the any logo.

Just we are displaying the address and item detail.

Anyone tell me, If possible please let me know how can solve that problem.

Thanks and regards,

Amjad Hussain,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 02:26 PM

    Hi Amjad,

    for that you have to use dataset.

    Refer this code.

    Concatenate the file path retrived from the function module

    with additonal directory 'mm/ptpi006/in/' and pass it to a

    variable.

    CONCATENATE lv_fname c_const INTO pv_input_file.

    CONCATENATE lv_fname c_const pv_flext INTO lv_file.

    lv_dsn = lv_file.

    Open Dataset

    OPEN DATASET lv_dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.

    IF sy-subrc NE 0.

    File not found

    MESSAGE e503.

    ELSE.

    Read each line from the dataset and append to an internal table.

    DO.

    IF sy-subrc NE 0.

    No records found in the file.

    MESSAGE e504.

    ENDIF.

    Read dataset and pass it to an internal table.

    READ DATASET lv_dsn INTO lv_line.

    CLEAR wa_eord.

    wa_eord-matnr = lv_line+0(18).

    wa_eord-werks = lv_line+18(4).

    wa_eord-vdatu = lv_line+22(8).

    wa_eord-bdatu = lv_line+30(8).

    wa_eord-lifnr = lv_line+38(10).

    wa_eord-ekorg = lv_line+48(4).

    wa_eord-meins = lv_line+52(3).

    wa_eord-autet = lv_line+55(1).

    wa_eord-feskz = lv_line+56(1).

    IF NOT wa_eord IS INITIAL.

    APPEND wa_eord TO pr_eord.

    ENDIF.

    ENDDO.

    Close Dataset .

    CLOSE DATASET lv_dsn.

    ENDIF.

    Also,

    check this.

    GUI_DOWNLOAD or WS_DOWNLOAD wont work for application server.

    The above FM are for presentation server

    Use following code as example for download to application server:

    code

    DATA: file TYPE string VALUE `flights.dat`,

    wa TYPE spfli.

    FIELD-SYMBOLS TYPE x.

    OPEN DATASET file FOR OUTPUT IN BINARY MODE.

    SELECT *

    FROM spfli

    INTO wa.

    ASSIGN wa TO CASTING.

    TRANSFER TO file.

    ENDSELECT.

    CLOSE DATASET file.

    [/code]

    kindly reward if found helpful.

    cheers,

    Hema.

    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.