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: 

internal table

Former Member
0 Kudos

hi,

i am reading an excel sheet having seven fileds out of which 2 of them are price category and price type each of char 1.

the data in the excel sheet has values Quantiity based price(tcode EA90)for price category and block charge and such values for price type.in table epreih 0 1 2 are assigned to price category and in table eprei such char 1 values are assigned to price type.how can i seperate populate these fields in my internal table.

<REMOVED BY MODERATOR>

anand.

Edited by: Alvaro Tejada Galindo on Feb 20, 2008 11:08 AM

2 REPLIES 2

Former Member
0 Kudos

Hi,

When uploading data from excel sheet, upload into an internal table which has a single field of type STRING.

Now, create an internal table with the required field (one field per column of the excel sheet).

Split the STRING table work area into respective column as follows:

LOOP AT IT_UPLOAD INTO W_UPLOAD.

SPLIT W_UPLOAD-LINE

INTO

w_data-field1

w_data-field2

.

.

.

w_data-field7

AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

APPEND w_data TO it_data.

ENDLOOP.

The CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB is the representation of tab/column separator in excel.

Hope this help.

Cheers,

Aditya

Former Member
0 Kudos

Declare ur ITAB with all flds as CHAR type of length equal to their Data Elt length