Tabela B40

Usuario Portal x Empresa
12camposNome físicoB40010(empresa 01)

Campos da tabela B40

12 campos no dicionário de dados do TOTVS Protheus.

12
CampoDescrição
B40_FILIAL
Caractere (C)(2)
Filial
Contexto:
Real
B40_CODUSR
Caractere (C)(6)
Cod Usuario
Máscara:
@!
Contexto:
Real
B40_CODINT
Caractere (C)(4)
Operadora
Máscara:
@!
Contexto:
Real
Consulta F3:
B89PLS
Validação:
Vazio() .Or. PlsZero() .And. PLSVLDINT(M->B40_CODINT) .And. PLSCV("3")
B40_CODEMP
Caractere (C)(4)
Grupo/Empr.
Máscara:
@!
Contexto:
Real
Consulta F3:
BXZPLS
Validação:
Vazio() .Or. PlsZero() .And. ExistCpo("BG9",PLSINTPAD() + M->B40_CODEMP+'2') .And. PLSCV("1")
B40_DESEMP
Caractere (C)(80)
Desc. Grupo
Máscara:
@!
Contexto:
Virtual (não existe no banco)
B40_NUMCON
Caractere (C)(12)
Num.Contrato
Máscara:
@!
Contexto:
Real
Consulta F3:
BA4PLS
Validação:
Vazio().Or.PlsZero().And.ExistCpo("BT5",PLSINTPAD()+M->(B40_CODEMP+B40_NUMCON),1) .And. PLSCV("2")
B40_VERCON
Caractere (C)(3)
Ver.Contrato
Máscara:
@!
Contexto:
Real
B40_DESCON
Caractere (C)(70)
Desc. Contra
Máscara:
@!
Contexto:
Virtual (não existe no banco)
B40_SUBCON
Caractere (C)(9)
Sub-Contrato
Máscara:
@!
Contexto:
Real
Consulta F3:
BA6PLS
Validação:
Vazio().Or.PlsZero().And.ExistCpo("BQC",PLSINTPAD()+M->(B40_CODEMP+B40_NUMCON+B40_VERCON+B40_SUBCON),1)
B40_VERSUB
Caractere (C)(3)
Ver.SubContr
Máscara:
@!
Contexto:
Real
B40_DESSUB
Caractere (C)(70)
Desc. Sub-Co
Máscara:
@!
Contexto:
Virtual (não existe no banco)
B40_CODIGO
Caractere (C)(4)
Codigo
Máscara:
@!
Contexto:
Real

SELECT de exemplo da tabela B40

No Protheus a tabela física leva o código da empresa (01 → 010) e registros excluídos ficam com D_E_L_E_T_ = '*'.

SQL · SQL Server
SELECT TOP 100
  B40.B40_FILIAL,
  B40.B40_CODUSR,
  B40.B40_CODINT,
  B40.B40_CODEMP,
  B40.B40_NUMCON,
  B40.B40_VERCON,
  B40.B40_SUBCON,
  B40.B40_VERSUB
FROM B40010 B40
WHERE B40.D_E_L_E_T_ = ' '

Tabelas próximas no índice do Protheus

O ERPSeeker é um projeto independente, sem vínculo com a TOTVS. A estrutura pode variar conforme a versão e as customizações do seu ambiente.