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

Type conversion error while excel upload

Former Member
0 Likes
2,152

Hi,

I am using FM ALSM_EXCEL_TO_INTERNAL_TABLE to convert excel data in to internal table and then uploading it to a Z table. For this, FM ALSM_EXCEL_TO_INTERNAL_TABLE takes parameter of structure ALSMEX_TABLINE and saves cell value in a field of type Char 50. The issue is,  The excel file can contain data of length much more than 255. I have tried defining data type as LCHR & String but while storing, it gives the exception CX_SY_DYN_CALL_ILLEGAL_TYPE with Run time error  PERFORM_CONFLICT_TAB_TYPE on the following internal code.

  PERFORM separated_to_intern_convert TABLES excel_tab intern

                                      USING  ld_separator.

* clear clipboard

  REFRESH excel_tab. ---this line throws exception.

  CALL METHOD cl_gui_frontend_services=>clipboard_export

     IMPORTING

        data                 = excel_tab

     CHANGING

        rc                   = ld_rc

     EXCEPTIONS

        cntl_error           = 1

*       ERROR_NO_GUI         = 2

*       NOT_SUPPORTED_BY_GUI = 3

        OTHERS               = 4

          .

Please suggest how do I resolve this type incompatibility.

Thanks,

Binita

3 REPLIES 3
Read only

Aashish28
Contributor
0 Likes
1,112

Hiii,

        Check your declaration part of excel_tab and one more thing as you told The excel file can contain data of length much more than 255  for this purpose you may use OLE2 to read your data from Excel.

Read only

Former Member
0 Likes
1,112

Hi Ashish,

Thanks for responding. I checked and debugged to the actual line which gives error :

It is the standard include LALSMEXF01 subroutine  separated_to_intern_convert. this has argument of type ty_t_itab which is defined with structure alsmex_tabline. this structure is used extensively for this excel to table conversion FMs and Includes. the problem is, it has the field Value which is Char(50) and what my calling program passes is Lchar or string. So there exists incompatibility.I wonder why would SAP allow to copy excel which has column data delimited to just 50 Chars!! is there any way I resolve this? making changes in the standard structure is the last thing i would do.

Please advise.

thanks,

Binita

Read only

0 Likes
1,111

Hiii,

       see property of

        

ALSM_EXCEL_TO_INTERNAL_TABLE is not released and it has several limitations , SAP explained this in OSS - Note 933420 https://service.sap.com/sap/support/notes/933420,

Instead of making changes in in the standard structure i already told you make your own z-function with ole2  for reference purpose make copy of ALSM_EXCEL_TO_INTERNAL_TABLE and make changes in subroutine  separated_to_intern_convert .

Hope you can do this