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

read csv file from apps

Former Member
0 Likes
672

Hi

i need to read csv file from apps and need to convert the data into inbound idoc.

i got lot of doubts in first part that is reading csv file.

csv file is of below format.

a,b,c,d,e

x

y

d is of purchase order and x and y are item in purchase order. how should i read those. bit confused.

is the above format is readable or should i ask them to change the format in different format..any suggestions in how to maintain the format?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
631

read that into a g_text(100) type c field

then

if g_text cs ','.

split g_text at ',' into w_xyz-a

w_xyz-b....

else.

po = g_text.

endif.

hope this helps

santhosh

Message was edited by: Kaluvala Santhosh

5 REPLIES 5
Read only

Former Member
0 Likes
631

You can try statement 'split':

SPLIT V_STRING AT ',' INTO P1 P2 P3 P4.

or into table

SPLIT V_STRING AT ',' INTO TABLE itab.

Read only

Former Member
0 Likes
632

read that into a g_text(100) type c field

then

if g_text cs ','.

split g_text at ',' into w_xyz-a

w_xyz-b....

else.

po = g_text.

endif.

hope this helps

santhosh

Message was edited by: Kaluvala Santhosh

Read only

0 Likes
631

Hi,

file format is of:

process,order no, purchase order

line item1(po)

line item2(po)

i don't have problem reading the first line.

how to read line item1 and line item2?

or should i ask them to change to any other format?

if so how?

Read only

0 Likes
631

check the code i gave, check if there are commas in the field to differn. btw header n item lines.

santhosh

Read only

Former Member
0 Likes
631

Hi Srini,

Check this link

Reward points if this helps.

manish

Message was edited by: Manish Kumar