During screen generation, AMB generates record definitions describing the data layout and format of a screen. You can redefine the entire generated screen record, selected tables in the screen, or selected fields in the screen by setting a flag to enable redefinition and creating user rules to generate the redefinition code.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.
Rule name suffixes:
AMB provides rule name suffixes that the flags recognize and invoke automatically. These rule name suffixes reside in the AMB CNTL file GENSYMB2. To enable a flag, set it to 1.
&SCRGEN-RDF-REC
|
Use for redefining an entire screen record description. The flag invokes the $screenname-RECORD-RDF rule, which you write.
|
&SCRGEN-RDF-TAB
|
Use for redefining a screen table. The flag invokes the $screenname-TABLE-n-RDF rule, which you write.
|
&SCRGEN-RDF-FLD
|
Use for redefining a screen field. The flag invokes the $screenname-fieldname-RDF rule, which you write.
|
User rules:
Using the USERMACS rule library, you can create a rule to redefine your screen record description. Use the following rule naming conventions:
Redefinition
|
Rule Name
|
Table in a record description
|
$screenname-TABLE-n-RDF
Where
n is the table position in sequence with other tables on the screen, counting from top to bottom on the screen.
|
Field in a record description
|
$screenname-fieldname-RDF
|
Entire record description
|
$screenname-RECORD-RDF
|
General Rules:
- When using the TP-ATTR call in a rule, use the original screen name, not the new (redefined) name.
- When redefining a screen, include the attribute bytes as part of the redefinition.
Examples:
Redefine field PARTNO on screen INVENT. Note that all field names within the screen are prefixed with the screen name.
% DEFINE $INVENT-PARTNO-RDF
&12+05 INVENT-PARTNO-Z99 &36+REDEFINES INVENT-PARTNO
&40+PIC Z99.
Redefine a table definition for a repeat block field named PART-NO-ROW on screen INVENT. The variable &INVENT-TABLE-1-MAX contains the number of occurrences for the repeated row block. The rule $SC-REP-FIELD-HEADER-0 generates the native attribute fields depending on the DC target. The field INVENT-PART-NO-ROW-EDITED contains the picture that is used to edit the data for output display.
% DEFINE $INVENT-TABLE-1-RDF
&12+05 FILLER &46+REDEFINES INVENT-TABLE-1.
&16+10 FILLER &46+OCCURS &INVENT-TABLE-1-MAX.
$SC-REP-FIELD-HEADER-0("PART-NO-ROW")
&20+15 INVENT-PART-NO-ROW-EDITED &46+PIC ZZZ9.
% END