Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Excel Upload

Former Member
0 Likes
824

Hi,

I want to upload an excel from Presentation Server to an internal table for processing the entries.

The file is obtained from a Third Party system and has some entry in the first Row, followed by Column names in the 2nd Row. And the actual column entries starting from the third row.

Square D Remittance Discount Check 02/10/09

Invoice No InvAmt DiscAmt Amt Paid CheckNo Reason code

2504714306 397500 3975 393525 604659

2567229501 26367 264 26103 604659 DD

2567229502 77160 772 76388 604659

While uploading the file using CALL METHOD cl_gui_frontend_services=>gui_upload,

I am getting the BAD DATA FORMAT exception.

Is there a way to handle such an Excel Format in the gui_upload call?

Please let me know.

Thanks,

Binu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
706

hi.....

use FM ''ALSM_EXCEL_TO_INTERNAL_TABLE"

5 REPLIES 5
Read only

Former Member
0 Likes
706

Hi,

Try using FM 'TEXT_CONVERT_XLS_TO_SAP'

Read only

Former Member
0 Likes
706

hi Binu,.



use FM 'TEXT_CONVERT_XLS_TO_SAP'

OR

'ALSM_EXCEL_TO_INTERNAL_TABLE'


the above two funcion modules are used to convert excel data into intrernal tables directly..

you can mention the number of rows to ignore.. in the the function module..

..

Reagrds,

Prabhudas

Read only

Former Member
0 Likes
707

hi.....

use FM ''ALSM_EXCEL_TO_INTERNAL_TABLE"

Read only

Former Member
0 Likes
706

Hi,

For the Excel file upload you can do like:



Type-pools Truxs.

DATA: it_raw TYPE truxs_t_text_data.
*      internal table declared to be passed in the
*      function module used to convert data from xls to sap

*&---------------------------------------------------------------------*
*&Function module called to upload xls data into an internal table
*&---------------------------------------------------------------------*
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_field_seperator    = 'X'
      i_line_header        = 'X'
      i_tab_raw_data       = it_raw
      i_filename           = p_file
    TABLES
      i_tab_converted_data = it_upload[]   "internal table into which data
                                                           "will get uploaded having the same 
                                                           "structure of the required fields
    EXCEPTIONS
      conversion_failed    = 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.

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
706

hi,

Please follow the link below

Regards,

Sarita