April 28, 2018 Published by

How to write code by using Tableaux in Sage Enterprise Management (Formerly Sage X3)

TABLEAUX – Sage Enterprise Management System (Formally Sage X3)

TABLEAUX is another way of executing data while writing minimum lines of code in Sage Enterprise Management System- SEM (formerly Sage Enterprise Management). TABLEAUX are used only for object managed windows.

HERE I SHOW THE TABLEAUX CREATION, MODIFICATION AND DELETION.

Procedure:

Step 1: Create two different tables, one for header and another one for detail table.

Step 2: Create two screens, one for header and another one for detail screen.

Step 3: Create a new window, for object and coding parts.

Step 4: Modification and deletion of the records in the function.

Creating TablesHere, we created the two tables

Header Table:

Table index:

Details Table:

Table Index:

After creation of header, tabular screens and window, following components should be created.

Object:

As shown in the pic below: 

Coding part:

##################################################################$ACTION

    Case ACTION

        When “OUVRE”           :  Gosub $OUVRE

        When “LIENS”             :  Gosub $LIENS

        When “CREATION”    :  Gosub $CREATION

        When “MODIF”            :   Gosub $MODIF

        When “DEFLIG”          :   Gosub $DEFLIG

        When “FILTRE”           :  Gosub $FILTRE

        When “INICRE”            :  Gosub $INICRE

        When “INICRE_LIG”   :  Gosub $INICRE_LIG

        When “ANNULE”          :  Gosub $ANNULE

        When “VERIF_CRE”    :  Gosub $VERIF_CRE

        When Default

    Endcase

Return

##################################################################

### The tables declared in Object management are open to make the declarations of the resources required and for the initializations############

$OUVRE

   If !clalev([F:YXD]) : Local File YVXNUMD[F:YXD] : Endif  ##Details table

   If !clalev([F:YVH]) : Local File YVKNUMH[F:YVH] : Endif##Header table

    Gosub DECLARE From TABLEAUX ##Declare tables to TABLEAUX

Return

#################################################################

##### It is used in creating transaction, just before writing the instruction########

$INICRE 

    [F:YXD]YXNUM=[M:YVX0]YXNUM                                     

Return

###############################################################

###Increment of line number#########################

$INICRE_LIG     

    [F:YXD]YXNUM=[M:YVX0]YXNUM

Return

################################################################## ##The line that defines the filter that is used to only read the detail lines attached to the current header ########

$DEFLIG                                                                  

    Default Mask [YVX1]                                                ####Details Screen

    Default File [YXD]                                                     ####Details Table abbre

    CRIT = ‘YXNUM=”‘+[M:YVX0]YXNUM+’”‘      ####Parameters

    FICLIG = “YVXNUMD”                                         ####Details Table

    ABLIG = “YXD”                                                       ####Details Table abbre

    ZONLIG = “YXNUMLIN”                                      ####Line no

Return

##################################################################

####### This is used to filter the elements in the principal and last read lists #########

$FILTRE

    Default File[YXD]

Return

####################################################################This is used while reading a record or reading each record and loading of the data

$LIENS

    Gosub LIENS From TABLEAUX

Return

######################################################################Creating and saving the data#####

$CREATION

    Gosub CREATION From TABLEAUX

Return

####################################################################################### Modifying the data after creation#########

$MODIF

    Gosub MODIF From TABLEAUX

Return

#################################################################################Deleting the single record or multiple records#####

$ANNULE

    Gosub ANNULE From TABLEAUX

Return

##################################################################### It is written for the sequence number generation in the header field####

$VERIF_CRE

Local Char ZNUMBER

Local Integer STAT

     Call NUMERO(“YIX”,””,date$,””,ZNUMBER,STAT) From SUBANM

[M:YVX0]YXNUM=ZNUMBER

Affzo[M:YVX0]

Return

###########################################################################

Function: 

TAGS:

Your email address will not be published. Required fields are marked *