TEC202 Advanced Development Exercises
TEC202 Advanced Development Exercises
DEVELOPMENT TRAINING
- ADVANCED
TEC202 - SAFE X3 ADVANCED
DEVELOPMENT - EXERCISES
TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 2/19
TABLE OF CONTENTS
TABLE OF CONTENTS............................................................................................... 2
LEGEND....................................................................................................................... 4
PREAMBLE.................................................................................................................. 5
LAB 8 – REPORTS.................................................................................................... 18
LEGEND
The following elements are used in the exercise booklet as “interface” indicators:
Common Data > BPs > BPs.............This shows directions to a function from the general X3 menu (X3 menu
path from standard Admin home page)
T
a .............................................Indicates a tab in a multi-tab X3 function, such as Controls or Financial
in the Common Data > BPs > Customers function.
Field Field Value ..................................indicates a screen field and the value that should be entered (if
necessary)
Check Box........................................Shows a checkbox (or tick box) and its status
B .........................................Indicates an X3 button (located on the bottom part of the screen) such as
Create or Save or a toolbar button (top left icons) such as New.
File > Print > List...............................This shows the path to a top menu option (top menu bar)
Annotation:................................This is used to provide space for the student to write a result (Order code
etc.)
Warning
PREAMBLE
In much of the processes where common data is 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.
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 Option>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.
a. Add a button to the window OXDM.
b. Create an action XDISDOMCOD. This action is a “window entry” template.
c. Create a new window XDIS
Type: Miscellaneous
Display: Message box
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.
1.1. Screens
We will create 2 new screens:
Tips: Try to figure out which table you need to use to find the fields.
1.2. Window
We will now create a new window XVIEWPO containing our previous screens.
1.3. X3 Action
Development > Processes > Action > Action (GESACT)
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.
The field [M: XVP0] ITMREF should be initialized by a parameter of the action XVIEWPO. It should contain the
value stored in [M: XDM0] DOMCOD.
a. Create a new parameter: ITMREF
b. In the window OXDM, refresh your action and populate the parameter value with the field DOMCOD
from the screen XDM0
c. Find an event that allows you to initialize the ITMREF field with the value in your new parameter.
Tips: Use PARAM (1)
Check the X3 help and the PowerPoint for the correct event.
In your X3 action, uncheck “Current field”.
Requirement:
We want to create processing template based program to reset the version number of the domain management.
This should be callable 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 template processing and to see its features.
1.1. Screens
Create a screen to enter launch criteria:
- Tab screen XRTZVER1 [DIA]
1.2. Window
Create the window DRTZVER
Assign your screen XRTZVER1 to this window
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.
c. Assign a process XRTZVER
1.4. Function
Assign your action to a function in order to make it appear in the XDEV menu.
a. Create the XRTZVER function.
b. Assign your XRTZVER action to it.
c. Revalidate your menu to display the new function.
1.5. Process
Create the process XRTZVER.
a. Code the criteria selection part
b. Code the execution part
Tips: Use the X3 help.
Find the right events to use in your code.
Keep in mind that this function must be batch compliant.
Objective:
Experience the behavior and capacity of the template Inquiry.
1.1. Screens
Create a new header screen CNSXPO1 [XPO1]:
Field Typ Lengt Remarks : 1st block
e h
EXPDATST D Date
R
EXPDATEN D
D
BPSNUMST BPS Supplier
R
BPSNUME BPS
ND
ITMREF ITM Product
POHFCY FCY Site
POHNUM VCR PO number
Tips: When drawing the layout, don’t forget to place “range” fields on the same line.
Reference the tables PORDER and PORDERQ.
1.1. Window
Create a new Inquiry window FCNSXPO, as a full screen.
Assign your previous screens to this window.
1.2. Inquiry
Create a new Inquiry: XPO
If the action and the function are not created, use the following procedure.
1.3. Action
Create a new Inquiry action CONSXPO
1.4. 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
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 an X3 action, based on a template Selection on table.
b. Create a process XSELTAB. This process will contain the code for the selection.
d. Plug your new selection on the field [M: XDM0] DOMCOD, as a new 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 an X3 action, based on a template Selection on list.
b. Create a process XSELLIS. This process will contain the code for the selection.
d. Plug your new selection on the field [M: XDM0] DOMCOD, as a new 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 eventually 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.
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
Tips: don’t forget to identify the function you are trying to launch.
LAB 8 – REPORTS
Requirement
As an example on how to use pre-process. We want to 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.
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.