Upload Specific Excel Sheet from excel file in sap internal table..

I have an excel sheet and it contains many sheets.. I want to read a specific sheet no.. or that sheet would have sheet name.. i want to read that specific sheet and load its data in the internal table.

Hello,
In this case you need to create OLE object and then get specific workbook using it's method.
For e.g.:
CREATE OBJECT gh_excel 'EXCEL.APPLICATION'.  
CALL METHOD OF gh_excel 'Workbooks'= gh_mapl.  
You can search SAP help for more information on using OLE objects.
Thanks,
Augustin.

Similar Messages

  • Moving excel sheet from different files to excel template

    Hi Everyone,
    I need help from you guys.. I want to fetch excel sheet from different files (say for example from 3 excel files) and put in to one template file. If any one have idea regarding this please let me know. Thanks in advance
    Thanks & Regards
    saamy

    Hii Puneet K & nyc,
    Thanks a lot for ur links guys... am already done ...will upload the working code shortly...and am facing some other problem now...when I execute the program in LV 11.0 version its working fine, but when I try to run the same code in LV10.0 (32 bit machine) its showing this error
    "Error -2146827284 occurred at Exception occured in Microsoft Office Excel: Excel cannot insert the sheets into the destination workbook, because it contains fewer rows and columns than the source workbook. To move or copy the data to the destination workbook, you can select the data, and then use the Copy and Paste commands to insert it into the sheets of another workbook.Help Path is C:\Program Files\Microsoft Office\Office12\1033\XLMAIN11.CHM and context 0 in copy_excel_worksheet.vi
    This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.
    Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2146827284) or for its hexadecimal representation (0x800A03EC)."
    If you guys know the solution please let me knoe...thanks in advance..
    Thanks & Regards
    saamy

  • Join data from a file with an internal table

    Hi to everybody!!
    I need help, I don't know how to join two differents data, one of them is internal...
    This select fill my itab
        SELECT PERNR PERID VORNA NACHN  FROM PA0002 APPENDING TABLE itab_tabla
            WHERE
            PA0002~BEGDA <= SY-DATUM AND
            PA0002~ENDDA >= SY-DATUM AND
            PERID  = G_PERID.
         ENDLOOP.
    Now I have to insert inside the table more data that pass from a file...but I don't know how to join this... can anybody help me?
    Thanks a lot
    Regards,
    Rebeca

    HI,
    you will need to upload the file by Using the FM GUI_UPLOAD.
    this will take the data from the file to an internal table that you will have to declare.
    once you get the data in to your table,you can merge both the tables in to another final table or in the 1st internal table if all the fields are there and modify the table.so the table will have the records of both the tables.
    after you get the data in your second table"
    loop at itab2.
    move: <field 1> to itab1.
              <field 2> to itab1.
    modify itab1.
    endloop.

  • Getting output in excel sheet from jsp file

    Hi,
    I am a new programmer. I am trying to get output in excel sheet by clicking a link on page. I have used that 2 statements
    response.setContentType("application/x-download");
    response.setContentType("application/Octet-Stream");
    response.setHeader("Content- disposition","inline;filename=refdsxresults.xls");
    But it is giving an empty excel sheet. I don't know how to put the data in that sheet which is retrieved by using the query below.
    "select p.port_no,p.block_no,p.slot_no,p.channel_no,p.ref_no,"+
    "p.rr,c.card_type,c.work_or_protect,p.port_status_code,p.tr_id,"+
    "p.dest_rr,p.dest_shelf,p.dest_jack,p.mux,"+
    "sid.work_order_number,sid.pon_a,sid.pon_z,"+
    "sid.circuit_id,sid.account_name,sid.account_no,sid.order_no,sid.item_no,"+
    "sid.a_city_code,sid.z_city_code,p.parent_port_no "+
    "from eon_port p,eon_card c,sonet_item_detail sid "+
    "where p.logical_flag='N' and p.card_no*=c.card_no and "+
    "p.current_path_no*=sid.path_no and sid.action!='DISC' and sid.item_status!='CN' "+
    "and p.equip_no="+equipNumber+
    " order by p.ref_no";
    and also can I use the HTML to get this result in the browser. Could you please give an example. I need it urgently.
    Thanks in advance

    In an earlier post, somebody was saying that you can use regular HTML tables to output an XLS file. I've never tried it, so I don't know it to be true, but give it a look:
    http://forum.java.sun.com/thread.jsp?forum=45&thread=407280&tstart=0&trange=15
    If that doesn't work, you can always return a CSV file (comma seperated values).

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

  • I want to convert XML file into SAP Internal table

    Hi Frndz,
    My xml file is:
    <?xml version="1.0" ?>
    - <!-- Comments: START DATE :1/11/2002 11:26:14 PM
      -->
    - <!-- Comments: RFID Tags read by Mercury4 Copyright Praff@Anantara Solutions
      -->
      <RFIDs><ID>0x303030303030303035050000B5EC</ID><ID>0x300833B2DDD901403505000042E7</ID></RFIDs>
    i want to take those 2 ID's in a internal table that id field is of 28 character type....
    very urgent.
    Thanks,
    Arunprasad.P

    class cl_ixml definition load.
    type-pools: ixml.
    types: begin of t_xml_line,
             data(256) type x,
           end of t_xml_line,
           begin of tsfixml,
             data(1024) type c,
           end of tsfixml.
    data: l_ixml type ref to if_ixml,
          l_streamfactory type ref to if_ixml_stream_factory,
          l_parser type ref to if_ixml_parser,
          l_istream type ref to if_ixml_istream,
          l_document type ref to if_ixml_document,
          l_node type ref to if_ixml_node,
          l_xmldata type string.
    data: l_elem type ref to if_ixml_element,
          l_root_node type ref to if_ixml_node,
          l_next_node type ref to if_ixml_node,
          l_name type string,
          l_iterator type ref to if_ixml_node_iterator.
    data: l_xml_table type table of t_xml_line,
          l_xml_line type t_xml_line,
          l_xml_table_size type i.
    data: l_filename type string.
    parameters: pa_file type char1024 default
    'C:\WINDOWS\Desktop\RFIDTags.xml'.
    *Validation of XML file: Only DTD included in xml document is supported
    parameters: pa_val type char1 as checkbox.
    start-of-selection.
    *Creating the main iXML factory
    l_ixml = cl_ixml=>create( ).
    *Creating a stream factory
    l_streamfactory = l_ixml->create_stream_factory( ).
    perform get_xml_table changing l_xml_table_size l_xml_table.
    *wrap the table containing the file into a stream
    l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
                                                        size  = l_xml_table_size ).
    *Creating a document
    l_document = l_ixml->create_document( ).
    *Create a Parser
    l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                      istream = l_istream
                                      document = l_document ).
    *Validate a document
    if pa_val eq 'X'.
        l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    endif.
    *Parse the stream
    if l_parser->parse( ) ne 0.
      if l_parser->num_errors( ) ne 0.
        data: parseerror type ref to if_ixml_parse_error,
              str type string,
              i type i,
              count type i,
              index type i.
              count = l_parser->num_errors( ).
              write: count, ' parse errors have occured:'.
              index = 0.
              while index < count.
                parseerror = l_parser->get_error( index = index ).
                i = parseerror->get_line( ).
                write: 'line: ', i.
                i = parseerror->get_column( ).
                write: 'column: ', i.
                str = parseerror->get_reason( ).
                write: str.
                index = index + 1.
              endwhile.
    endif.
    endif.
    *Process the document
    if l_parser->is_dom_generating( ) eq 'X'.
        perform process_dom using l_document.
    endif.
    *& Form get_xml_table
    form get_xml_table changing l_xml_table_size type i
                  l_xml_table type standard table.
    *Local variable declaration
    data: l_len type i,
          l_len2 type i,
          l_tab type tsfixml,
          l_content type string,
          l_str1 type string,
          c_conv TYPE REF TO cl_abap_conv_in_ce,
          l_itab type table of string.
    l_filename = pa_file.
    *upload a file from the client's workstation
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = l_filename
        FILETYPE                      = 'BIN'
      IMPORTING
        FILELENGTH                    = l_xml_table_size
      HEADER                        =
      TABLES
        DATA_TAB                      = l_xml_table
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *Writing the XML document to the screen
    CLEAR l_str1.
    LOOP AT l_xml_table INTO l_xml_line.
    c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement = space ).
    c_conv->read( IMPORTING data = l_content len = l_len ).
    CONCATENATE l_str1 l_content INTO l_str1.
    ENDLOOP.
    l_str1 = l_str1+0(l_xml_table_size).
    SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
    WRITE: /.
    WRITE: /' XML File'.
    WRITE: /.
    LOOP AT l_itab INTO l_str1.
    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab
    IN
    l_str1 WITH space.
    WRITE: / l_str1.
    ENDLOOP.
    WRITE: /.
    endform. "get_xml_table
    *& Form process_dom
    form process_dom using document type ref to if_ixml_document.
    data: node type ref to if_ixml_node,
          iterator type ref to if_ixml_node_iterator,
          nodemap type ref to if_ixml_named_node_map,
          attr type ref to if_ixml_node,
          name type string,
          prefix type string,
          value type string,
          indent type i,
          count type i,
          index type i.
    data: name2 type string,
          name_root type string,
          node_parent type ref to if_ixml_node,
          node_root type ref to if_ixml_node,
          num_children type i.
        node ?= document.
    check not node is initial.
    uline.
    write: /.
    write: /' DOM-TREE'.
    write: /.
    if node is initial. exit. endif.
    create a node iterator
      iterator = node->create_iterator( ).
    get current node
      node = iterator->get_next( ).
    loop over all nodes
        while not node is initial.
          indent = node->get_height( ) * 2.
          indent = indent + 20.
          num_children = node->num_children( ).
          case node->get_type( ).
          when if_ixml_node=>co_node_element.
           element node
            name = node->get_name( ).
            nodemap = node->get_attributes( ).
            node_root = node->get_root( ).
            name_root = node_root->get_name( ).
            write: / 'ELEMENT :'.
            write: at indent name color col_positive inverse.
            write: 'NUM_CHILDREN:', num_children.
            write: 'ROOT:', name_root.
            node_parent = node->get_parent( ).
            name2 = node_parent->get_name( ).
            write: 'NAME2: ' , name2.
        if not nodemap is initial.
    *attributes
            count = nodemap->get_length( ).
            do count times.
            index = sy-index - 1.
            attr = nodemap->get_item( index ).
            name = attr->get_name( ).
            prefix = attr->get_namespace_prefix( ).
            value = attr->get_value( ).
            write: / 'ATTRIBUTE:'.
            write: at indent name color col_heading inverse, '=',
            value color col_total inverse.
        enddo.
    endif.
    when if_ixml_node=>co_node_text or
    if_ixml_node=>co_node_cdata_section.
    *text node
    value = node->get_value( ).
    write: / 'VALUE :'.
    node_parent = node->get_parent( ).
    write: at indent value color col_group inverse.
    name2 = node_parent->get_name( ).
    write: 'NAME2: ' , name2.
    endcase.
    *advance to next node
    node = iterator->get_next( ).
    endwhile.
    endform. "process_dom
    Thanks,
    Arunprasad.P

  • How to upload  schedule line from flat files to sap file

    dear all,
    i want to upload the schedule lines from flat files to sap schedulle lines
    but the flat files have 15 schedule lines and the data is as per date
    so how to upload that and the fields available in flat files are more than the sap screen
    we are having more than 6 items
    and 15scedule lines its abt 90data to be upload
    for one customer in every 15 day
    so how to do this
    is there any direct use in functional side
    with out the help of any abap
    but my user will do it
    so he need a permanent solution
    with regards
    subrat

    Hi Subrat ,
    u can upload the data either ( Master /Transaction) data with the help of lsmw. for that all u need to do is go through the lsmw and do it. in that u can go Batch input recording/ BAPI/ IDOC any of that. here i am sending the LSMW Notes go through it and do the work.
    once u create the LSMW project then u can ask the data from user or u can explain the user about the program and can run the flat file to upload the data.
    if u require LSMW material Just send me blank mail from u. my mail id is [email protected]
    Reward if Helpful.
    Regards,
    Praveen Kumar.D

  • To read data from exel file into sap

    hi all,
    How to read data from exel file into the internal table in abap?
    Regards,
    sugeet.

    Hi Sugeet,
    Use the following code.
    DATA : BEGIN OF tbl_asset occurs 0,
             anlkl LIKE anla-anlkl,          " Asset Class
             bukrs LIKE anla-bukrs,          " Company Code
             ranl1 LIKE ra02s-ranl1,         " Asset #
             txt50 LIKE anla-txt50,          " Description 1
             txa50 LIKE anla-txa50,          " Description 2
             sernr LIKE anla-sernr,          " Serial #
             invnr LIKE anla-invnr,          " Inventory #
             menge LIKE anla-menge,          " Quantity
             meins LIKE anla-meins,          " Base UOM
             inken LIKE anla-inken,          " Inventory
    END OF tbl_asset.
    DATA : w_filename TYPE IBIPPARMS-path,
           w_file     TYPE string.
    start-of-selection.
    *popup for file path from user
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
    IMPORTING
       FILE_NAME           = w_filename          .
    MOVE w_filename TO w_file .
    * upload data
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      =  w_file
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                      = tbl_asset
      EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    for HAS_FIELD_SEPARATOR Use
    'X': Fields are separated by tabs.
    SPACE: Fields are not separated by tabs. In this case, the table must contain only one column or all columns must be contained in the file in their entire length.
    Hope it helps...
    Lokesh
    Pls. reward appropriate points

  • Uploading data from excel sheets through BDC's into sap system

    hi guys,
    can you please help me with this. As we use gui_upload to upload data from flat file to sap system, which function module you use to upload data from Excel sheet to sap system through bdc's

    hello pavan,
    welcome to SDN
    check the below program
    REPORT ZEXCEL_TO_INTERNAL .
    data: begin of itab occurs 0,
          name(20) type c,
          addre(20) type c,
          end of itab.
    DATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    DATA : B1 TYPE I VALUE 1,
           C1 TYPE I VALUE 1,
           B2 TYPE I VALUE 100,
           C2 TYPE I VALUE 9999.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                   =
        'C:\Documents and Settings\administrator\Desktop\ppcon001bd_24.xls'
        I_BEGIN_COL                   = B1
        I_BEGIN_ROW                   = C1
        I_END_COL                     = B2
        I_END_ROW                     = C2
      TABLES
        INTERN                        = itab1
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 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.
    loop at itab1.
    write:/ itab1.
    Endlop.
    Regards,
    Naveen

  • How to upload the invocie verify from excel file?

    How to upload the invocie verify from excel file?
    there is more items requied to input.
    refer to MIR7
    thanks

    How to upload the invocie verify from excel file?
    there is more items requied to input.
    refer to MIR7
    thanks

  • Reading long text from excel file to an internal table

    Hi
    Can any body tell me how to read long text from excel file to an internal table.
    When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
    But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
    may i know which FM or what logic i need to use for this problem.
    Regards

    Hi,
    Here is an example program.  It will upload an Excel file with two columns.  You could also assign the Excel structure dynamically, but I wanted to keep the example simple.  The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
    Remember, this is just an example to help you figure out how to properly use the technique.  It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
    *& Report  zexcel_upload_test                            *
    REPORT  zexcel_upload_test.
    TYPE-POOLS: truxs.
    TYPES: BEGIN OF ty_excel,
             col_a(10) TYPE n,
             col_b(35) TYPE c,
           END OF ty_excel.
    DATA: l_data_tab         TYPE TABLE OF string,
          l_text_data        TYPE truxs_t_text_data,
          l_gui_filename     TYPE string,
          it_excel           TYPE TABLE OF ty_excel.
    FIELD-SYMBOLS: <wa_excel>  TYPE ty_excel.
    PARAMETERS: p_file TYPE rlgrap-filename.
    * Pass the file name in the correct format
    l_gui_filename = p_file.
    * Upload data from PC
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_gui_filename
        filetype                = 'ASC'
        has_field_separator     = 'X'
      CHANGING
        data_tab                = l_data_tab
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    * Convert from Excel into the appropriate itab
    l_text_data[] = l_data_tab[].
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_field_seperator    = 'X'
        i_tab_raw_data       = l_text_data
        i_filename           = p_file
      TABLES
        i_tab_converted_data = it_excel
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    LOOP AT it_excel ASSIGNING <wa_excel>.
    *  Do something here...
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM filename_get CHANGING p_file.
    *       FORM filename_get                                             *
    FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
      DATA: l_in_file  TYPE string,
            l_filetab  TYPE filetable,
            wa_filetab TYPE LINE OF filetable,
            l_rc       TYPE i,
            l_action   TYPE i,
            l_init_dir TYPE string.
    * Set the initial directory to whatever you want it to be
      l_init_dir = 'C:\'.
    * Call the file open dialog without multiselect
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Load file'
          default_extension       = '.XLS'
          default_filename        = l_in_file
          initial_directory       = l_init_dir
          multiselection          = 'X'
        CHANGING
          file_table              = l_filetab
          rc                      = l_rc
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        REFRESH l_filetab.
      ENDIF.
    * Read the selected filename
      READ TABLE l_filetab INTO wa_filetab INDEX 1.
      IF sy-subrc = 0.
        p_in_file = wa_filetab-filename.
      ENDIF.
    ENDFORM.                    " filename_get
    Regards,
    Jamie

  • How to open and read Excel Sheet from SharePoint 2013 Document Library using C# Visual Studio 2012

    Hi,
    To achieve these are the steps that I had followed :
    1. Add the document Library path into Central Admin -> Application Mgmt -> Manage Service App -> Excel Service App -> Trusted File Locations
    2. Add Documnet Library link to Trusted Connection Proivder
    3. Open Visual Studio as Run as Administrator
    4.Create an SharePoint 2013 Empty Project.
    5.Add Service Reference : http:\\<server>\_vti_bin/excelservice.asmx
    6.Service added successfully
    7.Create a class file and add the Service Reference namespace
    There is no such class as ExcelService to call. 
    Please let me know if somebody knows how to open the Excel file into C#(2012)  either using ExcelService or any other way to open. I tried old methods of Sharepoint 2010 server but it's not able to access classes.
    Requirement is :
    Need to read the excel sheet  from Document Library and transfer all data into DataTable.
    Please help asap. 

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, I'll move your question to the SharePoint 2013 development forum
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointdevelopment
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • Sending an Email by taking excel sheet from Application Server.

    Hi.
    I Searched in SDN related 'Sending an Email by taking excel sheet from Application Server'.
    But i didnt get. I got sending mails from local pc.
    Can some bdy provide me sample code how to send mail with an attachment. the attached file should get from Application Server
    Regards,
    Renu

    Hi,
    For writing data to app server from internal table:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252binput
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252boutput
    Checkout this wiki for sending XL in mail attachment:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/multiple%252battachment%252bon%252be_mail
    Thanks,
    Krishna

  • I have problem of uploading excel file to my internal table

    Hi,
    I trying to upload data from excel file to my internal table and when i tried to debug the program and check the data in internal table and iam gettin # in all the fields and the data in not populated in internal table , as we are using 4.0b version and we are using UPLOAD FUNCTION.
            BUKRS(4) TYPE C,     
             PONO(8) TYPE C,     
             GRNNO(8) TYPE C,   
             DELNOTE(16) TYPE C,
             RECPTDT(10) TYPE C,  
             SUPPCODE(20) TYPE C, 
              RECPT(12) TYPE C,  
              GLACCT(10) TYPE C, 
             CCTR(6) TYPE C,      
      CALL FUNCTION 'UPLOAD'
        TABLES DATA_TAB = STRU.
      IF SY-SUBRC NE 0.
        WRITE: /'Data file error'.
      ENDIF.
    i am using the same sequeuence in the above structure in excel.

    Hi KODAMANCHILI,
    Refer following link :
    http://help.sap.com/saphelp_40b/helpdata/en/fc/eb3d9d358411d1829f0000e829fbfe/frameset.htm
    This will surely solve your problem.
    Regards,
    Vivek

  • How to get data to excel sheet from background

    Hello Experts,
    I have be assigned a task where i have to find out all the reports and the variants containing a ' / '. I have written the code where i am able to scan through the entire list and get a set of reports and the variantsin the internal table. NOW i have to run the code in the background and the entire set of reports and the variants in the internal table to the excel sheet . So how do I do this? I am able to get the data in the excel sheet from the foreground using the FM GUI_download. But this FM does not work in the background.
    So what should be the ideal way to do this ?
    Thanks
    Aditya

    Hi,
    You can write the file into Application server.
    OPEN DATASET dataset FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      LOOP AT it_itab INTO wa_itab.
        TRANSFER wa_itab TO dataset.
      ENDLOOP.
      CLOSE DATASET dataset
    use CG3Y transaction to download file from app server to presentation server.
    Regards
    Sree

Maybe you are looking for

  • Item text in service p.o.

    Hi Sap Consultants,                                 I have maintained a Long text in service activity number. How the same will be fetched in the item text level in the service order. Thanks & Regards

  • Fast hard disk for audio recording?!

    Hi! Can anyone recomend an external harddisk that works well with Logic (I have an apogee ensemble firewire interface), that runs fast and does not sound to much? I am currently running with a macbook, about one year old. Best, Cardaroy

  • Outward-facing Portals and R/3 authorizations

    How to use tight R/3 authorizations with Portals? Outward Facing Enterprise Portals projects which invoke R/3 transactions have an authorization issue we have not yet resolved. Example: a portals invocation of an R/3 customer balance inquiry should s

  • I am going to buy a macbook pro 15" but i can't choose between glossy or anti-glare

    i am going to buy a macbook pro 15" with the 8gb ram and all that jazz but i can't choose between the glossy or anti glare they both will apply to my daily use but i cannot decide. is it possible to pick lets ay the glossy one then if i dont like it

  • Can anyone help me to resolve the pop3 setting issues with Mail?!

    How can I resolve the issue I am having with the Pop settings in mail?  I am trying to use the Yahoo! Business Mail, which worked perfectly until I upgraded to Mavericks.