F330AE5E
User Function F330AE5E()Changes SE5 history during FINA330 receivable compensation reversal.
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)
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)
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 NilProposes 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.
- 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.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.