04-09-2009 7:31 AM
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
04-09-2009 7:41 AM
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
04-09-2009 7:41 AM
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
04-09-2009 7:53 AM
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.
04-09-2009 8:05 AM
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