Páginas filhas
  • FISA061 - FCI Magnetic File (AUTOMATIC ROUTINE)

CONTENTS

01. OVERVIEW

Product Line:

Microsiga Protheus®

Industry:

Services

Module:

SIGAFIS - Tax Records

Function:

FISA061- Import of FCI Magnetic File

Scope:

Microsiga Protheus 12

Versions:

Microsiga Protheus 12

Operating Systems:

All

Compatible with the following Databases:

All

Access Level:

Level 1 (Customer Access)

Languages:

All

02. DESCRIPTION

This routine is intended to perform the processing, generation, and import of the FCI magnetic file using the automatic routine mechanism.

03. TECHNICAL INFORMATION

Automatic Routine:

Automatic Routine Call
FISA061( [aWizAuto], [aFilAuto], cDir, cArq, nTipo ) --> Nil

Return:

Return:
Nil

Tips

The aWizAuto Array with the contents of the wizard MUST be entered as in the example shown below when "Example: Using FISA061 as an automatic routine".

The xMagLeWiz feature (automatically loads the Wizard data and displays the wizard on screen) should NOT be used, as this function only works in the GRAPHIC MODE.

The second parameter containing the processing branches is optional. In the example below, it was shown using the MatFilCalc feature (load branches of the current company). If used as shown in the example, it should be invoked by setting the first parameter to .F. E.g.: MatFilCalc(.F.).

For correct operation, the positions 1 and 2 of the aWizAuto array referring to the 'from date' and 'to date' must be entered in the format (YYYYMMDD) - YearMonthDay.

Important

When set to type 2-"Import" or 3-"Generate file", the variable cDir (directory of the file to be imported) should not be the same directory as stated in STARTPATH (e.g.: "\system\"). It must be in STARTPATH, where a copy of the original file is made so that routine FISA061 has exclusive access to data and file processing.

ExecAuto - MATA089

Name

Type

Description

Default

Mandatory

Reference


[xAutoCab]

Array of Record

Content of the fields filled in the Wizard.


X



[aFilAuto]

Array of Record

Branches that will be processed.





cDir

Character

Target folder path.





cArq

Character

File name.





nTipo

Numeric

It can be one of the following options: 1-Process; 2-Import; 3-Generate file.


X


04. EXAMPLE


Example using FISA061 as an automatic routine
#Include "PROTHEUS.CH"
 
User Function FCI()
 
    Local lMostraTela := .F.
    Local aWizAuto    := {}           // Array with the content fields filled in the wizard
    Local aFilAuto    := {}           // Array with the branches that will be processed
 
    Local cDir        := "\FCI\"      // Directory cannot be the same as StartPath entered
    Local cArq        := "FCI.TXT"
    Local nTipo       := 3            // 1-Process; 2-Import; 3-Generate file
 
    Private lMsErroAuto    := .F.
    Private lMsHelpAuto    := .T.
    Private lAutoErrNoFile := .F.
 
    IF  SELECT("SX2") == 0
     
        cCodEmp := aParams[1]
        cCodFil := aParams[2]
     
            PREPARE ENVIRONMENT EMPRESA cCodEmp FILIAL cCodFil

    ENDIF
 
        aFilAuto := MatFilCalc(.F.)
     
    Aadd(aWizAuto,{ "20180201", ; // From date 
                    "20180228", ; // To date 
                    "FCI_P001", ; // From product 
                    "FCI_P003", ; // To product 
                    "2"       , ; // Select branches? 1-Yes|2-No
                    "100"     , ; // Version 
                    "2"       , ; // Consider blocked products? 1-Yes|2-No
                    "1"})         // Use previous FCI code for same range? 1-Yes|2-No
    
    MSExecAuto({|x,y,z,m,n|FISA061(x,y,z,m,n)}, aWizAuto, aFilAuto, cDir, cArq, nTipo)
    
    If lMsErroAuto
        MostraErro()
    EndIf
 
        RESET ENVIRONMENT
 
Return Nil



  • Sem rótulos