Application Development 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: 

Error-while executing Standard FM 'TEXT_CONVERT_XLS_TO_SAP'

Former Member
0 Kudos

Hi Gurus,

I'm using Standard FM 'TEXT_CONVERT_XLS_TO_SAP' ,

while executing i got an Error " Error generating test Frame'

Description: -


Error generating the test frame Message no. FL819 Diagnosis The system could not generate a syntactically correct test frame for function module TEXT_CONVERT_XLS_TO_SAP. You therefore cannot test the function module using the test environment. You have probably used an ABAP feature in the interface definition that is not yet supported in the test environment. The error message is: "OF" expected after "TABLE". System Response Procedure Check whether you can change the interface of the function module so that it is possible to generate the test frame. If this is not possible,you will have to write your own utility for testing the function module. Procedure for System Administration

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

An example of usage of fm TEXT_CONVERT_XLS_TO_SAP:


TYPE-POOLS: TRUXS.
data: trd type TRUXS_T_TEXT_DATA,
      fnm like RLGRAP-FILENAME.

data: BEGIN OF tcd OCCURS 0,
        col1(255),
        col2(255),
      END OF tcd.

fnm = 'c:\test.xls'.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
  EXPORTING
    i_tab_raw_data             = trd
    i_filename                 = fnm
  tables
    i_tab_converted_data       = tcd
 EXCEPTIONS
   CONVERSION_FAILED          = 1
   OTHERS                     = 2.

In the example above we get datas from two columns. You can add more to the i_tab_converted_data if required.

Regards,

Ali

5 REPLIES 5

Former Member
0 Kudos

Hi,

An example of usage of fm TEXT_CONVERT_XLS_TO_SAP:


TYPE-POOLS: TRUXS.
data: trd type TRUXS_T_TEXT_DATA,
      fnm like RLGRAP-FILENAME.

data: BEGIN OF tcd OCCURS 0,
        col1(255),
        col2(255),
      END OF tcd.

fnm = 'c:\test.xls'.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
  EXPORTING
    i_tab_raw_data             = trd
    i_filename                 = fnm
  tables
    i_tab_converted_data       = tcd
 EXCEPTIONS
   CONVERSION_FAILED          = 1
   OTHERS                     = 2.

In the example above we get datas from two columns. You can add more to the i_tab_converted_data if required.

Regards,

Ali

0 Kudos

Thanq Anli,

I'm using what u said senario but still i got an Error" THE TYPE TRUXS_T_TEXT_DATA UNKNOWN"

Even i declared TYPE-POOLS: TRUXS.

could u help me.

sivakumar

0 Kudos

hai siva..

iam sending a sample prg. check it out.

it will be helpful for U to solve the problem.

type-pools : truxs.

types : begin of ty_tab,

f1(10) type c,

f2(10) type c,

f3(10) type c,

end of ty_tab.

data : wa_tab type ty_tab,

lt_tab like standard table of wa_tab.

data : i_tab_raw_data type truxs_t_text_data.

data : fnam type ibipparms-path.

parameter : p_fnam type rlgrap-filename.

*****

at selection-screen on value-request for p_fnam.

call function 'F4_FILENAME'

importing

file_name = fnam

.

p_fnam = fnam.

*****

start-of-selection.

call function 'TEXT_CONVERT_XLS_TO_SAP'

exporting

i_tab_raw_data = i_tab_raw_data

i_filename = fnam

tables

i_tab_converted_data = lt_tab.

loop at lt_tab into wa_tab.

write 😕 wa_tab-f1, wa_tab-f2.

endloop.

Former Member
0 Kudos

hi siva,

How to did u solved the problem.. i am alo getting the same problem

  truxs_t_text_data is unknown...

0 Kudos

declare truxs_t_text_data and pass it in FM like mentioned below.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
*       I_FIELD_SEPERATOR    =
i_line_header        = abap_true
i_tab_raw_data       = lt_raw
i_filename           = p_file
TABLES
i_tab_converted_data = lt_file_data   " Data from excel file
EXCEPTIONS
conversion_failed    = 1
OTHERS               = 2.