OBJECT Dataport 50000 Export Purch. to PORTAL { OBJECT-PROPERTIES { Date=25.11.10; Time=16:52:20; Modified=Yes; Version List=Parge-PORTAL; } PROPERTIES { CaptionML=[ENU=Export Purch. to PORTAL; TRK=Satnalma PORTAL DŸar Aktar]; Import=No; FileName=C:\text.txt; FieldStartDelimiter=<None>; FieldEndDelimiter=<None>; FieldSeparator=[;]; OnInitDataport=BEGIN PurchSetup.GET; PurchSetup.TESTFIELD("Purch. Order Outgoing Path"); END; OnPreDataport=BEGIN VendorFilter := "Purchase Line".GETFILTER("Buy-from Vendor No."); CurrDataport.FILENAME := PurchSetup."Purch. Order Outgoing Path" + VendorFilter + '-' + FORMAT(CURRENTDATETIME,0,'<Year4><Month,2><Day,2><Hour,2><Minute,2>') + '.csv'; END; } DATAITEMS { { PROPERTIES { DataItemTable=Table2000000026; DataItemVarName=Up; DataItemTableView=SORTING(Number) WHERE(Number=CONST(1)); } FIELDS { { ; ;'receipt' } } } { PROPERTIES { DataItemTable=Table39; DataItemTableView=WHERE(Document Type=CONST(Order), Type=CONST(Item), Outstanding Quantity=FILTER(>0)); ReqFilterFields=Buy-from Vendor No.; OnPreDataItem=BEGIN CurrFile.OPEN(CurrFile.NAME); CurrFile.SEEK(CurrFile.LEN - 2); END; OnBeforeExportRecord=BEGIN PurchHeader.GET("Document Type","Document No."); Item.INIT; IF Item.GET("No.") THEN; txtDate := FORMAT(PurchHeader."Posting Date",0,'<Day,2>/<Month,2>/<Year4>'); END; } FIELDS { { ; ;"Buy-from Vendor No." } { ; ;"No." } { ; ;Quantity } { ; ;"Unit of Measure" } { ; ;txtDate } { ; ;'' } { ; ;txtDate } { ; ;CURRENTDATETIME } { ; ;"Line No." } { ; ;"Document No." } } } { PROPERTIES { DataItemTable=Table2000000026; DataItemVarName=Down; DataItemTableView=SORTING(Number) WHERE(Number=CONST(1)); OnPreDataItem=BEGIN CurrFile.OPEN(CurrFile.NAME); CurrFile.SEEK(CurrFile.LEN - 2); END; } FIELDS { { ; ;'end_receipt' } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { VAR PurchHeader@1000000000 : Record 38; Item@1000000001 : Record 27; PurchSetup@1000000002 : Record 312; VendorFilter@1000000003 : Code[20]; txtDate@1000000004 : Text[30]; BEGIN END. } }
CurrFile.OPEN(CurrFile.NAME); CurrFile.SEEK(CurrFile.LEN - 2);