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

ALSM_EXCEL_TO_INTERNAL_TABLE gives error while uploading data

Former Member
0 Likes
695

Hi,

There is a report which uses ALSM_EXCEL_TO_INTERNAL_TABLE to upload the data from the excel sheet and then process it further.

During the development we had successfully done the testing at our end.

We are using GUI 710 patch level 12 and microsoft excel 2007.

At the customer end they are using GUI 710 patch level 7 and microsoft excel 2003.

The user is unable to upload the file in their system and the FM raises an exception.

Can any one suggest what may be the problem.

Regards,

taher

Hi,

There is a report which uses ALSM_EXCEL_TO_INTERNAL_TABLE to upload the data from the excel sheet and then process it further.

During the development we had successfully done the testing at our end.

We are using GUI 710 patch level 12 and microsoft excel 2007.

At the customer end they are using GUI 710 patch level 7 and microsoft excel 2003.

The user is unable to upload the file in their system and the FM raises an exception.

Can any one suggest what may be the problem.

Regards,

taher

2 REPLIES 2
Read only

Former Member
0 Likes
543

Hi Taher,

Any specific reason for using ALSM_EXCEL_TO_INTERNAL_TABLE instead of FM 'GUI_UPLOAD' ?

Also please let us know the details about exception.

Check the template which you are using for upload & which the customer is using.. Looks like some problem with the template/date format/quantity etc.

Thanks,

Best regards,

Prashant

Read only

Former Member
0 Likes
543

u declare like this

DATA: BEGIN OF l_intern OCCURS 0.

INCLUDE STRUCTURE alsmex_tabline.

DATA: END OF l_intern.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS: dataset LIKE RLGRAP-FILENAME default 'C:\FK05.txt'.

SELECTION-SCREEN END OF BLOCK B1.

At selection-screen on value-request for dataset.

perform get_file_name.

***********************************************************

FORM get_file_name.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

  • EXPORTING

  • PROGRAM_NAME = SYST-REPID

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

  • STATIC = ' '

  • MASK = ' '

CHANGING

file_name = dataset

  • 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.

ENDFORM. " get_file_name

PERFORM data_upload TABLES itab USING dataset.

****************************************************************************************************

form data_upload TABLES p_it_tab

USING p_file.

FIELD-SYMBOLS : <fs>.

*.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_file

i_begin_col = '1'

i_begin_row = '2'

i_end_col = '256'

i_end_row = '10000'

TABLES

intern = l_intern

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc NE 0.

FORMAT COLOR COL_BACKGROUND INTENSIFIED.

WRITE : / 'File Error'.

EXIT.

ENDIF.

IF l_intern[] IS INITIAL.

FORMAT COLOR COL_BACKGROUND INTENSIFIED.

WRITE : / 'No Data Uploaded'.

EXIT.

ELSE.

SORT l_intern BY row col.

LOOP AT l_intern.

MOVE l_intern-col TO l_index.

ASSIGN COMPONENT l_index OF STRUCTURE p_it_tab TO <fs>.

MOVE l_intern-value TO <fs>.

AT END OF row.

APPEND p_it_tab.

CLEAR p_it_tab.

ENDAT.

ENDLOOP.

ENDIF.