Usina BRAdvPL Guide
Sign in
← All topics
ENTRY POINTUnder review

F330AE5E

User Function F330AE5E()

Changes SE5 history during FINA330 receivable compensation reversal.

F330AE5EFINA330
01 · OVERVIEW

Overview

The specific documentation identifies FINA330 and changing SE5->E5_HISTOR during receivable compensation reversal. Both parameters and return are marked not applicable. Its example locks SE5, changes history and unlocks the record. (TOTVS, ref. 1) The P12.2210 listing places the call in FA330DESC. This is not an FINA300 SISPAG return entry point, despite incorrect classification in older indexes. (Ref. 2)

02 · SYNTAX

Syntax

User Function F330AE5E()

Return value

Not applicable according to the official section. The TOTVS example ends with Return NIL; no logical reversal authorization contract is documented. (Ref. 1)

03 · PRACTICAL EXAMPLE

Keep history and append a test marker

#Include "Protheus.ch"

User Function F330AE5E()
    // Editorial adaptation of the TOTVS example (ref. 1); test environment only.
    Local aArea := GetArea()
    Local aSE5Area := {}
    // The caller must position the right record; this guard does not identify it.
    If Select("SE5") > 0
        aSE5Area := SE5->(GetArea())
        If !SE5->(Eof())
            If RecLock("SE5", .F.)
                // Preserves existing text within the field size.
                SE5->E5_HISTOR := Left(AllTrim(SE5->E5_HISTOR) + ;
                    " | Compensation reversal", Len(SE5->E5_HISTOR))
                SE5->(MsUnlock())
            EndIf
        EndIf
        RestArea(aSE5Area)
    EndIf
    RestArea(aArea)
Return Nil
Expected result

Proposes appending a marker within the existing field size. A full field can truncate the marker. This performs a real SE5 write when locking succeeds. Use only after checking record identity in a test environment. Example not compiled or run in Protheus.

BEST PRACTICES
  • Receivable compensation reversal and payable bank return processing are different processes.
  • Alias and EOF checks do not identify the correct movement. Verify caller positioning and the history rule before use.
  • Check RecLock and leave transaction control to the standard routine; do not add a separate commit to the example.
  • The official example replaces the complete history with fixed text. This adaptation retains existing content within field limits; define full-field and repeated-reversal behavior.
  • Editorial test plan: compare standard and customized behavior in the described operations, inspect resulting records and record release and patch.
  • Under review: sources and example checked against documentation; code not compiled or run in Protheus. Exact transaction position and target release behavior remain unconfirmed.

Related content

REFERENCES
  1. TOTVS. F330AE5E - Alteração do histórico da SE5 no estorno da compensação a receber. TDN. Accessed on 2026-10-23.
  2. EURAI. Pontos de Entrada P12.2210 - Parte 2. Universo do Desenvolvedor, 2023. Accessed on 2026-10-23.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha