Uploading CSV file into Webdynpro abap application

Hi all,
Please let me know the process of uploading .csv file in Webdynpro(ABAP) using FILE_UPLOAD UI element.
Thanks
Subathra

Hi,
you can use the following code ..........
assumiing the file cointain tow colums name and age
TYPES :
       BEGIN OF str_itab,
       name(10) TYPE c,
       age(10) TYPE c,
       END OF str_itab.  DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
         i_data TYPE STANDARD TABLE OF string,
         lo_nd_sflight TYPE REF TO if_wd_context_node,
         lo_el_sflight TYPE REF TO if_wd_context_element,
         l_string TYPE string,
         fs_table TYPE str_itab,
         l_xstring TYPE xstring,
         fields TYPE string_table,
         lv_field TYPE string.  DATA : t_table TYPE if_main=>elements_data_tab,
         data_table TYPE if_main=>elements_data_tab.
get single attribute 
wd_context->get_attribute(    EXPORTING      name =  `DATASOURCE`    IMPORTING      value = l_xstring ).
  CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
      in_xstring = l_xstring
    IMPORTING
      out_string = l_string.
SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
Bind With table Element.  LOOP AT i_data INTO l_string.
    SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.   
    READ TABLE fields INTO lv_field INDEX 1.
    fs_table-name = lv_field.   
    READ TABLE fields INTO lv_field INDEX 2.
    fs_table-age = lv_field.    APPEND fs_table TO t_table1.
  ENDLOOP.
  lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
  lo_nd_sflight->bind_table( t_table1 ).
Thanks,
Shaik Shadulla.
Edited by: shaik shadulla on Jul 16, 2009 3:27 PM

Similar Messages

  • Uploading csv file into database using apex

    Dear all
    I am using apex 4 and oracle express 10g, i need to upload .csv file into the database for one of my appls, i have referred discussion forum for solutions, i found also, but some how its not working for me.
    below mentioned is error and the code
    ERROR:
    ORA-06550: line 38, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 38, column 8: PL/SQL: Statement ignored ORA-06550: line 39, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 39, column 8: PL/SQL: Statement ignored ORA-06550: line 40, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 40, column 8: PL/SQL: Statement ignored ORA-06550: line 41, column 8: PLS-00221: 'V_DATA_ARRAY' is not a proc
    Error
    OK
    CODE:
    DECLARE
    v_blob_data BLOB;
    v_blob_len NUMBER;
    v_position NUMBER;
    v_raw_chunk RAW(10000);
    v_char CHAR(1);
    c_chunk_len number := 1;
    v_line VARCHAR2 (32767) := NULL;
    v_data_array wwv_flow_global.vc_arr2;
    BEGIN
    -- Read data from wwv_flow_files
    select blob_content into v_blob_data
    from wwv_flow_files where filename = 'DDNEW.csv';
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    -- Read and convert binary to char
    WHILE ( v_position <= v_blob_len ) LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_line := v_line || v_char;
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    -- Convert comma to : to use wwv_flow_utilities
    v_line := REPLACE (v_line, ',', ':');
    -- Convert each column separated by : into array of data
    v_data_array := wwv_flow_utilities.string_to_table (v_line);
    -- Insert data into target table
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    USING
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4);
    v_data_array(5);
    v_data_array(6);
    v_data_array(7);
    v_data_array(8);
    v_data_array(9);
    v_data_array(10);
    v_data_array(11);
    -- Clear out
    v_line := NULL;
    END IF;
    END LOOP;
    END;
    what i understand from this is system does not identify v_data_array as array for some reasons, please help me.
    initially system was giving error for hex_to_decimal, but i managed to get this function on discussion forum and now it seems to be ok. but v_data_array problem is still there.
    thanks in advance
    regards
    Uday

    Hi,
    Mistakes in your sample I did correct
    Problem 1
    select blob_content into v_blob_data
    from wwv_flow_files where filename = 'DDNEW.csv'; to
    select blob_content into v_blob_data
    from wwv_flow_files where name = :P1_FILE;Problem 2
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    USING
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4);
    v_data_array(5);
    v_data_array(6);
    v_data_array(7);
    v_data_array(8);
    v_data_array(9);
    v_data_array(10);
    v_data_array(11);  to
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    USING
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4),
    v_data_array(5),
    v_data_array(6),
    v_data_array(7),
    v_data_array(8),
    v_data_array(9),
    v_data_array(10),
    v_data_array(11);  And I did create missing table
    CREATE TABLE TABLE_X
        v1  VARCHAR2(255),
        v2  VARCHAR2(255),
        v3  VARCHAR2(255),
        v4  VARCHAR2(255),
        v5  VARCHAR2(255),
        v6  VARCHAR2(255),
        v7  VARCHAR2(255),
        v8  VARCHAR2(255),
        v9  VARCHAR2(255),
        v10 VARCHAR2(255),
        v11 VARCHAR2(255)
      );Regards,
    Jari
    Edited by: jarola on Nov 19, 2010 3:03 PM

  • Uploading/Downloading Files in Webdynpro ABAP

    Hello,
    I am trying to Upload/Download Files in Webdynpro ABAP using the following link:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/UploadandDownloadfilesinWebdynproABAP
    It works fine and the file(either .doc or .txt) gets uploaded successfully. But when I download it ,it is not able to retrieve the contents.
    May be the SAP ECC system does not work with Microsoft Office 2007.
    Please help.
    Thanks.

    I guess it has problem with .doc extension but
      .txt you can read
    and also .docx and .xlsx will provide the content
    it is only this .doc and .xls which will create problem.
    e.g. .docx after downloading will give one .zip file.
    change its extension to .doc or .docx. the content will be there.
    thanks
    sarbjeet singh.

  • How to upload muliple files in webdynpro abap?

    dear team
    any one could you tell me how to upload multiple files in webdynpro  abap with detailed steps?
    and where & what code i have to write?
    kindly give me the solution for this problem
    regards
    sathya

    Please use the forum search!
    Thomas has made an excellent guide about exactly what you require:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
    Cheers, Lukas

  • Getting Issue while uploading CSV file into internal table

    Hi,
    CSV file Data format as below
         a             b               c              d           e               f
    2.01E14     29-Sep-08     13:44:19     2.01E14     SELL     T+1
    actual values of column   A is 201000000000000
                     and  columen D is 201000000035690
    I am uploading above said CSV file into internal table using
    the below coding:
    TYPES: BEGIN OF TY_INTERN.
            INCLUDE STRUCTURE  KCDE_CELLS.
    TYPES: END OF TY_INTERN.
    CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
        EXPORTING
          I_FILENAME      = P_FILE
          I_SEPARATOR     = ','
        TABLES
          E_INTERN        = T_INTERN
        EXCEPTIONS
          UPLOAD_CSV      = 1
          UPLOAD_FILETYPE = 2
          OTHERS          = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    am getting all columns data into internal table,
    getting problem is columan A & D. am getting values into internal table for both; 2.01E+14. How to get actual values without modifying the csv file format.
    waiting for your reply...
    thanks & regards,
    abhi

    Hi Saurabh,
    Thanks for your reply.
    even i can't double click on those columns.
    b'se the program needs be executed in background there can lot of csv file in one folder. No manual interaction on those csv files.
    regards,
    abhi

  • Attach File in WebDynpro ABAP Application

    Hi everyone
    I need your help to attach files in custom WebDynpro ABAP application. Kindly share if there is any sample standard WebDynpro ABAP application or share some sample code.
    Best Regards
    Iftikhar Ali

    This question has been answered in following link.
    [http://forums.sdn.sap.com/thread.jspa?forumID=249&threadID=2137285]
    Regards
    Iftikhar Ali

  • Uploading CSV file into internal table

    Hi,
    I want to upload a CSV file into internal table.The flat file is having values as below:
    'AAAAA','2003-10-11 07:52:37','167','Argentina',NULL,NULL,NULL,NULL,NULL,'MX1',NULL,NULL,'AAAA BBBB',NULL,NULL,NULL,'1',NULL,NULL,'AR ',NULL,NULL,NULL,'ARGENT','M1V','MX1',NULL,NULL,'F','F','F','F','F',NULL,'1',NULL,'MX','MMI ',NULL
    'jklhg','2004-06-25 08:01:57','456','hjllajsdk','MANAGUA   ',NULL,NULL,'265-5139','266-5136 al 38','MX1',NULL,NULL,'hjgkid GRÖBER','sdfsdf dfs asdfsdf 380 ad ased,','200 as ads, sfd sfd abajao y 50 m al sdf',NULL,'1',NULL,NULL,'NI ',NULL,NULL,NULL,'sdfdfg','M1V','dds',NULL,NULL,
    Here I can not even split at ',' because some of the values are having value like NULL and some have values with comma too,
    The delimiter is a quote and the separator is a comma here.
    Can anyone help on this?
    Thanks.
    Edited by: Ginger on Jun 29, 2009 9:08 AM

    As long as there can be a comma in a text literal you are right that the spilt command doesn't help. However there is one possibility how to attack this under one assumption:
    - A comma outside a text delimiter is always considered a separator
    - A comma inside a text delimiter is always considered a comma as part of the text
    You have to read you file line by line and then travel along the line string character by character and setting a flag or counter for the text delimiters:
    e.g.
    "Text","Text1, Text2",NULL,NULL,"Text"
    String Index  1: EQ " => lv_delimiter = 'X'
    String Index  2: EQ T => text literal (because lv_delimiter = 'X')
    String Index  3: EQ e => text literal (because lv_delimiter = 'X')
    String Index  4: EQ x => text literal (because lv_delimiter = 'X')
    String Index  5: EQ t => text literal (because lv_delimiter = 'X')
    String Index  6: EQ " => lv_delimiter = ' ' (because it was 'X' before)
    String Index  7: EQ , => This is a separator because lv_delimiter = ' '
    String Index  8: EQ " => lv_delimiter = 'X' (because it was ' ' before)
    String Index  9: EQ T => text literal (because lv_delimiter = 'X')
    String Index 10: EQ e => text literal (because lv_delimiter = 'X')
    String Index 11: EQ x => text literal (because lv_delimiter = 'X')
    String Index 12: EQ t => text literal (because lv_delimiter = 'X')
    String Index 13: EQ 1 => text literal (because lv_delimiter = 'X')
    String Index 14: EQ , => text literal (because lv_delimiter = 'X')
    String Index 15: EQ T => text literal (because lv_delimiter = 'X')
    Whenever you hit a 'real' separator (lv_delimiter = ' ') you pass the value of the string before that up to the previous separator into the next structure field.
    This is not an easy way to do it, but if you might have commas in your text literal and NULL values I gues it is probably the only way to go.
    Hope that helps,
    Michael

  • Uploading CSV File into Web Dynpro Java Table and Write back to a Database

    Hi Gurus!
    I would like to upload a csv file and read the content into an UI table element.
    Then, I need to write the uploaded file back to a database. I'm using NetWeaver 2004s.
    could you please provide advice for both, uploading and wirting to databse (e.g. maxDB or oracle), since I'm quite new in WDJ.
    thanks in advance.
    farid
    ps. helpfull answers will be rewarded with points!

    Hi ,
    have look at this blog
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6603. [original link is broken] [original link is broken] [original link is broken]
    Have a look at this links.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0d9336b-b4cf-2910-bdbf-b00d89bd2929.
    Re: Popup Internal Window - data type IWDWindow not available
    Regards,
    krishna.

  • How to load .csv file into an abap table

    Hi,
    Pls provide me with a sample code on how to load a .csv file (with column header and rows of data) into a table in sap.
    Thank you!
    Moderator Message: A google search would yield faster results, so search!
    Edited by: Suhas Saha on Jan 16, 2012 5:30 PM

    Hi,
    Using GUI_upload convert file to internal table data.
    Using the below statement separate header and data from CSV.
    Read t_itab into wa_titab index 1.
    delete t_itab from wa_itab.
    Create an internal table with the structure same as 'CSV' file and use the below statement to separate.
    loop at t_itab into wa_itab.
          split wa_itab-rec at ',' into var1 var2 var3.
          wa_output-v1 = var1.
          wa_output-v2 = var2.
          wa_output-v3 = var3.
        append wa_output to t_output.
    endloop.
    Edited by: syamsundr on Jan 16, 2012 11:54 AM

  • Uploading .csv file into apex3.2

    Good day,
    I am having difficulties uploading data on apex 3.2/11g, with the following error
    ORA-20001: Unable to create modules. ORA-20001: create_table error: ORA-20001: Excel load run ddl error: ORA-01658: unable to create INITIAL extent for segment in tablespace FLOW_1
    Kind regards

    If you dont know how to I guess you arent the DBA. In this case go ask him.
    If you are using a local instance, i.e. XE, then use SQL*Developer or SQL*PLus or whatever, connect as a DBA user, and issue a command like the following (which assumes you want to increase the size of file FLOW_1.dbf to 100M - adjust to your requirements).
    ALTER DATABASE DATAFILE '/....../FLOW_1.dbf' RESIZE 100M;

  • How to upload .CSV file from Application Server

    Hi Experts,
        How to upload .CSV file separated by ',' from Application server to an internal table.
    Invoice No,Cust No,Item Type,Invoice Date,days,Discount Amount,Gross Amount,Sales Amount,Customer Order No.,Group,Pay Terms
    546162,3233,1,9/4/2007,11,26.79,5358.75,5358.75,11264,HRS,11
    546163,2645,1,9/4/2007,11,3.07,305.25,305.25,10781,C,11
    Actually I read some already answered posts. But still I have some doubts.
    Can anybody please send me the code.
    Thanks in Advance.

    Hi Priya,
    Check this code
    Yhe logic used here is as follows,
    Get all the data into an internal table in the simple format ie: a row with one field contains an entire line
    After getting the data, we split each line of the table on every occurrence of the delimiter (comma in your case)
    Here, I have named the fields as field01, field02 etc, you could use your own names according to your requirement
    parameters: p_file(512).
      DATA : BEGIN OF ITAB OCCURS 0,
              COL1(1024) TYPE C,
             END OF ITAB,
             WA_ITAB LIKE LINE OF ITAB.
      DATA: BEGIN OF ITAB_2 OCCURS 0,
        FIELD01(256),
        FIELD02(256),
        FIELD03(256),
        FIELD04(256),
        FIELD05(256),
        FIELD06(256),
        FIELD07(256),
        FIELD08(256),
        FIELD09(256),
        FIELD10(256),
        FIELD11(256),
        FIELD12(256),
        FIELD13(256),
        FIELD14(256),
        FIELD15(256),
        FIELD16(256),
       END OF ITAB_2.
      DATA: WA_2 LIKE LINE OF ITAB_2.
        OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF SY-SUBRC = 8.
          WRITE:/ 'File' , p_FILE , 'cannot be opened'.
          LV_LEAVEPGM = 'X'.
          EXIT.
        ENDIF.
        WHILE SY-SUBRC <> 4.
          READ DATASET p_FILE INTO WA_ITAB.
          APPEND WA_ITAB TO ITAB.
        ENDWHILE.
        CLOSE DATASET p_FILE.
      LOOP AT ITAB INTO WA_ITAB.
        SPLIT WA_ITAB-COL1 AT ','    " where comma is ur demiliter
         INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04
         WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09
         WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14
         WA_2-FIELD15 WA_2-FIELD16.
        APPEND WA_2 TO ITAB_2.
        CLEAR WA_2.
      ENDLOOP.
    Message was edited by:
            Kris Donald

  • Uploading and downloading files in webdynpro abap

    how to up load axl file and download file in webdynpro abap application .

    Hello Pradeep,
    you might see the following documentation for [Download|http://help.sap.com/saphelp_nw70/helpdata/EN/09/a5884121a41c09e10000000a155106/frameset.htm] and [Upload|http://help.sap.com/saphelp_nw70/helpdata/EN/b3/be7941601b1d09e10000000a155106/frameset.htm] containing also names of Web Dynpro Components as reference.
    Best regards,
      Andreas

  • How to upload a pdf file using webdynpro abap

    Hi Experts,
    I need to upload pdf files using webdynpro abap.my question is where to upload this files and how to upload this files, and how to display this pdf file.
    Please Provide Requried Information.
    Waiting for Reply.
    Thanks & Regards.
    Bhushan.

    Hi,
    There is a UI element with the type 'File Upload'.
    You can use that in your view.
    For further details and coding, please refer to
    [http://www.****************/Tutorials/WebDynproABAP/Upload/Page1.htm]
    Hope this helps you.
    Regards,
    Dolly

  • Upload Csv files with infopackages - Error 1

    Hello again,
    i'm trying to upload csv file into a infopackage with master data text but the sistem sends a error message "Error 1 uploading external data".
    Infopackage settings:
    source system: PC
    file type: data file
    csv file
    data separator ;
    ESC signal "
    a created a txt file with data separated with ; and later converted txt file into a csv file.
    can anybody help me pls?
    Thanks
    Silvia Marques

    Hi Silvia,
    If the fields are correct in the transfer structure (only 2 fields). Then check whether the field length and type has been defined correctly for both the fields.
    If thats not a problem then try to load only upto PSA.
    If you are using IDOC as your transfer method then go to the "details" tab of the monitor of the error request and see the details. It will give you the correct picture of the error.
    Bye
    Dinesh.

  • Uploading CSV file

    Hi,
    i saved excel file into CSV file in that file amount filed contains comma.now iam uploading csv file into internal table using GUI_UPLOAD iam getting data into internal table.
    internaltable contains row  like
    1100,600000,1114,"1,89",Hours on Project.  1,89 is amount
    filed.how can i split the above internal table and move to another internal table.another internal table row contains like 1100  600000 1114  1,89  Hours on Project. Please provide me solution.
    Regards,
    Suresh

    There is a function module for converting file to CSV format please find the code below :
    *& Report  ZCRPT_PP_013
    REPORT  zcrpt_pp_013.
           no standard page heading
           line-size  80
           line-count 65(0)
           message-id ...
      Dev. Class       :                                                 *
      Report Name      :                                                 *
      Program Type     :                                                 *
      Created by       :                                                 *
      Created on       :                                                 *
      Transaction Code :                                                 *
      Module Name      :                                                 *
      Object ID        :                                                 *
      Description      :                                                 *
      SAP Release      : 4.6 C                                           *
      Change Request   :                                                 *
    TYPE-POOLS : slis, truxs.
          1 :   Tables Defination                                        *
    TABLES : mseg,mara,makt,mard,t001w.
          2 :   Selection Screen                                         *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_matnr FOR mard-matnr.
    PARAMETERS : p_werks LIKE mard-werks.
    SELECTION-SCREEN END   OF BLOCK b1.
    *SELECTION-SCREEN BEGIN OF BLOCK m WITH FRAME.
    *PARAMETERS: p_file TYPE  rlgrap-filename.
    *SELECTION-SCREEN END OF BLOCK m.
          3 :   Internal Table Declaration                               *
    DATA   :  BEGIN OF it_mara OCCURS 0,
              place1(12),
              place2(12),
              matnr LIKE mard-matnr,
              maktx LIKE makt-maktx,
              labst LIKE mard-labst,
              werks like mard-werks,
              place3(12),
              date(10) ,
              END OF it_mara.
    DATA: it_mara1 TYPE truxs_t_text_data.
    DATA : layout    TYPE slis_layout_alv,
           event     TYPE slis_t_event ,
           wa_event  TYPE slis_alv_event,
           variant   TYPE disvariant.
    DATA : alvly     TYPE slis_layout_alv.
    DATA : alvev     TYPE slis_t_event.
    DATA : fcat      TYPE slis_t_fieldcat_alv.
    DATA : w_fcat    TYPE slis_fieldcat_alv.
            :   Start of Selection                                       *
    START-OF-SELECTION.
      perform build_layout.
      PERFORM select.
      PERFORM process.
      PERFORM display.
    END-OF-SELECTION.
      F o r m     R o u t i n e s     S t a r t s     H e r e            *
    *&      Form  SELECT
          text
    -->  p1        text
    <--  p2        text
    FORM select .
      SELECT matnr  werks FROM mard
             INTO CORRESPONDING FIELDS OF TABLE it_mara
             WHERE matnr IN s_matnr
             AND werks LIKE p_werks.
      LOOP AT it_mara.
      SELECT SUM( labst ) FROM mard INTO it_mara-labst
                                 WHERE matnr = it_mara-matnr
                                 AND werks = it_mara-werks.
        SELECT SINGLE maktx INTO it_mara-maktx FROM makt
                          WHERE matnr = it_mara-matnr.
        MODIFY it_mara TRANSPORTING maktx labst.
      ENDLOOP.
    ENDFORM.                    "SELECT
    *&      Form  PROCESS
          text
    -->  p1        text
    <--  p2        text
    FORM process .
      LOOP AT it_mara.
        WRITE  sy-datum TO it_mara-date USING EDIT MASK '__/__/____'.
        WRITE 'VIKROLI' TO it_mara-place1.
        WRITE 'VIKROLI' TO it_mara-place2.
        WRITE 'Stock'   TO it_mara-place3.
       WRITE  '2101'   TO it_mara-werks.
        MODIFY it_mara TRANSPORTING place1 place2 labst place3 date.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM it_mara  COMPARING ALL FIELDS.
      DELETE it_mara WHERE labst EQ ' '.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
      EXPORTING
        I_FIELD_SEPERATOR          = ';'
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
      TABLES
        i_tab_sap_data             = it_mara
      CHANGING
        I_TAB_CONVERTED_DATA       = it_mara1
      EXCEPTIONS
        CONVERSION_FAILED          = 1
        OTHERS                     = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename                        = 'C:\Documents and Settings\coconut1\Desktop\ticket\FG_VIKROLI.csv'
            FILETYPE                        = 'ASC'
            WRITE_FIELD_SEPARATOR           = ','
          IMPORTING
            FILELENGTH                      =
            tables
              data_tab                        = it_mara1
            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.
    ENDFORM.                    " PROCESS
    *&      Form  DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM display .
      w_fcat-fieldname = 'PLACE1'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 1.
      w_fcat-outputlen = '10' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      w_fcat-fieldname = 'PLACE2'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 2.
      w_fcat-outputlen = '10' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      w_fcat-fieldname = 'MATNR'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 3.
      w_fcat-outputlen = '15' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      w_fcat-fieldname = 'MAKTX'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 4.
      w_fcat-outputlen = '40' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      w_fcat-fieldname = 'LABST'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 5.
      w_fcat-outputlen = '15' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      w_fcat-fieldname = 'PLACE3'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 6.
      w_fcat-outputlen = '15' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      w_fcat-fieldname = 'DATE'.
      w_fcat-tabname   = 'it_mara'.
      w_fcat-col_pos   = 7.
      w_fcat-outputlen = '15' .
      APPEND w_fcat TO fcat.
      CLEAR w_fcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
         is_layout                         = alvly
         it_fieldcat                       = fcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
         i_save                            =  'X'
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_mara
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout .
    alvly-no_input          = 'X'.
    alvly-no_colhead        = 'X'.
    alvly-zebra             = 'X'.
    alvly-colwidth_optimize = 'X'.
    endform.                    " build_layout

Maybe you are looking for