SUBTBU processing: Budget transactions
TBUZONSPE: Adding specific fields in budget entry
The entry point TBUZONSPE is used to take into account new fields when generating budget transaction screens.
Context and operating mode
Call context
This entry point is called upon generation of budget transaction screens.
A field can then be added in specific to the BUD template screen.
Transaction
A transaction is in progress on [F:AMK2], [F:AMZ2], [F:AMA2] & [F:AMP2]. But only the AMSKZON [AMZ2] table should be of interest here.
Log file
There is no open log file.
Available variables and masks
Writing in [F:AMZ2] is carried out from the [F:AMZ] template screen.
The MASKREF variable corresponds to the reference mask, here BUD.
The MASKDES variable corresponds to the WMBUD+Transaction code destination mask.
The TABBUDTYP [F:TBU] table is open. The budget category (Period/Account/Dimension) can therefore be identify via [F:TBU]BUCAT.
When adding the new field to the BUD screen, the definition of the Pos position (column no. in the grid) is now taken into account. On the other hand, this new field will necessarily be presented before the calculated fields defined in the budget transaction grid.
The name of the new field desired is identified with NOMZ=Name of the new field and it is written in AMKZON [AMZ2] so that it is present on the generated screen.
The GOK variable is managed when resuming the execution of the processing in SUBTBU.src, with a Rollback on GOK=0 and a Rollback+Roll if GOK<1.
Example:
Example of specific processing linked to the entry point for a NEWZONE field added to the BUD screen that is to be displayed for budgets of 'Account' category:
$ACTION
Case ACTION
When "TBUZONSPE" : Gosub TBUZONSPE
When Default:
Endcase
Return
$TBUZONSPE
If [F:TBU]BUDCAT = 3 : #Account budget category
For NOMZ="NEWZONE"
Read [AMZ]CODE=MASKREF;NOMZ
If !fstat
NUMCOL +=1
[F:AMZ2] = [F:AMZ]
[F:AMZ2]NUMLIG = NUMCOL
[F:AMZ2]CODMSK = MASKDES
Write [AMZ2]
If fstat
GOK=0 : Call FSTA("AMZ2") From GLOCK : Break
Endif
Call COPIE_ACTION(MASKREF,MASKDES,[F:AMZ]CODZON,[F:AMZ2]CODZON,0)
If GOK<1 : break : Endif
Endif
Next
Endif
Return