TTXIYS DT CTSETFIL In the ADMGETFIL Function - Branch Selection

Requirement Characteristics

Product Line:

Microsiga Protheus

Segment:

Services

Module:

Financials

Routine:

Routine

Technical Name

ADMGETFIL

ADMXFUN

Initial Registrations:

Branch Registration, SM0

Entry Point:

CTSETFIL

Related ticket

TTXIYS

Countries:

All

Database:

All

Tables used:

SM0

Operating Systems:

All

Version/Release:

11.80

Entry Point

Description:


  1. aSit - Array contendo as filiais já adicionadas
  2. nI - Contém a quantidade de registros de aSit

Location:

This entry point is used in several routines within the Controllership modules.

Events:

The AdmGetFil function is used by various controllership routines, displaying a window for branch selection

Source Program:

ADMXFUN

Function:

ADMGETFIL

Return:

Name

Type

Description

Required

aSit

Array

Array containing company information

Yes

 

Example:

#Include 'Protheus.ch'

User Function CtSetFil()
Local aArea := SM0->( GetArea() )
Local aAuxArea := GetArea()
Local aRetSM0 := {}

DbSelectArea( "SM0" )
SM0->( DbGoTop() )
DbSeek(cEmpAnt)


While SM0->( !Eof() ) .AND. SM0->M0_CODIGO = cEmpAnt
      aAdd( aRetSM0, {SM0->M0_CODFIL,SM0->M0_FILIAL,LEFT(SM0->M0_CGC,2)+"."+SUBSTR(SM0->M0_CGC,3,3)+"."+SUBSTR(SM0->M0_CGC,6,3)+"/"+SUBSTR(SM0->M0_CGC,9,4)+"-"+SUBSTR(SM0->M0_CGC,13,2)} )
      SM0->(DbSkip())
EndDo

RestArea( aArea )
RestArea( aAuxArea )

Return aRetSM0