Sage Erp X3 V7: Development Part 1 Exercises Level 2
Sage Erp X3 V7: Development Part 1 Exercises Level 2
Development Part 1
Exercises level 2
Reference: X3DVP1v7.1p5EXMSA1.0
22 01 2014
© Sage 2015
This document is the exclusive property of Sage and/or all of the Sage Group affiliates and is
protected by the Intellectual property Code, copyright laws and international treaties.
Any partial or total reproduction of this document is strictly prohibited.
Anyone not complying with these provisions shall be guilty of copyright infringement and will
be liable to criminal penalties provided by the law.
1.0 LEGEND 4
The following elements are used in the exercise booklet as “interface” indicators:
Preamble
Requirement
We will use the exercises done during the fundamental training: Domain Name
management. We want to add an icon in the tab XDM1. When pressing this icon, it should
trigger a tunnel through the GESBPR function.
Objective
This exercise will enable us to experience the behavior of the X3 actions.
An icon in the tab XDM1 should enable a tunnel through the GESBPR function.
a. Add an icon to the screen XDM1, in the bloc 1. You can choose whatever icon
you want.
Tips: Use the PowerPoint to see the list of available icons.
Or you can see them in the function GESAMK: Menu View>Icons
b. Plug a X3 an action to this icon. The action should trigger a tunnel through the
BPR object (GESBPR function), inquiring the business partner stored in the
field ID.
Tips: Use the existing action GOBJETC0 to trigger an object. Look how the
standard uses it on the screen SOH4, field NBLIG.
Specify the object and record you want to inquire.
A new button in the window OXDM should enable to display the name of the
domain code in a new window.
d. Then create your new screen XDIS1 as a dialog box. The screen should
contain the domain code.
Field Type Length Remarks : 1st block
DOMCOD ITM Domain code
Requirement:
We want to create window template based program to view Purchase Order lines for an
item. This should be callable from a button in the OXDM window.
The user will enter a product code in the header and when presses the “OK” button, it
should display the purchase order information of this product.
Objectives:
We want to experience the logic behind the template Window entry and to see its
features.
Tips: Try to figure out which table you need to use to find the fields.
Check the X3 help for the purchase data model for tables PORDER and
PORDERQ
VCR is a generic type that allows you to encapsulate strong types like “ITM”.
Check the parameters of this type.
3.1.2 Window
We will now create a new window XVIEWPO containing our previous screens.
b. On the window OXDM, add a button “View PO”. Identify this button with the
letter “z”.
When the action is set up, test you new button “View PO”.
You will see that something strange happen when pressing the OK button. How to prevent
this behaviour?
…
Tips: Check the X3 help and look for the event AVANT_BOUTON. Refer to the
PowerPoint for more explanation on the window entry events.
Be careful of the number of line for your screen. Not enough lines will result in an
error.
Requirement:
We want to create a standard process template based program to reset the version
number of the domain management. This should be called from a function and a batch
task.
The user will enter a range of product code to delete or an expiry date in a criteria screen,
before launching the process.
Objectives:
We want to experience the logic behind the standard process template and to see its
features.
4.1.2 Window
Create the window DRTZVER
- Assign your screen XRTZVER1 to this window
4.1.3 Action
Create your X3 action XRTZVER
a. Select the template “processing”
b. Assign your window DRTZVER as a criteria window.
Tips: Criteria or main window? You can try both to determine which option to use.
4.1.4 Function
Requirement:
Create an inquiry to view Purchase Orders according to the following criteria:
- Start Date and End Date: to filter the orders based on Expected receipt date.
- Suppliers (Start/End)
- Product
- Site
- PO number
Objective:
Experience the behavior and capacity of the template Inquiry.
Tips: When drawing the layout, don’t forget to place “range” fields on the same line.
5.1.2 Window
Create a new Inquiry window FCNSXPO, as a full screen.
Assign your previous screens to this window.
5.1.3 Inquiry
Create a new Inquiry: XPO
Tips: When validating the inquiry, X3 creates automatically the action and the
function linked to it. You just need to validate the menu.
If the action and the function are not created, use the following procedure.
5.1.4 Action
Create a new Inquiry action CONSXPO
Development > Script dictionary > Actions (GESACT)
5.1.5 Function
Create the function CONSXPO
Copy the code from CNSCPPSTD to CNSXPOSTD and adapt it. CPP is the original
standard enquiry for purchase lines. We are going to use it as a template to customize our
own enquiry.
a. Identify the tables that you will need and declare them in your inquiry.
Tips: Take a look at the “table” tab of your inquiry XPO
b. Identify the abbreviation of the header screen so you can replace it by the
abbreviation XPO1
Tips: Remember the codification rules for screens
Use the “replace” function via the shortcut: CTRL+H
c. Identify the abbreviation of detail screen so you can replace it by the
abbreviation XPO2
d. Comment everything linked to Criteria screen for now.
Tips: Criteria screens are named like this
C+XXX, where XXX is the enquiry code
f. Try to identify pieces of code that can be used for your own enquiry and
adapt it
E.G:
Line 229: DEBDAT= [F:POH] ORDDAT
Can become DEBDAT= [F:POQ] EXTRCPDAT
Indeed, we are using the “expected received date” from the lines table
PORDERQ.
h. Remove the code linked to fields that don’t exist in your screens.
Requirement
As an example on how to use the selection templates “Selection from table”, we want to
display a list containing the following fields:
Table:
- XDOMMAG
Fields:
- DOMCOD
- DOMDES
- REGDAT
- STA
This list will allow us to select one record among and to load the value of this record in the
calling field.
Objective
This exercise will show you how to use the “selection on table” template in X3.
For this example, you need to create a X3 action, based on a template Selection on
table.
b. Create a process XSELTAB. This process will contain the code for the
selection.
Requirement
As an example on how to use the selection template “Selection on list”, we want to display
a list containing the following fields:
Table: Table:
- XDOMMAG - XDOMMAGD
Fields: Fields:
- DOMCOD - ID
- DOMDES
- REGDAT
- STA
This list will allow us to select one record among the list and to load the value of this
record in the calling field.
Objective
This exercise will show you how to use the “selection on list” template in X3.
For this example, you need to create a X3 action, based on a template Selection on
list.
b. Create a process XSELLIS. This process will contain the code for the
selection.
Requirement
We want to enhance the control on our domain management function GESXDM. We want
to allow the access to only “ADMIN” user. All other users will be access denied. Among all
the possible ways to do so, we will use an entry point. This entry point will allow you to
take control when the function is launched, just before it is displayed. Then you will be
able to check the user and potentially deny the access to the function.
Objective
This exercise will show you how to manage entry points.
a. Try to find an entry point that allows you to have control just before the function
is launched.
Tips: Search in the help file for an entry point on the process EXEFNC.
b. Identify how to prevent access:
Variable: …
Value: …
c. Create an entry point on the process EXEFNC. This entry point will use the
code stored in the process XUSRMAG.
Tips: Logout and log back in to activate the entry point
d. In the source file XUSRMAG, control the user :
If the user is ADMIN: allow access
If the user is not ADMIN: deny access
Tips: don’t forget to identify the function you are trying to launch.
e. Test your access management by logging in with the user TRAIN.
Tips: Use the GUSER
Requirement
As an example on how to use pre-process. We want 2 features:
- Display the printing parameters in a trace file
- Trigger 2 reports in a row. We want to trigger the report ARCCLIENT2, then the
report ARCTTC2.
ARCCLIENT2 is tax excluded
ARCTTC2 is tax included
Objective
This exercise will show you how to use pre-processes in X3.
e. Scan the string array PARAMETRE to read all parameters and their values
into the trace file
Tips:
Use the NBPAR variable
Use the intructions Instr$, left$ and right$.
For this example, we need to use an entry point on the printing processes in order to
launch reports one after another.
Tips: Search in the help file for an entry point on the process AIMP1.
c. Create an entry point on the process AIMP1. This entry point will use the code
stored in the process XREPMAG.
© Sage 2015
This document is the exclusive property of Sage and/or all of the Sage Group affiliates and is
protected by the Intellectual property Code, copyright laws and international treaties.
Any partial or total reproduction of this document is strictly prohibited.
Anyone not complying with these provisions shall be guilty of copyright infringement and will
be liable to criminal penalties provided by the law.