Dataports - Removing the spaces between fields

Matt.HillMatt.Hill Member Posts: 32
Hi

Just a quick question (I hope).

I've the need to make a dataport export file with no field delimeters, but instead a fixed-format file that is to feature no spaces between the fields.

e.g. for say an item I want to export:

Item No., Description, Vendor No. as:

Item001WatchVend001 (and not Item001 Watch Vend001 like I'm currently getting).

I've tried making one field end as soon as the previous finishes, but it tells me the field cannot overlap, even though I've changed the delimeters to 'None' throughout (incl. Field Seperator).

So my question is: how do I go about doing it? I've seen a dataport before that can handle such a scenario as an import file (but it was with a previous employer and have no means of checking how it was done :roll: ).

Thanks for any input guys!

Comments

  • David_CoxDavid_Cox Member Posts: 509
    I dont know how many fields but you can use a text variable and then load it up:

    OutputTxt := STRSUBSTNO('%1%2%3%4%5',"No.",Description,FORMAT("Unit Price"),FORMAT("Unit Cost"),"Base Unit Of Measure");

    Clear any output variables after export, Hope this helps!
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • Matt.HillMatt.Hill Member Posts: 32
    Should have added its 15 fields I'm outputting. I've considered putting it all in one string - think this is the route I'm going to have to go.
  • krikikriki Member, Moderator Posts: 9,118
    Dataport-properties:
    FileFormat=Fixed
    FieldStartDelimiter=<None>
    FieldEndDelimiter=<None>

    Dataportfields-properties:
    Enabled=Yes
    SourceExpr= the variable you want to write
    StartPos= the column in which the variable must start
    Width=the width of the variable

    But it is possible you have spaces in case you have items like this (the items have different lenghts) but it is necessary to be able to import it otherwise you don't know where a field ends and where the next field begins:
    Item
    ABCDEFGHIJKLMNOPQRST
    ABCDEFGHIHJ
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.