<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Data in excel sheet to be used for programing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767998#M906671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the code. But as u know an excel sheet itself can have many sheets in it.....&lt;/P&gt;&lt;P&gt;Suppose my excel sheet name is XYZ.Xls and it consists of a sheet 'abcd' . how can use the data in this particular sheet only as i will be defining my internal table according to the 'abcd' sheet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my question is clear???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Apr 2008 04:41:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-25T04:41:00Z</dc:date>
    <item>
      <title>Data in excel sheet to be used for programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767995#M906668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to make a z report for which the data i have to use is in a excel sheet.&lt;/P&gt;&lt;P&gt;How can I use this data for making different reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reg,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:33:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767995#M906668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Data in excel sheet to be used for programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767996#M906669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upload the data into internal table from excel sheet and then make the report accordingly....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use TEXT_CONVERT_XLS_TO_SAP function module to READ data from excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;REWARD IF USEFUL&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:57:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767996#M906669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data in excel sheet to be used for programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767997#M906670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;
Hi Archana,

We can use the Function module  TEXT_CONVERT_XLS_TO_SAP  to read the Excel file into the internal table. From this internal table you can fill the target internal table. 
 &lt;PRE&gt;&lt;CODE&gt;
  report  zvenkat-upload-xl  no standard page heading.
"----------------------------------------------------------------------
"Declarations.
"----------------------------------------------------------------------
"types
types:
      begin of t_bank_det,
        pernr(8)  type c,
        bnksa(4)  type c,
        zlsch(1)  type c,
        bkplz(10) type c,
        bkort(25) type c,
        bankn(18) type c,
      end of t_bank_det.
"work areas
data:
      w_bank_det type t_bank_det.
"internal tables
data:
      i_bank_det type table of t_bank_det.
"---------------------------------------------------------------------
" selection-screen
"----------------------------------------------------------------------
selection-screen begin of block b1 with frame title text_001.
parameters p_file type localfile.
selection-screen end of block b1.
*---------------------------------------------------------------------
"At selection-screen on value-request for p_file.
*---------------------------------------------------------------------
at selection-screen on value-request for p_file.
  perform f4_help.
*---------------------------------------------------------------------
  "Start-of-selection.
*---------------------------------------------------------------------
start-of-selection.
  perform upload_data.
*---------------------------------------------------------------------
  "End-of-selection.
*---------------------------------------------------------------------
end-of-selection.
  perform display_data.
*&amp;amp;---------------------------------------------------------------------*
  "Form  f4_help
*&amp;amp;---------------------------------------------------------------------*
form f4_help .
  data:
        l_file_name like  ibipparms-path  .

  call function 'F4_FILENAME'
    exporting
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = 'P_FILE'
    importing
      file_name     = l_file_name.

  p_file = l_file_name.

endform.                                                    " f4_help
*---------------------------------------------------------------------*
"Form  upload_data
*---------------------------------------------------------------------*
form upload_data .
  type-pools:truxs.
  data:li_tab_raw_data type  truxs_t_text_data.
  data:l_filename      like  rlgrap-filename.

  l_filename = p_file.
  call function 'TEXT_CONVERT_XLS_TO_SAP'
    exporting
      i_tab_raw_data       = li_tab_raw_data
      i_filename           = l_filename
    tables
      i_tab_converted_data = i_bank_det
    exceptions
      conversion_failed    = 1
      others               = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

endform.                    " upload_data
*---------------------------------------------------------------------*
" Form  display_data
*---------------------------------------------------------------------*
form display_data .
  data: char100 type char100.
  loop at i_bank_det into w_bank_det .
    if sy-tabix = 1.
      write w_bank_det.
      write / '------------------------------------------------------------'.
    else.
      write / w_bank_det.
    endif.
  endloop.

endform.                    " display_data 
&lt;/CODE&gt;&lt;/PRE&gt;

I hope that it helps u .

Regards,
Venkat.O
&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 16:54:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767997#M906670</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2008-04-23T16:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data in excel sheet to be used for programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767998#M906671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the code. But as u know an excel sheet itself can have many sheets in it.....&lt;/P&gt;&lt;P&gt;Suppose my excel sheet name is XYZ.Xls and it consists of a sheet 'abcd' . how can use the data in this particular sheet only as i will be defining my internal table according to the 'abcd' sheet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my question is clear???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 04:41:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767998#M906671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T04:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Data in excel sheet to be used for programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767999#M906672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following code for multiple sheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : $i_intern type  kcde_cells occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : $v_index type i.&lt;/P&gt;&lt;P&gt;data : $v_start_col type i value '1',&lt;/P&gt;&lt;P&gt;       $v_start_row type i value '1',&lt;/P&gt;&lt;P&gt;       $v_end_col   type i value '256',&lt;/P&gt;&lt;P&gt;       $v_end_row   type i value '7500'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: excel_tab type kcde_sender.&lt;/P&gt;&lt;P&gt;  data: separator type c.&lt;/P&gt;&lt;P&gt;  field-symbols: &amp;lt;field&amp;gt;.&lt;/P&gt;&lt;P&gt;  data: application type ole2_object,&lt;/P&gt;&lt;P&gt;        workbook    type ole2_object,&lt;/P&gt;&lt;P&gt;        range       type ole2_object,&lt;/P&gt;&lt;P&gt;        worksheet   type ole2_object,&lt;/P&gt;&lt;P&gt;        worksheets  type ole2_object,&lt;/P&gt;&lt;P&gt;        sheets      type ole2_object.&lt;/P&gt;&lt;P&gt;  data: h_cell  type ole2_object.&lt;/P&gt;&lt;P&gt;  data: h_cell1 type ole2_object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: l_sheet           type c length 40.&lt;/P&gt;&lt;P&gt;  data: l_active_sheet    type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  define m_message.&lt;/P&gt;&lt;P&gt;    case sy-subrc.&lt;/P&gt;&lt;P&gt;      when 0.&lt;/P&gt;&lt;P&gt;      when 1.&lt;/P&gt;&lt;P&gt;        message id sy-msgid type sy-msgty number sy-msgno&lt;/P&gt;&lt;P&gt;                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;      when others. raise upload_ole.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;  end-of-definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create Excel OLE2 object and open XLS file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if application-header = space or application-handle = -1.&lt;/P&gt;&lt;P&gt;    create object application 'Excel.Application'.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method of application 'Workbooks' = workbook.&lt;/P&gt;&lt;P&gt;  m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method of workbook 'Open' exporting #1 = pa_file.&lt;/P&gt;&lt;P&gt;  m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Show/don't show XLS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; set property of application 'Visible' = 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; m_message.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Determine number of sheets&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method of application 'Sheets' = sheets.&lt;/P&gt;&lt;P&gt;  m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method of sheets 'Count' = sheetno.&lt;/P&gt;&lt;P&gt;  m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_active_sheet = 0.&lt;/P&gt;&lt;P&gt;  do sheetno times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear: $i_intern[], excel_tab[].&lt;/P&gt;&lt;P&gt;    clear: it_vals[], it_chars[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_active_sheet = l_active_sheet + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Activate sheet number L_ACTIVE_SHEET&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method of application 'Worksheets' = worksheets exporting #1 = l_active_sheet.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method of worksheets 'Activate'.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get active sheet&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    get property of  application 'ACTIVESHEET' = worksheet.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Find start&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method of worksheet 'Cells' = h_cell&lt;/P&gt;&lt;P&gt;      exporting #1 = $v_start_row #2 = $v_start_col.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Find end&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method of worksheet 'Cells' = h_cell1&lt;/P&gt;&lt;P&gt;      exporting #1 = $v_end_row #2 = $v_end_col.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create range&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method of worksheet 'RANGE' = range&lt;/P&gt;&lt;P&gt;      exporting #1 = h_cell #2 = h_cell1.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Select range&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method of range 'SELECT'.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  copy to Clipboard&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method of range 'COPY'.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'CONTROL_FLUSH'&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        others = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Import clipboard&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call function 'CLPB_IMPORT'&lt;/P&gt;&lt;P&gt;      tables&lt;/P&gt;&lt;P&gt;        data_tab   = excel_tab&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        clpb_error = 1&lt;/P&gt;&lt;P&gt;        others     = 2.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0. message x001(kx). endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    separator = cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform separated_to_intern_convert(saplkcde) tables excel_tab $i_intern&lt;/P&gt;&lt;P&gt;                                        using  separator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    set property of application 'CutCopyMode' = 0.&lt;/P&gt;&lt;P&gt;    m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method of application 'QUIT'.&lt;/P&gt;&lt;P&gt;  m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  free object : application,&lt;/P&gt;&lt;P&gt;                workbook,&lt;/P&gt;&lt;P&gt;                worksheet,&lt;/P&gt;&lt;P&gt;                sheets,&lt;/P&gt;&lt;P&gt;                range.&lt;/P&gt;&lt;P&gt;  m_message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works.&lt;/P&gt;&lt;P&gt;Please reward accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Priyanka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 05:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-in-excel-sheet-to-be-used-for-programing/m-p/3767999#M906672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T05:38:58Z</dc:date>
    </item>
  </channel>
</rss>

