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

how to download the data which is in the table?

how to download the data which is in the table?

every field data in the table i want to download and once the download is finished then i have to set the flag as 'download is finished ' as one field in table?

can any one help me in this.

Phani.

Edited by: phani kumarDurusoju on Jan 9, 2008 6:36 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 06:37 AM

    what u r asking i dint get. if u want to down load data of a table to a note pad or any document then create a program in that create an internal table with the table stucture and using GUI_DOUWNLOAD u can down load that data to a text document.

    is this u r asking.

    regards,

    pavan jhawar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 06:47 AM

    Downloading a table data is very easy..

    Just go to transaction SE16N

    Enter the table name,clear the No of Hits field to get complete download and Execute.(here you can also mark/unmark the fields you want to see in the o/p).

    You wil see the complete data of the table.

    In the very same window,you have a button called Export usinfg which you can download this data to what ever the file format you want to download to.

    Alternatively,you can go to SE11 ,enter the table name and execute.You can download the data in MS Excel.

    Reward Points if helpful

    Regards,

    Bhavin P Shah

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 09:25 AM

    One way is to Download the data Directly from the database table using the path SE11->Give table name ->Execute -> system ->List ->Save ->Local File

    There u can downlaad the data .

    The ither way is to use the code

    The Following Code will be helpfull to You

    Data :ITAB TYPE TRUXS_T_TEXT_DATA,

    FILE TYPE STRING.

    C_ASC TYPE CHAR10 VALUE 'ASC',

    DATA: L_STATUS TYPE C,

    L_MESSAGE TYPE PMST_RAW_MESSAGE,

    L_SUBJECT TYPE SO_OBJ_DES.

    DATA: L_FILELENGTH TYPE I.

    PERFORM download_to_pc

    TABLES

    itab

    USING

    filename

    c_asc

    c_x

    CHANGING

    l_status

    l_message

    l_filelength.

    FORM DOWNLOAD_TO_PC TABLES DOWNLOADTAB

    USING FILENAME

    FILETYPE TYPE CHAR10

    DELIMITED

    CHANGING STATUS

    MESSAGE TYPE PMST_RAW_MESSAGE

    FILELENGTH TYPE I.

    DATA: L_FILE TYPE STRING,

    L_SEP.

    L_FILE = FILENAME.

    IF NOT DELIMITED IS INITIAL.

    L_SEP = 'X'.

    ENDIF.

    STATUS = 'S'.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    FILENAME = L_FILE

    FILETYPE = FILETYPE

    WRITE_FIELD_SEPARATOR = L_SEP

    IMPORTING

    FILELENGTH = FILELENGTH

    TABLES

    DATA_TAB = DOWNLOADTAB

    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.

    STATUS = 'E'.

    CASE SY-SUBRC.

    WHEN 1.

    MESSAGE = 'gui_download::file write error'.

    WHEN 2.

    MESSAGE = 'gui_download::no batch'.

    WHEN 3.

    MESSAGE = 'gui_download::gui refuse file transfer'.

    WHEN 4.

    MESSAGE = 'gui_download::invalid type'.

    WHEN 5.

    MESSAGE = 'gui_download::no authority'.

    WHEN 6.

    MESSAGE = 'gui_download::unknown error'.

    WHEN 7.

    MESSAGE = 'gui_download::header not allowed'.

    WHEN 8.

    MESSAGE = 'gui_download::separator not allowed'.

    WHEN 9.

    MESSAGE = 'gui_download::filesize not allowed'.

    WHEN 10.

    MESSAGE = 'gui_download::header too long'.

    WHEN 11.

    MESSAGE = 'gui_download::dp error create'.

    WHEN 12.

    MESSAGE = 'gui_download::dp error send'.

    WHEN 13.

    MESSAGE = 'gui_download::dp error send'.

    WHEN 14.

    MESSAGE = 'gui_download::ubknown dp error'.

    WHEN 15.

    MESSAGE = 'gui_download::access denied'.

    WHEN 16.

    MESSAGE = 'gui_download::dp out of memory'.

    WHEN 17.

    MESSAGE = 'gui_download::disk full'.

    WHEN 18.

    MESSAGE = 'gui_download::dp timeout'.

    WHEN 19.

    MESSAGE = 'gui_download::file not found'.

    WHEN 20.

    MESSAGE = 'gui_download::dataprovider exception'.

    WHEN 21.

    MESSAGE = 'gui_download::control flush error'.

    WHEN 22.

    MESSAGE = 'gui_download::Error'.

    ENDCASE.

    ENDIF.

    ENDFORM. "download_to_pc

    At The End Reward points.

    Please it's Required.

    Thanks ,

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 10:56 AM

    Hi

    To download from SAP to Excel:

    Many SAP reports have direct download function to EXCEL.

    SAP Query and SAP QuickViewer are excellent tools for Downloading (BvdR AO).

    Transaction SE16N allows you to access any sap table and download result to Excel

    SAP RFC functions can be called directly from Excel / VBA.

    with regards,

    sowjanya.gosala.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 11:03 AM

    Hi Phani,

    Do you want to download data directly from a table or do you wanna write a program for this?

    If you just want to download data directly from a table, follow the steps below:

    1. Goto transaction SE16N

    2. Enter the table Name and Click on Number of Entries button

    3. If the Number of Entries is Greater than 60,000

    Change the value in Maximum no. of hits to a value less than 60,000 (This is because an excel sheet can store a max. of 60,000 entries. Hence, data needs to be extracted in different parts)

    Else

    Leave Maximum no. of hits blank. (Don't give anything in that field; the default value will be 500; just remove that)

    4. Press F8 or execute button on the Menu Bar.

    (Data will be displayed in Grid format)

    5. Press "Export" button in the menubar displayed on top of the grid display

    6. A Dialog box will be displayed. Here, select local file (in .xls format)and choose the file name and location where the data needs to be stored.

    7. Press Enter.

    If a Program needs to be created:

    1. Specify the table name under data declaration part.

    tables: <tabname>

    2. Declare the internal table.

    Data: <itab> LIKE <tabname> OCCURS 0 WITH HEADER LINE.

    3. Fetch data into the internal table using the select query:

    Select * from <tabl> into table <itab>.

    4. Call Function GUI_DOWNLOAD by specifying the internal table name and name of the file where the data needs to be stored.

    Hope this solves your doubt.

    Reward points, if useful.

    Regards,

    Shiny

    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.