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

Doubt while reading a CSV format file.

Former Member
0 Likes
543

Hi Guys,

i am having adoubt reagrding CSV format file.

see the below code

READ DATASET p_file INTO g_string.

IF sy-subrc NE 0.

EXIT.

ENDIF.

REPLACE 'Zebith FOODSERVICE, INC'

IN g_string

WITH 'Zebith FOODSERVICE INC'.

IF sy-index LT p_first.

CONTINUE.

ENDIF.

CLEAR itab_split.

REFRESH itab_split.

SPLIT g_string AT ',' INTO TABLE itab_split.

My doubts suppose we have data in the g_string like this

'5774' , 'Zebith foodService inc' , 'xxxxx' , '23564' , '984560' , ' 2/15/2007' , '28' , '1,487'

How will the data will be stored in itab_split.Since we are using comma as a seperator suppose within the amount or Quanity field if we have "," comma then how the data will be stored in itab_split ?will it treT THE aMOUNT VALUE '1,487' AS A INDIVIDUAL VALUE IN ITAB_SPLIT AS 1,487 OR A SEPERATED VALUES "1" AND "487"?

Thanks,

Gopi.

3 REPLIES 3
Read only

Former Member
0 Likes
510

Hi Guys,

can anybody tell me how to read CSV format File.?

Thanks ,

Gopi.

Read only

Former Member
0 Likes
510

usually in interface files or in input files we won't put any commas in Amount field.if some comma is there it will seperate that amount and store it in 2 variables.

Read only

0 Likes
510

Hi Subas,

Do u think its like that if so is ther any other alternative to seperate the data in CSV format?

Thanks,

gopi.