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: 

What for type pool TRUX is used

Former Member
0 Kudos

Hi,

I'm new to BDC. Can anyone please tell me what for type pool TRUX is used in BDC programs. What is TRUXS_T_TEXT_DATA. In the function 'TEXT_CONVERT_XLS_TO_SAP' what should be exported for I_TAB_RAW_DATA?

Thanks in advance....

Thanks & Regards,

V.Sriram Kumar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

TRUCX is just a type pool which will have type definitions.

truxs_t_text_data an internal table structure of line size 4096,Needs to be passed empty.Its for internal conversion.

DATA : lw_filename  TYPE rlgrap-filename,    " Filename
         lt_raw_table TYPE truxs_t_text_data,       " Pass empty
         lw_len       TYPE i.


  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_tab_raw_data       = lt_raw_table
      i_filename           = lw_filename
    TABLES
      i_tab_converted_data = <Internal table>         " Table to hold excel data.
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.

  IF sy-subrc <> 0.
  Message
  ENDIF.                               " IF SY-SUBRC <> 0.

Regards,

Gurpreet

3 REPLIES 3

Former Member
0 Kudos

TRUCX is just a type pool which will have type definitions.

truxs_t_text_data an internal table structure of line size 4096,Needs to be passed empty.Its for internal conversion.

DATA : lw_filename  TYPE rlgrap-filename,    " Filename
         lt_raw_table TYPE truxs_t_text_data,       " Pass empty
         lw_len       TYPE i.


  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_tab_raw_data       = lt_raw_table
      i_filename           = lw_filename
    TABLES
      i_tab_converted_data = <Internal table>         " Table to hold excel data.
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.

  IF sy-subrc <> 0.
  Message
  ENDIF.                               " IF SY-SUBRC <> 0.

Regards,

Gurpreet

0 Kudos

Hi Gurpreet,

Thanks very much for the reply. Do you mean whenever we use Excel sheet for data transfer we need to pass this empty internal table of type TRUXS_T_TEXT_DATA to the excel upload function?

One more thing I want to ask is, RLGRAP-FILENAME.

Thanks once again....

Regards,

Sriram.

0 Kudos

TRUXS_T_TEXT_DATA pass empty and Data from the excel sheet will appear in the internal table specified in I_TAB_CONVERTED_DATA.

RLGRAP-FILENAME is for the file path to be use to upload.

To select the path at runtime use class:

cl_gui_frontend_services=>open_dialog

In AT SELECTION-SCREEN ON VALUE REQUEST FRO <Field> EVENT.

Regards,

Gurpreet