Hi there.
I have a dataport that should import a fixed file but with a pretty strange build.
The file looks like this:
*******************************************
3005294210035902 0620200707100205564164357
3205294210035902 000000000000020+00
3205294210035902 000000000027200+25
3205294210035902 000000000002000+25
3105294210035902 111553 000000000000445-
3105294210035902 113310 000000000032000-
3105294210035902 113410 000000000000960-
********************************************
The first line (300) is the salesheader and the other two (320 and 310) are the saleslines. Now I can't figure out how to get the data in the tables because every line is different from each other. My idea is to define 3 dataitems (Sales Header, Sales Line and Sales Line(2)) and define the dataportfields for each dataitem.
(The dataport should loop on the 300-line...)
But I cant get it to work...:(
Does anyone have any ideas?? plez help
0
Comments
Read a file line per line.
then decide wether it is a sales header or sales line.
then do you magic with COPYSTR, STRLEN, STRPOS, etc.
Just a suggestion...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
1 limit : NO line in the file may be larger than 1024 bytes!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Then you have:
- a dialog box for selection your file
- a loop through your file
I guess the 1024 chars is no problem, looking at the info he gave us.
=D>
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Only when your data is Navision friendly then you do the import...
ERP Consultant (not just Navision) & Navision challenger
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
One question though...
how do I get the codeunit to read one line? is there a special method?
Among them, I found:
http://www.mibuso.com/forum/viewtopic.php?t=12123
http://www.mibuso.com/forum/viewtopic.php?t=2419
http://www.mibuso.com/forum/viewtopic.php?t=4483
...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog