Regarding  ALSM_EXCEL_TO_INTERNAL_TABLE

Hi,
I am uploading data using this FM but I want to know the maximum number of records it will take?Actuallty I have 100 records in the Excel file,but when I have uploaded using this FM into 1 internal table it is taking only 37 records?
Kindly solve this issue!
Points Rewarded !

hi,
give  row positions like this.
DATA : c1 TYPE I VALUE 1,
       r1 TYPE I VALUE 1,"first row
       ce TYPE I VALUE 10,
       re TYPE I VALUE 100."end of row
INCLUDE BDCRECX1.
START-OF-SELECTION.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                = 'C:\xl1.XLS'
      I_BEGIN_COL             = c1
      I_BEGIN_ROW             = r1
      I_END_COL               = ce
      I_END_ROW               = re
    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.

Similar Messages

  • Information regarding ALSM_EXCEL_TO_INTERNAL_TABLE function module

    Hi,
    I am using "ALSM_EXCEL_TO_INTERNAL_TABLE" function module for reading 'XLS' file from client machine into internal table. Now question is "IS there is need of Micosoft office installed on client machine for reading excel file to internal table"
    Thanku

    Sandip,
    No, To display the output in excel it needs.

  • 'ALSM_EXCEL_TO_INTERNAL_TABLE' internal table to ALV

    Hi,
    I have a problem regarding 'ALSM_EXCEL_TO_INTERNAL_TABLE' internal table to ALV.
    I have this code.
    DATA:
          t_itab like ALSMEX_TABLINE occurs 0 with header line,
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = p_fname
    i_begin_col = 1
    i_begin_row = 1
    i_end_col = 4
    i_end_row = 6
    TABLES
    intern = t_itab
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    IF sy-subrc = 0.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_STRUCTURE_NAME   = 'ALSMEX_TABLINE'
           TABLES
                T_OUTTAB           = t_itab.
    I got an output of
    ROW  COLUMN   c
    1           1             TestData
    1           2             TestData
    2           1             TestData
    2           2             TestData

    Hi Christian Gajo ,
    Check the below code.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = P_FILE
        i_begin_col                   = '1'
        i_begin_row                   = '1'
        i_end_col                     = '5'
        i_end_row                     = '10'
      tables
        intern                        =  IEXCEL
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-SGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    END-OF-SELECTION.
    SORT IEXCEL BY ROW COL.
    LOOP AT IEXCEL.
        CASE IEXCEL-COL.
           WHEN 1.
             WA_CUST_GLACC-PARVW = IEXCEL-VALUE.
           WHEN 2.
             WA_CUST_GLACC-KUNNR = IEXCEL-VALUE.
           WHEN 3.
             WA_CUST_GLACC-MATNR = IEXCEL-VALUE.
           WHEN 4.
             WA_CUST_GLACC-SAKNR = IEXCEL-VALUE.
           WHEN 5.
             WA_CUST_GLACC-TXT50 = IEXCEL-VALUE.
         ENDCASE.
    AT END OF ROW.
            WA_CUST_GLACC-MANDT = SY-MANDT.
         APPEND WA_CUST_GLACC TO GT_CUST_GLACC.
         CLEAR WA_CUST_GLACC.
    ENDAT.
    CLEAR IEXCEL.
    ENDLOOP.
    Edited by: mukesh kumar on Nov 7, 2008 7:53 AM

  • Regarding FM ALSM_EXCEL_TO_INTERNAL_TABLE

    Hello Experts,
    I have a requirement to read an external file into internal table. I am using function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' to read data from file. now I am facing problem for no of rows and column to read. This function module requires passing no of rows and cols to read, but it is not possible to pass becoz we donu2019t how many rows will be in file. I dont want to hardcode those values.
    plz tell me is there is any FM to know no of rows in file?
    also I have a doubt that this FM read how many cols and rows??? I think it have limitation to read only 250 cols by 30000 rows. In such case what should I do to read all records from file.
    -Shweta

    Hi Shwetha
    See my code and understand,
    Max no of rows in Excel file is 65,536. You cannot know in advance befor reading how many rows are filled in excel file. instead mention the max no of rows as 65,536 and upload to internal table. for ex your internal table name is gt_out. after uploading use "Describe" statement to know how many no. of rows are populated in the internal table.
    if you have doubts plse let me know
    DATA : it_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA: xcel TYPE TABLE OF alsmex_tabline WITH HEADER LINE.
    DATA : gd_scol TYPE i VALUE '1',
    gd_srow TYPE i VALUE '3',
    v_partner LIKE kna1-kunnr,
    gd_ecol TYPE i VALUE '256',
    v_vbeln TYPE vbak-vbeln,
    gd_erow TYPE i VALUE '65536'
    DATA: BEGIN OF gt_out OCCURS 0,
    soind(1) TYPE c, " Sales Order indicator (H) - Header
    auart LIKE vbak-auart, " Order Type
    kunnr LIKE kna1-kunnr, "Sold To Party
    bstkd LIKE vbkd-bstkd, "PO Number
    matnr LIKE vbap-matnr, "Article Number
    req_qty LIKE vbap-kwmeng, "Quantity
    werks LIKE vbap-werks, "Site
    rsite LIKE vbap-werks,
    END OF gt_out.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: c1 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    PERFORM get_file.
    *===========================================================
    Start of selection
    *===========================================================
    START-OF-SELECTION.
    PERFORM upload_excel_file TABLES gt_out
    USING p_file
    gd_scol
    gd_srow
    gd_ecol
    gd_erow.
    *& Form get_file
    text
    --> p1 text
    <-- p2 text
    FORM get_file .
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    program_name = syst-repid
    dynpro_number = syst-dynnr
    field_name = p_file
    CHANGING
    file_name = p_file.
    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. " get_file
    *& Form upload_excel_file
    text
    -->P_IT_DATATAB text
    -->P_P_FILE text
    -->P_GD_SCOL text
    -->P_GD_SROW text
    -->P_GD_ECOL text
    -->P_GD_EROW text
    FORM upload_excel_file TABLES gt_out
    "Insert correct name for <...>
    USING p_p_file
    p_gd_scol
    p_gd_srow
    p_gd_ecol
    p_gd_erow.
    DATA : lt_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
    DATA : ld_index TYPE i.
    FIELD-SYMBOLS: <fs> TYPE ANY.
    CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
    EXPORTING
    filename = p_p_file
    i_begin_col = p_gd_scol
    i_begin_row = p_gd_srow
    i_end_col = p_gd_ecol
    i_end_row = p_gd_erow
    TABLES
    intern = lt_intern[].
    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 'KCD_EXCEL_OLE_TO_INT_CONVERT'
    EXPORTING
    FILENAME = p_p_file
    i_begin_col = p_gd_scol
    i_begin_row = p_gd_srow
    i_end_col = p_gd_ecol
    i_end_row = p_gd_erow
    TABLES
    intern = lt_intern[]
    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.
    IF lt_intern[] IS INITIAL.
    FORMAT COLOR COL_BACKGROUND INTENSIFIED.
    WRITE:/ 'No Data Uploaded'.
    EXIT.
    ELSE.
    SORT lt_intern BY row col.
    LOOP AT lt_intern.
    MOVE lt_intern-col TO ld_index.
    ASSIGN COMPONENT ld_index OF STRUCTURE gt_out TO <fs>.
    MOVE lt_intern-value TO <fs>.
    AT END OF row.
    APPEND gt_out.
    CLEAR gt_out.
    ENDAT.
    ENDLOOP.
    ENDIF.
    ENDFORM. " upload_excel_file
    Hope this code is helpful to you. Follow the steps as it is, change only your output internal tables. It will work.
    Regards,
    Santosh Kumar M.

  • Query regarding a specific usage of 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM + ALV

    HI all,
    I am new to ABAP and this is my first project.
    I have the following requirement as a part of my object. Kindly help me with the code or atleast snippet of code. The useful responses will be rewarded with points.
    An .xls file needs to be uploaded from the user's desktop at the selection screen. and run in 'test run' or 'upload run' mode.
    The file has header items from row 6 and the line items from row 10. The number of line items are limited to 999 else an error needs to be thrown to the user incase the file contains from 999 line items.
    Also, then there are some validations that need to be performed and then data needs to be posted to SAP using a BAPI 'BAPI_ACC_DOCUMENT_POST'.
    Also, after posting, an ALV report needs to be generated displaying the header items row wise and then below it , the successful line items that were processed and then further below, row-wise the unsuccessful line items alongwith the error message for each row.
    Can anyone provide some code snippets for each of the above mentioned points and some sequence of logic as well ?
    Thanks a lot.
    Edited by: Aniket Pallav on Dec 14, 2011 8:41 AM

    Hi,
    REPORT  ZSAMPLE_ALV.
    TYPE-POOLS : SLIS.
    PARAMETERS : P_EBELN TYPE EKKO-EBELN.
    TYPES: BEGIN OF TY_EKPO,
            EBELN TYPE EKPO-EBELN,
            EBELP TYPE EKPO-EBELP,
          END OF TY_EKPO.
    DATA : IT_EKPO TYPE TABLE OF TY_EKPO,
           WA_EKPO TYPE TY_EKPO.
    DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FCAT TYPE SLIS_FIELDCAT_ALV.
    IF P_EBELN IS NOT INITIAL.
      SELECT EBELN EBELP BUKRS WERKS FROM EKPO INTO CORRESPONDING FIELDS OF TABLE IT_EKPO WHERE EBELN = P_EBELN.
    ENDIF.
    PERFORM FIELDCAT.
    PERFORM DISPLAY.
    FORM FIELDCAT .
      WA_FCAT-FIELDNAME = 'EBELN' .
      WA_FCAT-TABNAME = 'EKPO' .
      WA_FCAT-COL_POS = 1.
      wa_fcat-edit = 'X'.
      WA_FCAT-OUTPUTLEN = '20'.
      wa_fcat-seltext_m = 'BILLING NUM' .
      APPEND WA_FCAT TO IT_FCAT.
      CLEAR WA_FCAT.
      WA_FCAT-FIELDNAME = 'EBELP' .
      WA_FCAT-TABNAME = 'EKPO' .
      WA_FCAT-COL_POS = 2.
      WA_FCAT-OUTPUTLEN = '20'.
      wa_fcat-seltext_m = 'ITEM' .
      APPEND WA_FCAT TO IT_FCAT.
      CLEAR WA_FCAT.
    ENDFORM.                    " FIELDCAT
    *&      Form  DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY .
      IF IT_EKPO IS NOT INITIAL.
        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                         = LS_LAY
           IT_FIELDCAT                       = IT_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_EKPO
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      ENDIF.
    ENDFORM.                    " DISPLAY

  • Regarding tranfer of exel file from Presentation to Application server

    Hi,
    I want to transfer <b>excel file</b> in presentation server [Desktop] to Application server[<b>AL11</b>].
    I have made use of F.M <b>C13Z_FRONT_END_TO_APPL</b>, But it is showing the data in AL11 as some junk characters.
    Where as when i transfer a Text file to AL11 using above F.M it is showing the data correctly.
    How can solve this issue!
    I need to transfer <b>Excel file</b> data in <b>Presentation Server</b> to <b>Application Server</b> with tab delimeter.
    Can any body give the solution for the same!
    Thanks in advance.
    Thanks,
    Deep.

    Dear Deep,
    Please go though the following lines of code:
    D A T A D E C L A R A T I O N *
    TABLES: ANEP,
    BKPF.
    TYPES: BEGIN OF TY_TABDATA,
    MANDT LIKE SY-MANDT, " Client
    ZSLNUM LIKE ZSHIFTDEPN-ZSLNUM, " Serial Number
    ZASSET LIKE ZSHIFTDEPN-ZASSET, " Original asset that was transferred
    ZYEAR LIKE ZSHIFTDEPN-ZYEAR, " Fiscal Year
    ZPERIOD LIKE ZSHIFTDEPN-ZPERIOD, " Fiscal Period
    ZSHIFT1 LIKE ZSHIFTDEPN-ZSHIFT1, " Shift No. 1
    ZSHIFT2 LIKE ZSHIFTDEPN-ZSHIFT1, " Shift No. 2
    ZSHIFT3 LIKE ZSHIFTDEPN-ZSHIFT1, " Shift No. 3
    END OF TY_TABDATA.
    Declaration of the Internal Table with Header Line comprising of the uploaded data.
    DATA: BEGIN OF IT_FILE_UPLOAD OCCURS 0.
    INCLUDE STRUCTURE ALSMEX_TABLINE. " Rows for Table with Excel Data
    DATA: END OF IT_FILE_UPLOAD.
    S E L E C T I O N - S C R E E N *
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME,
    BEGIN OF BLOCK B2 WITH FRAME.
    PARAMETERS: P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK B2,
    END OF BLOCK B1.
    E V E N T : AT S E L E C T I O N - S C R E E N *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    PROGRAM_NAME = SYST-REPID
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = ' '
    STATIC = 'X'
    MASK = '.'
    CHANGING
    FILE_NAME = P_FNAME
    EXCEPTIONS
    MASK_TOO_LONG = 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.
    E V E N T : S T A R T - O F - S E L E C T I O N *
    START-OF-SELECTION.
    Upload Excel file into Internal Table.
    PERFORM UPLOAD_EXCEL_FILE.
    Organize the uploaded data into another Internal Table.
    PERFORM ORGANIZE_UPLOADED_DATA.
    E V E N T : E N D - O F - S E L E C T I O N *
    END-OF-SELECTION.
    *& Form UPLOAD_EXCEL_FILE
    text
    --> p1 text
    <-- p2 text
    FORM UPLOAD_EXCEL_FILE .
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = P_FNAME
    I_BEGIN_COL = 1
    I_BEGIN_ROW = 3
    I_END_COL = 7
    I_END_ROW = 32000
    TABLES
    INTERN = IT_FILE_UPLOAD
    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.
    ENDFORM. " UPLOAD_EXCEL_FILE
    *& Form ORGANIZE_UPLOADED_DATA
    text
    --> p1 text
    <-- p2 text
    FORM ORGANIZE_UPLOADED_DATA .
    SORT IT_FILE_UPLOAD BY ROW
    COL.
    LOOP AT IT_FILE_UPLOAD.
    CASE IT_FILE_UPLOAD-COL.
    WHEN 1.
    WA_TABDATA-ZSLNUM = IT_FILE_UPLOAD-VALUE.
    WHEN 2.
    WA_TABDATA-ZASSET = IT_FILE_UPLOAD-VALUE.
    WHEN 3.
    WA_TABDATA-ZYEAR = IT_FILE_UPLOAD-VALUE.
    WHEN 4.
    WA_TABDATA-ZPERIOD = IT_FILE_UPLOAD-VALUE.
    WHEN 5.
    WA_TABDATA-ZSHIFT1 = IT_FILE_UPLOAD-VALUE.
    WHEN 6.
    WA_TABDATA-ZSHIFT2 = IT_FILE_UPLOAD-VALUE.
    WHEN 7.
    WA_TABDATA-ZSHIFT3 = IT_FILE_UPLOAD-VALUE.
    ENDCASE.
    AT END OF ROW.
    WA_TABDATA-MANDT = SY-MANDT.
    APPEND WA_TABDATA TO IT_TABDATA.
    CLEAR: WA_TABDATA.
    ENDAT.
    ENDLOOP.
    ENDFORM. " ORGANIZE_UPLOADED_DATA
    In the subroutine --> ORGANIZE_UPLOADED_DATA, data are organized as per the structure declared above.
    Regards,
    Abir
    Don't forget to award points *

  • Regarding Uploading of internal Table - Its Urgent.

    Hi All,
                 I want to upload the data from an Excel File into Interna Table.
                 GUI_UPLOAD is used for Flat File but for Excel Which FM should I use?
                 Can Any One give me the sample code for this ?
                 Points will be rewarded.   
                 Thanks in Advance.
    Regards
    Jitendra Gujarathi

    hi
    REPORT zupload_excel_to_it NO STANDARD PAGE HEADING.
    TYPES:   BEGIN OF t_datatab ,
             col1(25)  TYPE c,
             col2(30)  TYPE c,
             col3(30)  TYPE c,
             col4(30)  TYPE c,
             col5(30)  TYPE c,
             col6(30)  TYPE c,
             col7(30) TYPE c,
             col8(30)  TYPE c,
             col9(30)  TYPE c,
             col10(30)  TYPE c,
             col11(30)    TYPE c,
           END OF t_datatab.
    DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
          wa_datatab TYPE t_datatab.
    DATA : gd_scol   TYPE i VALUE '1',
           gd_srow   TYPE i VALUE '1',
           gd_ecol   TYPE i VALUE '256',
           gd_erow   TYPE i VALUE '65536'.
    DATA: it_tab TYPE filetable,
          gd_subrc TYPE i.
    *Selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_file LIKE rlgrap-filename
                   DEFAULT 'c:\test.xls' OBLIGATORY.   " File Name
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      REFRESH: it_tab.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title     = 'Select File'
          default_filename = '*.xls'
          multiselection   = ' '
        CHANGING
          file_table       = it_tab
          rc               = gd_subrc.
      LOOP AT it_tab INTO p_file.
       so_fpath-sign = 'I'.
       so_fpath-option = 'EQ'.
       append so_fpath.
      ENDLOOP.
    START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM upload_excel_file TABLES   it_datatab
                                 USING   p_file
                                         gd_scol
                                         gd_srow
                                         gd_ecol
                                         gd_erow.
    END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3,
                wa_datatab-col4,
                wa_datatab-col5,
                wa_datatab-col6,
                wa_datatab-col7,
                wa_datatab-col8,
                wa_datatab-col9,
                wa_datatab-col10,
                wa_datatab-col11.
      ENDLOOP.
    *&      Form  UPLOAD_EXCEL_FILE
          upload excel spreadsheet into internal table
         -->P_TABLE    Table to return excel data into
         -->P_FILE     file name and path
         -->P_SCOL     start column
         -->P_SROW     start row
         -->P_ECOL     end column
         -->P_EROW     end row
    FORM upload_excel_file TABLES   p_table
                           USING    p_file
                                    p_scol
                                    p_srow
                                    p_ecol
                                    p_erow.
      DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.
    Has the following format:
                Row number   | Colum Number   |   Value
         i.e.     1                 1             Name1
                  2                 1             Joe
      DATA : ld_index TYPE i.
      FIELD-SYMBOLS : .
    Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = p_scol
          i_begin_row             = p_srow
          i_end_col               = p_ecol
          i_end_row               = p_erow
        TABLES
          intern                  = lt_intern
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'Error Uploading file'.
        EXIT.
      ENDIF.
      IF lt_intern[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT lt_intern BY row col.
        LOOP AT lt_intern.
          MOVE lt_intern-col TO ld_index.
          ASSIGN COMPONENT ld_index OF STRUCTURE p_table TO <fs>.
          MOVE lt_intern-value TO .
          AT END OF row.
            APPEND p_table.
            CLEAR p_table.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "UPLOAD_EXCEL_FILE
    plz reward points!
    rgds

  • What's the difference between FM 'UPLOAD' and FM 'ALSM_EXCEL_TO_INTERNAL_T'

    What's the difference between FM 'UPLOAD' and FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    thanks!

    hi,
    Generally FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'  is used for reading Excel sheet i.e, either row wise or column wise . where as WS_UPLOAD will read the entire data in to an internal table in a file format.
    for illustration as how it is used check this out
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = p_infile
                i_begin_col             = '1'
                i_begin_row             = '2'  "Do not require headings
                i_end_col               = '14'
                i_end_row               = '31'
           tables
                intern                  = itab
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
      if sy-subrc <> 0.
        message e010(zz) with text-001. "Problem uploading Excel Spreadsheet
      endif.
    http://www.sapdevelopment.co.uk/file/file_upexcelalt2.htm
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        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.
    http://www.sapdevelopment.co.uk/file/file_uptabpc.htm
    Regards,
    Santosh

  • Problem in Function Module "ALSM_EXCEL_TO_INTERNAL_TABLE"

    Dear All,
    In this function module we give the number of end rows to be picked from the excel sheet. So, please tell me what can be the maximum number, currently I have put 4000 end rows.
    Thanx&Reg,
    Nishu

    Hai Nishu
    *& Report ZK_REPORT *
    REPORT ZK_REPORT.
    internal table declarations
    DATA: BEGIN OF ITAB OCCURS 0,
    NAME(20) TYPE C,
    ADDR(20) TYPE C,
    END OF ITAB.
    DATA: ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    DATA: K1 TYPE I VALUE 1,
    M1 TYPE I VALUE 1,
    K2 TYPE I VALUE 100,
    M2 TYPE I VALUE 9999.
    use FM for uploading data from EXCEL to internal table
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = 'C:\book1.xls'
    I_BEGIN_COL = K1
    I_BEGIN_ROW = M1
    I_END_COL = K2
    I_END_ROW = M2
    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.
    ENDLOOP.
    Thanks & regards
    Sreeni

  • 'ALSM_EXCEL_TO_INTERNAL_TABLE  issue

    Hi
    I tried below fm to download data. But sy-subrc value is 2
    pls help me
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      =  p_pcfile
        i_begin_col                   = 1
        i_begin_row                   = 2
        i_end_col                     = 255
        i_end_row                     = 65000
      tables
        intern                        = it_material
    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.

    hi,
    Check out the file format and the path ...Refer the below path for a piece of code for reference
    http://www.sapdev.co.uk/file/file_upexcelalt2.htm
    Regards,
    Santosh

  • Regarding  bapi ( urgent)

    hi
    w t is   the  difference   b/w   of BAPIMEPOHEADERX,BAPIMEPOHEADER
    wr can i use   this   BAPIMEPOHEADERX,
    Regards
    Spandana

    hi spandana,
    check this sample program.
    *& Report  ZMM_PO_CREATE1                                              *
    REPORT  ZMM_PO_CREATE1                          .
    data : POHEADER like BAPIMEPOHEADER occurs 0 with header line,
           POHEADERX like BAPIMEPOHEADERX occurs 0 with header line,
           POITEM like BAPIMEPOITEM occurs 0 with header line,
           POITEMX like BAPIMEPOITEMX occurs 0 with header line,
           POESLLC like BAPIESLLC occurs 0 with header line,
           POACCOUNT like BAPIMEPOACCOUNT occurs 0 with header line,
           POACCOUNTX like BAPIMEPOACCOUNTX occurs 0 with header line,
           POCONDHEADER like BAPIMEPOCONDHEADER occurs 0 with header line,
           POCONDHEADERX like BAPIMEPOCONDHEADERX occurs 0 with header line,
           POCOND like BAPIMEPOCOND occurs 0 with header line,
           RETURN like BAPIRET2 occurs 0 with header line.
    data : po_no(10).
    data : begin of it_head occurs 0,
           ref(10),
           bsart like ekko-bsart,
           lifnr like ekko-lifnr,
           ekorg like ekko-ekorg,
           ekgrp like ekko-ekgrp,
           bukrs like ekko-bukrs,
           verkf like ekko-verkf,
           telf1 like ekko-telf1,
           ihrez like ekko-ihrez,
           unsez like ekko-unsez,
           kdatb(10),
           kdate(10),
           end of it_head.
    data : begin of it_det occurs 0,
           ref(10),
           knttp like ekpo-knttp,
           pstyp like ekpo-pstyp,
           txz01 like ekpo-txz01,
           matkl like ekpo-matkl,
           werks like ekpo-werks,
           afnam like ekpo-afnam,
           ktext1 like esll-ktext1,
           srvpos like esll-srvpos,
           frmval1 like esll-frmval1,
           frmval2 like esll-frmval2,
           menge like esll-menge,
           kostl like eskn-kostl,
           sakto like eskn-sakto,
           zzcode like eskn-zzcode,
           kbetr like konv-kbetr,
           end of it_det.
    data : c_col1 TYPE i VALUE '0001',
           c_col2 TYPE i VALUE '0002',
           c_col3 TYPE i VALUE '0003',
           c_col4 TYPE i VALUE '0004',
           c_col5 TYPE i VALUE '0005',
           c_col6 TYPE i VALUE '0006',
           c_col7 TYPE i VALUE '0007',
           c_col8 TYPE i VALUE '0008',
           c_col9 TYPE i VALUE '0009',
           c_col10 TYPE i VALUE '0010',
           c_col11 TYPE i VALUE '0011',
           c_col12 TYPE i VALUE '0012',
           c_col13 TYPE i VALUE '0013',
           c_col14 TYPE i VALUE '0014',
           c_col15 TYPE i VALUE '0015',
           c_col16 TYPE i VALUE '0016'.
    data : v_currentrow type i,
           v_currentrow1 type i.
    data : itab_head like ALSMEX_TABLINE occurs 0 with header line,
           itab_det like ALSMEX_TABLINE occurs 0 with header line.
    data : file_head type RLGRAP-FILENAME,
           file_item type RLGRAP-FILENAME.
    file_head = 'C:\Documents and Settings\abap.fi\Desktop\head.xls'.
    file_item = 'C:\Documents and Settings\abap.fi\Desktop\item.xls'.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file_head
        i_begin_col                   = 1
        i_begin_row                   = 1
        i_end_col                     = 12
        i_end_row                     = 50
      tables
        intern                        = itab_head
    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.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file_item
        i_begin_col                   = 1
        i_begin_row                   = 1
        i_end_col                     = 16
        i_end_row                     = 50
      tables
        intern                        = itab_det
    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.
    IF itab_head[] IS INITIAL.
       WRITE:/ 'No Header Data  Exists '.
       STOP.
    ELSE.
    sort itab_head by row col.
    read table itab_head index 1.
    v_currentrow = itab_head-row.
    loop at itab_head.
    if itab_head-row ne v_currentrow.
       APPEND it_head.
       v_currentrow = itab_head-row.
       ENDIF.
    CASE itab_head-col.
            WHEN  c_col1.
              it_head-ref = itab_head-value.
            WHEN  c_col2.
              it_head-bsart = itab_head-value.
            WHEN c_col3.
              it_head-lifnr = itab_head-value.
            WHEN c_col4.
              it_head-ekorg = itab_head-value.
            WHEN c_col5.
              it_head-ekgrp = itab_head-value.
            WHEN c_col6.
              it_head-bukrs = itab_head-value.
            WHEN c_col7.
              it_head-verkf = itab_head-value.
            WHEN c_col8.
              it_head-telf1 = itab_head-value.
            WHEN c_col9.
              it_head-ihrez = itab_head-value.
            WHEN c_col10.
              it_head-unsez = itab_head-value.
            WHEN c_col11.
              it_head-kdatb = itab_head-value.
            WHEN c_col12.
              it_head-kdate = itab_head-value.
    ENDCASE.
    ENDLOOP.
    APPEND it_head.
    CLEAR it_head.
    ENDIF.
    IF itab_det[] IS INITIAL.
       WRITE:/ 'No Item Data  Exists '.
       STOP.
    ELSE.
    sort itab_det by row col.
    read table itab_det index 1.
    v_currentrow1 = itab_det-row.
    loop at itab_det.
    if itab_det-row ne v_currentrow1.
       APPEND it_det.
       v_currentrow1 = itab_det-row.
       ENDIF.
    CASE itab_det-col.
            WHEN  c_col1.
              it_det-ref = itab_det-value.
            WHEN  c_col2.
              it_det-knttp = itab_det-value.
            WHEN c_col3.
              it_det-pstyp = itab_det-value.
            WHEN c_col4.
              it_det-txz01 = itab_det-value.
            WHEN c_col5.
              it_det-matkl = itab_det-value.
            WHEN c_col6.
              it_det-werks = itab_det-value.
            WHEN c_col7.
              it_det-afnam = itab_det-value.
            WHEN c_col8.
              it_det-srvpos = itab_det-value.
            WHEN c_col9.
              it_det-ktext1 = itab_det-value.
            WHEN c_col10.
              it_det-frmval1 = itab_det-value.
            WHEN c_col11.
              it_det-frmval2 = itab_det-value.
            WHEN c_col12.
              it_det-menge = itab_det-value.
            WHEN c_col13.
              it_det-kostl = itab_det-value.
            WHEN c_col14.
              it_det-sakto = itab_det-value.
            WHEN c_col15.
              it_det-zzcode = itab_det-value.
            WHEN c_col16.
              it_det-kbetr = itab_det-value.
    ENDCASE.
    ENDLOOP.
    APPEND it_det.
    CLEAR it_det.
    ENDIF.
    loop at it_head.
    poheader-doc_type = it_head-bsart.
    poheader-vendor = it_head-lifnr.
    poheader-purch_org = it_head-ekorg.
    poheader-pur_group = it_head-ekgrp.
    poheader-comp_code = it_head-bukrs.
    poheader-sales_pers = it_head-verkf.
    poheader-telephone = it_head-telf1.
    poheader-REF_1 = it_head-ihrez.
    poheader-OUR_REF = it_head-unsez.
    poheader-VPER_START = it_head-kdatb.
    poheader-VPER_END = it_head-kdate.
    loop at it_det where ref = it_head-ref.
      poitem-acctasscat = it_det-knttp.
      poitem-item_cat = it_det-pstyp.
      poitem-short_text = it_det-txz01.
      poitem-matl_group = it_det-matkl.
      poitem-plant = it_det-werks.
      poitem-PREQ_NAME = it_det-afnam.
      POESLLC-SERVICE = it_det-srvpos.
      POESLLC-SHORT_TEXT = it_det-ktext1.
      POESLLC-FORM_VAL1 = it_det-frmval1.
      POESLLC-FORM_VAL2 = it_det-frmval2.
      POESLLC-QUANTITY = it_det-menge.
      POACCOUNT-COSTCENTER = it_det-kostl.
      POACCOUNT-GL_ACCOUNT = it_det-sakto.
      POCONDHEADER-COND_TYPE = 'R000'.
      POCONDHEADER-COND_VALUE = it_det-kbetr.
    endloop.
    endloop.
    poheaderx-doc_type = 'X'.
    poheaderx-vendor = 'X'.
    poheaderx-purch_org = 'X'.
    poheaderx-pur_group = 'X'.
    poheaderx-comp_code = 'X'.
    poheaderx-sales_pers = 'X'.
    poheaderx-telephone = 'X'.
    poheaderx-REF_1 = 'X'.
    poheaderx-OUR_REF = 'X'.
    poheaderx-VPER_START = 'X'.
    poheaderx-VPER_END = 'X'.
    poitemx-acctasscat = 'X'.
    poitemx-item_cat = 'X'.
    poitemx-short_text = 'X'.
    poitemx-matl_group = 'X'.
    poitemx-plant = 'X'.
    poitemx-PREQ_NAME = 'X'.
    *POESLLCx-SHORT_TEXT = 'X'.
    POACCOUNTx-COSTCENTER = 'X'.
    POACCOUNTx-GL_ACCOUNT = 'X'.
    POCONDHEADER-cond_type = 'X'.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        poheader                     = poheader
       POHEADERX                    = poheaderx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
    IMPORTING
       EXPPURCHASEORDER             = po_no
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    TABLES
       RETURN                       = return
       POITEM                       = poitem
       POITEMX                      = poitemx
      POADDRDELIVERY               =
      POSCHEDULE                   =
      POSCHEDULEX                  =
       POACCOUNT                    = poaccount
      POACCOUNTPROFITSEGMENT       =
       POACCOUNTX                   = poaccountx
       POCONDHEADER                 = pocondheader
       POCONDHEADERX                = pocondheaderx
      POCOND                       =
      POCONDX                      =
      POLIMITS                     =
      POCONTRACTLIMITS             =
       POSERVICES                   = poesllc
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          =
    IMPORTING
       RETURN        =
    if sy-subrc = 0.
    loop at return.
    write return-MESSAGE_V1.
    write po_no.
    endloop.
    endif.
    reward points if hlpful.

  • Regarding ABAP program to read and manipulate data from Excel file....

    Hi,
    I want to write a ABAP program which will read Excel file which has three columns viz: Col A, Col B and Col C.
    If there is no data in Col B and Col C for a given record in Column A, then progam should print all those records on screen with write statement.
    Regards,
    Rajesh.

    Hi
    Check
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
    begcol TYPE i DEFAULT 1 NO-DISPLAY,
    begrow TYPE i DEFAULT 1 NO-DISPLAY,
    endcol TYPE i DEFAULT 100 NO-DISPLAY,
    endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = filename
    i_begin_col = begcol
    i_begin_row = begrow
    i_end_col = endcol
    i_end_row = endrow
    TABLES
    intern = intern
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    After getting Records in INTERN TABLE  You can loop it to check where columns B & C are empty  and store them in another table .
    LOOP AT intern.
    IF INTERN  B and C has value  .
    CONTINUE
    ELSE .
    MOVE THEM INTO ANOTHER TABLE ITAB .
    ENDIF .
    ENDLOOP.
    THEN LOOP ITAB .
    WRITE : ' '
    ENDLOP .
    Hope this Helps .
    Praveen

  • About the 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    Hi all,
    I use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' to write a report for the upload the Excel to Datatable.
    And now, i am wondering to know wheater this FM is international or not, cause this report may be deliver to customers, and we hope this report will keep stable as soon as possible.
    thank you very much!

    Hi!
    You didn't find answer for this, because it is not possible. If you run your program in background, it is running on the server, and does not have any connection to your local machine. That's why you can't upload/download in background mode.
    You might try to address somehow your local PC, with its IP or MAC address, but I don't think does this task worth so much time.
    Run your program in online mode, or if you want to run it in background, then upload your file into the SAP server.
    Regards
    Tamá

  • Incorrect result using the function ALSM_EXCEL_TO_INTERNAL_TABLE

    I have used the function ALSM_EXCEL_TO_INTERNAL_TABLE to load a Excel sheet on an internal table and the function returns the following result:
    Row  Col   Value
    0001 0001 902000100 A601 K 627542130 021 AGARDUN ZMAS 673 EU
    0002 0001 902000101 A602 K 627542131 022 AGARDUN ZMAS 695 EU
    0003 0001 902000102 A603 K 627542132 023 AGARDUN ZMAS 717 EU
    0004 0001 902000103 A604 k 627542133 024 AGARDUN ZMAS 739 EU
    0005 0001 902000104 A605 k 627542134 025 AGARDUN ZMAS 761 EU
    0006 0001 902000105 A606 W 627542135 026 AGARDUN ZMAS 783 EU
    0007 0001 902000106 A607 W 627542136 027 AGARDUN ZMAS 805 EU
    0008 0001 902000107 A608 W 627542137 028 AGARDUN ZMAS 827 EU
    0009 0001 902000108 A609 K 627542138 029 AGARDUN ZMAS 849 EU
    0010 0001 902000109 A610 k 627542139 030 AGARDUN ZMAS 871 EU
    0011 0001 902000110 A611 O 627542140 031 AGARDUN ZMAS 893 EU
    That is to say, the excel sheet has nine columns, and the function thinks that only has 1 column.
    I have checked the function with the same file in other computers, and the result has been the correct one, that is to say, the function returns the value of the column in its corresponding column:
    Row  Col   Value
    0001 0001 902000100
    0001 0002 A601
    0001 0003 K
    0001 0004 627542130
    0001 0005 021
    0001 0006 AGARDUN
    0001 0007 ZMAS
    0001 0008 673
    0001 0009 EU
    0002 0001 902000101
    0002 0002 A602
    0002 0003 K
    0002 0004 627542131
    0002 0005 022
    0002 0006 AGARDUN
    0002 0007 ZMAS
    0002 0008 717
    0002 0009 EU
    Can you help me?
    Thanks.

    Hi Garduño,
    1. U want to upload data from EXCEL
    into internal table.
    2. and u are using ALSM_EXCEL_TO_INTERNAL_TABLE.
    3. But We cannot do this direclty !
    For uploading purpose :
    6. There are TWO options.
    a) either save the excel to TAB Delimited file,
    and use GUI_UPLOAD to upload the data in internal table.
    b) use FM for excel purpose.
    7. a) is easy and recommended
    8. b) there is a FM for it,
    but we have to apply some more logic
    bcos the FM uploads data of excel
    in the intenal table,
    CELL BY CELL
    9. afTER THAT , we have to convert this cell by cell data,
    into our format of internal table.
    10. use this code (just copy paste in new program)
    (it is tried wit T001 structure data)
    (it will AUTOMATICALLY based upon the
    fields of internal table,
    convert data from cell by cell,
    to that of internal table fields)
    REPORT abc.
    DATA : ex LIKE TABLE OF alsmex_tabline WITH HEADER LINE.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
    DATA : col TYPE i.
    DATA : col1 TYPE i.
    FIELD-SYMBOLS :  .
    DATA : fldname(50) TYPE c.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = 'd:def.xls'
    i_begin_col = 1
    i_begin_row = 1
    i_end_col = 100
    i_end_row = 100
    TABLES
    intern = ex
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    BREAK-POINT.
    CALL FUNCTION 'GET_COMPONENT_LIST'
    EXPORTING
    program = sy-repid
    fieldname = 'T001'
    TABLES
    components = cmp.
    LOOP AT ex.
    AT NEW row.
    IF sy-tabix  = ex-value.
    ENDLOOP.
    BREAK-POINT.
    regards,
    amit m.

  • ALSM_EXCEL_TO_INTERNAL_TABLE

    I have a report which is uploading data from excel and using function ALSM_EXCEL_TO_INTERNAL_TABLE to get the data into internal table.
    I have used bdc and called transaction to perform a task.
    CALL TRANSACTION 'tran' USING bdc_tab MODE 'N'.
    Now i need to run my report in background.While executin program in background job got canceled with job log as
    "ABAP/4 processor: RAISE_EXCEPTION"
    Details of error:
    000010   FUNCTION WS_QUERY.
    000020   *"
    000030   ""Lokale Schnittstelle:
    000040   *"  IMPORTING
    000050   *"     VALUE(ENVIRONMENT) TYPE  C OPTIONAL
    000060   *"     VALUE(FILENAME) TYPE  C OPTIONAL
    000070   *"     VALUE(QUERY) TYPE  C
    000080   *"     VALUE(WINID) TYPE  C OPTIONAL
    000090   *"  EXPORTING
    000100   *"     VALUE(RETURN)
    000110   *"  EXCEPTIONS
    000120   *"      INV_QUERY
    000130   *"      NO_BATCH
    000140   *"      FRONTEND_ERROR
    000150   *"
    000160
    000170   * check FILENAME NOT INITIAL : FL            GL 11.8.1994
    000180   *                            : FE
    000190   *                            : DE
    000200   * check WINID NOT INITIAL    : WI    ==> INV_QUERY
    000210
    000220   DATA: GUI_EXIST TYPE C VALUE SPACE.
    000230
    000240     CALL FUNCTION 'GUI_IS_AVAILABLE'
    000250          IMPORTING
    000260               RETURN = GUI_EXIST.
    000270
    000280     IF GUI_EXIST IS INITIAL.
         >        RAISE NO_BATCH.
    000300     ENDIF.
    <REMOVED BY MODERATOR>
    Title and Message edited by: Alvaro Tejada Galindo on Dec 31, 2007 11:23 AM

    Hello Concern,
    Back Ground Job will  not take file from presentation Server. To do such thing you have following way..
    1. Either Save the Data file in Appliation Server itself.
    2. Better to save the file in File Server.
    In my org. we have started with Application Server but later on Basic guys say due to this there is performance issue so we have change it to File Server.
    Hope it help you,
    Regards
    Swati Namdeo

Maybe you are looking for

  • Is my K9N Diamond defective?

    I have had quite a few problems so this is gonna be a long one. Hi everyone. Recently (1½ weeks ago), i bought all the parts i needed for a new computer. Heres the list: MSI K9N-Diamond AMD Athlon64 X2 3800+ EE (Energy Efficient 65Watt) + Zalman CNPS

  • Have this problem over a month now

    Afternoon everyone, Where should I start.. About a month ago my hub started resetting itself whenever I used internet, i spoke to numerous amount of people over at the call centre and about 2 weeks after calling them nearly every day they sent openre

  • Excise tab not required in MIGO if  Inventorised tax code is used

    hi expert Can we define systen if  if  Inventorised tax code is used ,Excise tab not required in MIGO . regard Nabil

  • Snow Leopard and Final Cut question.

    What happens to all my FCP projects when I install Snow Leopard onto my 24" iMac. I know that's probably not a very educated question, but I'm wondering if anything changes in my FCP projects and settings after I make the upgrade. Also do I need to u

  • Accessing  table column names from WAD

    Hi  All,    I w ould  like  to  access  the  column names (the  Infoobject name) of a  table . Was  playing  arnd with  the API..SAPBWGetDataProviderDimensions but it  gives only characters  column name.. WAS wondering if  any of  you  has any  idea