cancel
Showing results for 
Search instead for 
Did you mean: 

Excel upload

Former Member
0 Kudos

Hello Expert,

I have record's in excel sheet. I want to upload into R/3 Databasd via WDAABAP.

PLz tell me steps how to do it.

Regards,

Varun

Accepted Solutions (0)

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Abhi

Former Member
0 Kudos

Hello,

By following the above link.

I have used this code its working for notepad but its dumping for Excel sheet.

The dump is " A character set conversion is not possible".

Could you plz help me out for the same, i have to do it for excel sheet.

*Code start

DATA content TYPE xstring.

DATA size TYPE i.

DATA lv_string TYPE string.

DATA s_cont TYPE string.

DATA x_cont TYPE xstring.

DATA convt TYPE REF TO cl_abap_conv_in_ce.

wd_context->get_attribute( EXPORTING name = 'FILECONTENT' IMPORTING value = x_cont ).

convt = cl_abap_conv_in_ce=>create( input = x_cont ).

convt->read( IMPORTING data = s_cont ).

DATA: fields TYPE string_table.

DATA: lv_field TYPE string.

DATA: s_table TYPE string_table.

DATA: itab TYPE zvj_tt_emp.

DATA: str_itab TYPE zvj_ts_emp.

SPLIT s_cont AT cl_abap_char_utilities=>cr_lf INTO TABLE s_table.

FIELD-SYMBOLS: <wa_table> LIKE LINE OF s_table.

LOOP AT s_table ASSIGNING <wa_table>.

SPLIT <wa_table> AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.

READ TABLE fields INTO lv_field INDEX 1.

str_itab-employee_id = lv_field.

READ TABLE fields INTO lv_field INDEX 2.

str_itab-name = lv_field.

APPEND str_itab TO itab.

ENDLOOP.

*code end

Thanks and Regards,

Varun

Edited by: Varun Kumar Jain on Jul 21, 2008 8:20 AM

abhimanyu_lagishetti7
Active Contributor
0 Kudos

The above mentioned code is for Tab Delimited file

put the data in Excel and save it as tab delimited file, it should work

Abhi

Former Member
0 Kudos

Hello Abhi,

Thanks for your reply.

But how can i maintain excel in tab delimited file ?

I have maintain two column for the same in excel sheet.

Regards,

Varun

abhimanyu_lagishetti7
Active Contributor
0 Kudos

you enter the data in XL but you save as tab delimited text file or CSV file both it will work.

It seems you are uploading the XL itself, you can not directly convert it to string it will through an error.

I don't know any such API, which extract data from XL

Abhi

Former Member
0 Kudos

Hi,

Is any body have any more idea ?

Thanks in Adv.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I wouldn't hold out hope for some other solution. This is topic that is discussed frequently in this forum. The Microsoft Binary format for Excel (pre 2007 version) is simply not very accessible to other applications. It is a microsoft-specific format and the specificaiton is not published. It is not based upon any open format that can be processed by ABAP. Therefore most people find that you must resave the document into some other format - Text Tab Delimited, Comma Separated File, or XML. The easiest formats to process are the pure text based ones.

XML is another possible, especially since the native format in office 2007 is now XML. However this is much more difficult to parse than one of the simple text formats.