Sage ERP X3 Development - EX - Part 1-1
Sage ERP X3 Development - EX - Part 1-1
Sage ERP X3 Development - EX - Part 1-1
Development - Fundamentals
Exercises
Doc. Ref. :
19-01-2015
Table of content
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 2
Introduction
In much of the processes where common data are created (such as Customers or
Products) the exercise notes mention XXX in the data codes or designations. Replace that
with your own initials. This is to distinguish your data from other delegate’s data in case
the servers are shared.
As beginners, you will be guided on how to access the menu. You will have a step by
step instruction on how to work on your exercises.
The exercises are so easy because the main objective is to let you manipulate the
software. But at the end of each required exercises there are extra questions that you are
invited to do by yourself to test your complete comprehension of the functionalities
presented in this training.
Objective: This exercise will show you the main features as an overview of the X3
development platform.
First create an activity code that will identify your project: XTR
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 3
1.2 Local Menu
Development > Data and parameters > Tables > Local menus - messages
Create the local menu 6200. It will contain the eventual existing web extensions.
Don’t forget to tick the checkbox “Local Menu” and to select it as “changeable”.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 4
1.3 Table
Development > Data and parameters > Tables > Tables
Managed information should be contained in this table and include the following fields:
Table: XDOMMAG, Product information
Abbreviation: XDM
Index: XDM0, Descriptors: DOMCOD, no duplicates
Remark: We are using type MM for the local menu because this one is setup as it could
be modified to manage the choices displayed (screen development – field actions).
We would have used M type otherwise.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 5
1.4 Screens
Development > Script dictionary > Screens > Screens
The information should be viewed via a header screen and two tabs.
DOMCOD is mandatory.
When the product code is entered, the system should check if the product exists in the
ITMMASTER table. If so, the product designation should be initialized with the product
designation from the ITMMASTER table. If not, nothing is done.
The field DOMDES is a free text field. It will contain the full name in order to display the
corresponding web page in the future second tab.
Abbreviation: XDM1
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 6
The 2nd block should be an array containing the extension associated to the domain name.
There should be a tunnel right-click from ID to the Business partner function (GESBPR),
and a selection box to select existing customers.
1.5 Object
Development > Script dictionary > Objects
Create the object that will interface the tables and the screens. This object, also as left list,
will show 2 columns as the DOMCOD and its description DOMDES.
Once your object is validated, it should have created the function GESXDM.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 7
1.6 Window
Development > Script dictionary > Windows
Create the window gathering all the previous items like object, and screens.
1.7 Function
Development > Script dictionary > Functions
Create a menu item SPE_GESXDM to open the function GESXDM, the link type should
be:
Function (Convergence).
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 8
the Code XSDEV and add the menu Item SPE_GESXDM to it by clicking on the “select”
button.
A block
2. Use a local menu to store this error message. Adapt your code.
You will create a local menu number 6000 (Local menu not ticked = message list).
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 9
3. Using the same code, handle this error with the dedicated label DATE_ERROR. You
should display a message using:
Messages available in the local menu 6000 (message list)
Objective: This exercise will show you how to handle Header/Detail tables with a simple
object
1.11 Tables
Development > Data and parameters > Tables > Tables
Create a table XDOMMAGD. This table will be used to manage the details. We will use
the field dimensioned to 10 in the table XDOMMAG.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 10
EMAIL MAI 1 E-mail Address
Once XDOMMAGD is created, clean the table XDOMMAG in order to avoid duplicate
fields. Erase the fields NBLIG.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 11
1.12 Screens
Development > Script dictionary > Screens > Screens
1.13 Object
Development > Script dictionary > Objects
Now that you have a new table, the object needs to be aware of its existence. Indeed, it
will allow it to handle automatically this new table for you (open/close).
In the “Environment” tab, add the new table XDOMMAGD.
1.14 Process
1. Set the required routines (TABLEAUX) in the specific process SPEXDM. Those
routines will allow you to handle automatically the table XDOMMAG with the screen
XDM1.
Tips: Use the DETAIL MANAGEMENT FOR SIMPLE OBJECT document.
DON’T FORGET TO HANDLE THE NEW LABELS IN $ACTION.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 12
b. Adapt your code in order to use a “standard” way of recording.
Requirement
We want to create a program that will use the power of 2. We want 2 variables containing
different powers of 2:
- Variable XSHORTINT : Contains powers of 2 up to 15 (Minus 1)
- Variable XLONGINT : Contains powers of 2 up to 31 (Minus 1)
Objectives: We want to experience the behavior of the different integer type to see the
capabilities and limits of each.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 13
Do you have an error? What is this error?
Requirement:
We want to create a program that will use strings. We want 3 variables containing strings:
Variable XHELLO : Contains the string “Hello”
Variable XWORLD : Contains the string “World”
Variable XHELLOWORLD : Blank
Objectives: We want to experience the behavior of the string type to see capabilities
and limits.
10. Try to concatenate the variables XHELLO and XWORLD into XHELLOWORLD, but
with a space in between “Hello” and “World”.
a. Using one technique :
Write the technique here: …
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 14
i. Display the value with a message box
Requirement:
We want to create a program that will use arrays of strings and integers. We want 3 arrays
containing different types:
- Variable XARRSTR : Array of 5 strings
- Variable XARRINT : Array of 5 integers
- Variable XARRMIX : Array of 5 strings
Objectives: We want to experience the behavior of arrays to see capabilities and limits.
3. Initialize the 2 first variables respectively with strings and integers of your choice.
a) Display values of both arrays with a message box
Tips: Use the instruction infbox
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 15
Use a loop.
XARRMIX(0)= …
XARRMIX(1)= …
XARRMIX(2)= …
XARRMIX(3)= …
XARRMIX(4)= …
Requirement
We want to create a program that will use a trace file. We want different types of
information inside:
Information
Warning
Error
2. In the new source file, open a new trace file entitled “My 1st trace file”
Tips: For error and warning messages, play with the last parameter of the
ECR_TRACE function.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 16
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 17
1.19 Playing with boxes
Requirement:
We want to create a program that will use boxes. We want different types of boxes:
Information box
Error box
Question box
Time out box
Objectives: We want to experience the different boxes to see capabilities and limits.
Requirement
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 18
Your customer, a pharmaceutical company, needs to manage pharmacy-specific
information attached to end- and by-products: Expiry criteria, medical classification,
certification information, status etc.
They have decided to implement this in a separate function, where a product code
manages the attached information. The product code may be linked to an actual
ITMMASTER product or just a code existing in this function but not yet created as an X3
product.
1.21 Table
Managed information should include the following fields:
Table: XPRODINFO Product information, abbreviation XPI
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 19
CERCOD Certification Special data This field should display 2 digits
code type followed by a dash (-) followed
XCC (Certif. by 4 letters then a dash then 2
code) digits (e.g. 34-AJER-66). The
value in the database should
exclude the dash character.
BPSNUM Preferred Supplier (BPS) Automatic link to the supplier
Supplier function
NBLIG ABS Technical Variable, Grid Line
counter
PRODCOMP Components ARRAY of Automatic link to the products
Products (ITM) function
with dimension =
50
PRODPCT Percentage Percentage of
each
component.
Decimal, dim.=
50
Precision of 2
decimals.
REM Remarks (Long Rich text field Rich text field linked to clob
desc.)
AC0
CREDAT Creation date
UPDDAT Mod. date
CREUSR Creation user
UPDUSR Mod. User
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 20
1.22 Screens
The information should be viewed via a header screen and two tabs.
Tab 1: XPI1
Field Remarks
PRODSTA Local menu as a drop down list.
PRODCLA Field linked to a miscellaneous table, should automatically show the
description to the right of the field.
MANDAT Blank if zero date
EXPDAYS Blank if zero
EXPDAT Blank if zero date
CERCOD This field should display 2 digits followed by a dash (-) followed by 4
letters then a dash then 2 digits (e.g. 34-AJER-66). The value in the
database should exclude the dash character.
BPSNUM Display the supplier description automatically to the right of the field.
BPSCTY A3 City, display only
BPSCRY CRY Country, display only
BPSTEL A15 Telephone
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 21
6. BPSNUM should be controlled: If the supplier does not exist, there should be an
error message.
7. There should be a tunnel right-click from BPSNUM to the suppliers function, and a
selection box to select existing suppliers.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 22
Tab 2: XPI2
2 blocks, one table and one list block
Field Remarks
NBLIG # of lines = 50
PRODCOMP Components ARRAY of Automatic link to the products
Products (ITM) function
PRODPCT Percentage Percentage of
each component
REM Remarks (Long Rich text field Clob (10 lines/ 85 characters)
description.) (AC0)
1.23 Menu
Create a menu XDEV, as the last item in the Main menu (GENE)
1.24 Object
Object : XPI (Simple)
Selection columns: PRODCOD, PRODDES
1.25 Window
Window: OXPI (Object window)
Browser: XPI
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 23
1.26 Additional Requirements
1. When the record is created or saved, the system should check that the sum of
component percentages is equal to 100.
2. When a BOM is created/modified in the BOM maintenance (GESBOD), a new
record should be created for that product, or the existing record should be
amended. The components of this product should be the BOM components
(tables BOM/BOMD).
3. When a product code (PRODCOD) is entered in the header in XPI, and if this
product is a BOM, the component information should be read from tables BOM
and BOMD and the components tab should be initialized with the list of
components and their percentages.
4. A menu in the products maintenance should open the XPI record for that
product if it exists. If not, the menu should be disabled.
5. A button in the XPI object should tunnel to the products maintenance for the
related product if it exists. If not, the button should be disabled.
1.27 Enhancements
The exercise should be modified so the components are stored in a detail table
XPRODINFOD, one component per record
We want a report giving the sales figure by product for the last 12 months, with a total by
family of products
Product apr07 may07 jun07 jul07 aug07 sep07 oct07 nov07 dec07 jan08
feb08
RT200 200 100 0 89 98 65 45 56 67 12 17
Etc…
Local integer A 4 bytes
Local char B(10)
Local date D
Local decimal C
Local integer E(10) : Local integer E(1..10)
Local char F(10)(25)
Local shortint G 2 bytes
Local Libelle H : one byte
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 24
Thank you.
Product manual ¦ Erreur ! Utilisez l'onglet Accueil pour appliquer _Cover date au texte que vous souhaitez faire apparaître
ici. 25