Burhan KARADERE Kişisel Blog - Bilgisayar IT Haber - Programlama - Donanım

Hızlı Erişim

Arşiv

Hava Durumu

Yağmur 7°C Yağmur
Çar Yağmur İhtimali
3/0
Per Kar Yağışı İhtimali
3/-1
Cum Kar Yağışı İhtimali
3/-1

Abap Excel to Internal Table

sap-abap-logo

REPORT Z_EXCEL_to_ITAB.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.

TYPES: BEGIN OF t_datatab,
ebeln LIKE ymtil_cons_po-ebeln,
ebelp LIKE ymtil_cons_po-ebelp,
END OF t_datatab.

DATA: it_datatab TYPE STANDARD TABLE OF t_datatab,

 wa_datatab TYPE t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

 CALL FUNCTION 'F4_FILENAME'

 EXPORTING

 field_name = 'p_file'

 IMPORTING

 file_name  = p_file.
START-OF-SELECTION.

 CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

 EXPORTING

 i_line_header        = 'X'

 i_tab_raw_data       = it_raw

 i_filename           = p_file

 TABLES

 i_tab_converted_data = it_datatab[]

 EXCEPTIONS

 conversion_failed    = 1

 OTHERS               = 2.

 IF sy-subrc <> 0.

 *  key in some message

 ENDIF.
END-OF-SELECTION.

 LOOP AT it_datatab INTO wa_datatab.

 * Do anything with the work area wa_datatab.

 ENDLOOP.
VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Related posts:

  1. Internal Table export (convert) to XML file
  2. Abap Listbox and itab or table
  3. Abap sayaç – Abap counter
  4. Abap Logo ALV – OAER
  5. Date Structure Örneği

Bir Cevap Yazın

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">