Product Line: | Microsiga Protheus | ||||
Segment: | Services | ||||
Module: | Financials | ||||
Routine: |
| ||||
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 |
Description: |
| ||||||||
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: |
|
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