Options

Import Bank Flat File (CBI Italy)

francescomfrancescom Member Posts: 5
Hi,
first thanks for your support in advance! I already have learned a lot from this forum, you deserve the best.

I have a flat file which I'm trying to understand if I will be able to import with the import/export framework (alredy used from some xml, but not with flat files)

File example:

EC01030BT9FF010616CC03061614064665823
610000001 93003CONTO A PACCHETTCCK0103020602000001452348EUR010516C000000233813,87IT92
620000001001020516020516D000000000760,162626 0260001037400083NROSUPCBIN.D.
630000001001DISPOSIZIONE FILIALE DISPONENTE 1217 ID FLUSSO CBI: 23409779 NUM. TOT. PAGAMENTI: 1 IMPORTO BONIFICI: 759,4
6300000010011 IMPORTO COMMISSIONI: 0,75 ORD.ORIG:
620000001002020516020516D000000010240,752626 0260001014400006NROSUPCBIN.D.
630000001002DISPOSIZIONE FILIALE DISPONENTE 1217 ID FLUSSO CBI: 23399399 NUM. TOT. PAGAMENTI: 1 IMPORTO BONIFICI: 10.24


The first line is the opening line (bank statement)
The second line is something commercial (starting w/ 61*)
The third line is something I need to import (starting w/ 62*)
The lines starting with 63* are extensions of 62* lines

In XML this would be:

EC01030BT9FF010616CC03061614064665823
<61*>
<62*>
<63*>
...
...


How can I define this structure in a flat file import definition schema? Is it something that can be done?

Many thanks
Francesco




Answers

  • Options
    rodryrodry Member Posts: 7
    Hy Francesco, you need a custom elaboration Codeunit to read cbi file. This work needs a Partner support.
    By Marco
  • Options
    ftorneroftornero Member Posts: 522
    You can use an XMLPort for that, here is an example, it only read the file, show a message with every line and at the end show a message with the number of lines readed. If you cann't import a text file let my know and I provide ypu with the FOB.


    OBJECT XMLport 50000 Import CBI file
    {
    OBJECT-PROPERTIES
    {
    Date=19/07/16;
    Time=18:49:55;
    Modified=Yes;
    Version List=190716;
    }
    PROPERTIES
    {
    Direction=Import;
    Encoding=ISO-8859-2;
    PreserveWhiteSpace=Yes;
    TextEncoding=MS-DOS;
    OnInitXMLport=BEGIN
    i := 0;
    END;

    OnPostXMLport=BEGIN
    MESSAGE('Lines read: %1', i);
    END;

    Format=Fixed Text;
    }
    ELEMENTS
    {
    { [{E6C467BC-739F-47D2-91AF-03C48090661D}]; ;Root ;Element ;Text }

    { [{DCCD0916-786F-4E4C-890D-2F592E407636}];1 ;FileCBI ;Element ;Table ;
    VariableName=Lines;
    SourceTable=Table2000000026;
    SourceTableView=SORTING(Field1)
    WHERE(Field1=FILTER(1..));
    AutoSave=No;
    AutoUpdate=No;
    AutoReplace=No }

    { [{1BE277B0-C8A3-4995-8E89-D9959ADF3532}];2 ;Line ;Element ;Text ;
    Import::OnAfterAssignVariable=BEGIN
    i := i + 1;
    MESSAGE(Line);
    END;

    Width=1024 }

    }
    EVENTS
    {
    }
    REQUESTPAGE
    {
    PROPERTIES
    {
    }
    CONTROLS
    {
    }
    }
    CODE
    {
    VAR
    i@1000000000 : Integer;

    BEGIN
    END.
    }
    }


    Regards.
Sign In or Register to comment.