Export ASCII-file of purchase data

I like to export a file in ASCII format (just semicolon) and send it by e-mail. The file has to contain certain fields from the purchase header and certain fields from the purchase lines. I know how to create a report with these fields, but I don’t know how to export the contents to such a file. Or should I use a dataport instead? However, I’m not certain if I can join two tables in a dataport… Can anyone hand me some information? Thanks. Michiel Groeten, Michiel Hageman ICT & quality manager PM Komponenten B.V. The Netherlands

You cannot “nest” data items in a dataport like you can do in a report (at least in 2.60). You would have to use a data item for the header and write the lines to the dataport’s export file “by hand”, in the data item’s triggers. I’d suggest you create a report and write the required data to a file using the C/AL file commands (file.CREATE, file.WRITE etc.). – Heinz Herbeck Waagner-Biro AG, Vienna, Austria

quote:


Originally posted by MFH: I like to export a file in ASCII format (just semicolon) and send it by e-mail. The file has to contain certain fields from the purchase header and certain fields from the purchase lines.


For several reasons I would definitely recommend to use XML files rather than flat ASCII files. I recently had a project with the following scenario: a big supplier (vendor) delivers to small stores (customers). As to save manpower, the vendor recommends to the stores (and financially supports) the purchase of a navision application. The idea is that purchasing/delivery works in four steps: 1) Vendor regularly sends his Item Table as XML file to the customer where it’s being imported. 2) Customers sends a purchase order to vendor as xml file. 3) vendor imports the PO as sales order, corrects where necessary and sends order confirmation back to customer where 4) it is being imported and the original PO (prices etc.) being modified. This concept not only works for vendors/customers using Navision but also for every other customer/vendor who is able to create and import XML files. XML has the following advantages over ASCII: 1) It is easier to enhance the file structure if new fields have to be added. Imagine having 3 vendors and 20 customers all relying on the same file-structure. You would have to update all 23 companies the same moment to reflect the changes. 2) With XML files you can easily create a neat human-readeable output in an internet explorer by writing an appropriate XSL file (=style sheet). So in worst case you can read and understand the file (as human) and create the sales order manually. Disadvantages of XML over ASCII: 1) The filesize is much higher (about 10 times). 2) The initial implementation requires more time and know-how. Your profile states that you are an experienced end-user. You might therefore need the help form your NSC to have XML functionlaity implemented. With best regards from Switzerland Marcus Fabian

quote:


Originally posted by fabian: Your profile states that you are an experienced end-user. You might therefore need the help form your NSC to have XML functionlaity implemented.


Fabian, You are very right here. I’m not a developer, so I have to hand this over to my NSC. However, I think export to XML is only possible form Version 3.1, isn’t it? The purpose of my question was, actually, to find out if there’s a simple way in wich I can create such a file. For me now it’s clear that there isn’t. I therefore will hand this over to my NSC Foqus ICT, wich will also program the way in wich the export is triggered from within the purchase order form. Thanks for your thorough reply! Groeten, Michiel Hageman ICT & quality manager PM Komponenten B.V. The Netherlands

quote:


Originally posted by MFH: I think export to XML is only possible form Version 3.1, isn’t it?


While 3.0 is the first version with a built-in XML functionality (dataports). You can create XML files with any automation enabled version (2.01 and higher.) With best regards from Switzerland Marcus Fabian