‎2006 Nov 09 1:26 PM
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?
‎2006 Nov 09 1:30 PM
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
‎2006 Nov 09 1:30 PM
You can try statement 'split':
SPLIT V_STRING AT ',' INTO P1 P2 P3 P4.
or into table
SPLIT V_STRING AT ',' INTO TABLE itab.
‎2006 Nov 09 1:30 PM
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
‎2006 Nov 09 1:41 PM
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?
‎2006 Nov 09 1:52 PM
check the code i gave, check if there are commas in the field to differn. btw header n item lines.
santhosh
‎2006 Nov 09 1:33 PM