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

modulepool

Former Member
0 Likes
681

Hi abapers,

I have used text_convert_xls_to_sap to convert xls but the problem is header data should be skipped.

please guide me in this case.

Regards

ABAPER

5 REPLIES 5
Read only

Former Member
0 Likes
656

HI,

Pass 'X' to the I_LINE_HEADER parameter.

Read only

0 Likes
656

Hi,

when i pass line_header as 'X' it is saying that receiving is of type N but the excel files fields receiving type is different.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
656

Hi,

When the internal table is populated from the excel file, then the very first line must be containing the header data.

So use code:-


DELETE itab index 1.

Hope this helps you.

Regards,

Tarun

Read only

viquar_iqbal
Active Contributor
0 Likes
656

Try giving

i_line_header = 'X'

Thanks

Viquar Iqbal

Read only

Former Member
0 Likes
656

Hi Janasi,

Please find the below code.

BEGIN OF t_excel,

****your fields***

END OF t_excel.

DATA: it_excel TYPE TABLE OF t_excel,

i_raw TYPE truxs_t_text_data,

wa_excel TYPE t_excel.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

i_field_seperator = 'X'

i_tab_raw_data = i_raw

i_filename = p_fname

TABLES

i_tab_converted_data = it_excel.

IF sy-subrc <> 0.

****error message

ENDIF.

DELETE it_excel INDEX 1.

IF it_excel IS INITIAL.

MESSAGE i000(0k) WITH 'No Data in Excel File'.

ENDIF.

Regards,

Anil