Dataport import header and lines problem

ichingiching Member Posts: 2
Hi All,

I am creating a dataport to exchange the invoice data with our customer, I have done the export part, which export the sales header/line data and transform them into the format accepted by the customer, this works perfectly. However when come to the import, it only import the first 2 lines (header + 1 line) and it discard all the rest of the lines in the file. I'm not sure if anyone have experiencing this before?

This is the example of the csv file:
========================
"H","110247","004","00053954","0000270.83","SGD","20110225","1102-1"
"D","110247","05609110","10","052229","EXFU","0","T","B","0000048.50","0000003.40"

"D","110247","05609110","20","052229","EXFU","0","T","B","0000104.70","0000007.33"
"D","110247","05609110","30","052229","EXFU","0","T","B","0000048.50","0000003.40"
"D","110247","05609110","40","052229","EXFU","0","T","L","0000055.00","0000000.00"

The import only can reach the first 2 lines (highlighted), this has been verified via the debugger, it never reach the the 3rd.

My setup of the dataitem like the following:
=================================
DataItem Name
Sales Header <Sales Header>
Sales Line <Sales Line>

Settings are default except I changed the DataItemSeparator from "<<NewLine><NewLine>>" to "<NewLine>".

Looking forward for any help or suggestion :D

Comments

  • ShedmanShedman Member Posts: 194
    If you use <NewLine> as DataItemSeparator, it will see each line in your csv file as a different DataItem:
    Line 1 = DataItem 1
    Line 2 = DataItem 2
    ...
    Line n = DataItem n

    You have to find another way to switch between DataItems. Can you get an extra line between the header and lines in the file? Or you would have to import in a different way.
  • SavatageSavatage Member Posts: 7,142
    also if you can't make the seperation between header & lines it does appear you have "D" & "H" defining each line. So not sure if you even need the the dataitems setup like that.

    import all values into variables
    if "tablecode" = "d" then
    ..map mysales line fields..
    sl.insert;

    rough example :mrgreen:
Sign In or Register to comment.