Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10116

Re: Uploading/Using only some fields of excel to ABAP program

$
0
0

Try as follows:

Declare an internal table with 60 fields giving data types of 22 fields as required and any char data type for rest of the fields. Convert your excel file into tab delimited file and then upload data using "GUI_UPLOAD"  function module.

 

CALL FUNCTION 'GUI_UPLOAD'

  EXPORTING

    filename                = p_file

    has_field_separator     = 'X'            "file is TAB delimited

  TABLES

    data_tab                = itab

  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 NE 0.

    WRITE: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.

    SKIP.

  ENDIF.

 

 

 

Regards


Viewing all articles
Browse latest Browse all 10116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>