0% found this document useful (0 votes)
123 views

TEC202 Advanced Development Exercises

Here are the steps to complete this exercise: 1. Add an icon to screen XDM1 in block 1. 2. Create a new action GOBJETC0 that triggers the GESBPR function when the icon is clicked. Specify the BPR object and the ID field value from screen XDM1. 3. Add a button to window OXDM 4. Create a new action XDISDOMCOD of type "window entry". 5. Create a new window XDIS of type "Miscellaneous" and display "Message box". 6. Create a new screen XDIS1 as a dialog box containing a field DOMCOD to display the domain code. 7. In
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

TEC202 Advanced Development Exercises

Here are the steps to complete this exercise: 1. Add an icon to screen XDM1 in block 1. 2. Create a new action GOBJETC0 that triggers the GESBPR function when the icon is clicked. Specify the BPR object and the ID field value from screen XDM1. 3. Add a button to window OXDM 4. Create a new action XDISDOMCOD of type "window entry". 5. Create a new window XDIS of type "Miscellaneous" and display "Message box". 6. Create a new screen XDIS1 as a dialog box containing a field DOMCOD to display the domain code. 7. In
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

March 2021

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 1 – X3 ACTION MANAGEMENT..........................................................................6

1. PLUGGING A X3 ACTION ON AN ICON.......................................................6


1.1. Actions (Standard)......................................................................................... 6
1.2. Optional: Actions (Bespoke Window Entry template).....................................6

LAB 2 – WINDOW ENTRY TEMPLATE.......................................................................8

1. CREATING THE GRAPHICAL STRUCTURE................................................8


1.1. Screens.......................................................................................................... 8
1.2. Window.......................................................................................................... 9

2. CODING THE PROCESS..............................................................................9


2.1. X3 Action........................................................................................................ 9
2.2. Action’s parameter......................................................................................... 9

LAB 3 – PROCESSING TEMPLATE..........................................................................10

1. CREATING THE GRAPHICAL STRUCTURE..............................................10


1.1. Screens........................................................................................................ 10
1.2. Window........................................................................................................ 10
1.3. Action........................................................................................................... 10
1.4. Function....................................................................................................... 10

2. INTERACTIVE & BATCH MODE.................................................................11


2.1. Process........................................................................................................ 11
2.2. Batch task.................................................................................................... 11

LAB 4 – INQUIRY TEMPLATE...................................................................................12

1. CREATING THE GRAPHICAL STRUCTURE..............................................12


1.1. Screens........................................................................................................ 12
1.1. Window........................................................................................................ 13
1.2. Inquiry.......................................................................................................... 13
1.3. Action........................................................................................................... 13
1.4. Function....................................................................................................... 13

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 3/19
2. CREATING AN INQUIRY PROCESS..........................................................14

LAB 5 – SELECTIONS FROM TABLE.......................................................................15

LAB 6 – SELECTIONS ON LIST................................................................................16

LAB 7 – ENTRY POINTS........................................................................................... 17

LAB 8 – REPORTS.................................................................................................... 18

1. TRACING PRINT PARAMETERS................................................................18

2. PRINTING REPORT TWICE........................................................................18

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 4/19

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.)

......................................................Hint: This is used to highlight an interesting hint on X3

.....................................................Additional information on the process or data or parameters addressed in


the exercise

......................................................Exercise “quiz” question

Warning

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 5/19

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.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 6/19

LAB 1 – X3 ACTION MANAGEMENT

1. PLUGGING A X3 ACTION ON AN ICON

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.

1.1. Actions (Standard)


Development > Processes > Actions > Actions (GESACT)

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.

1.2. Optional: Actions (Bespoke Window Entry template)


Development > Processes > Actions > Actions (GESACT)

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

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 7/19
d. Then create your new screen XDIS1 as a dialog box. The screen should contain the domain code.

Field Typ Lengt Remarks : 1st block


e h

DOMCO ITM Domain code


D

e. Create a new window


f. Create a STD and SPE process. Use the SPE process in order to display the domain code value
from the XDM0 screen in the new XDIS1 screen.
Tips: Scan the events available to see which one you can use. Use the X3 help as well.
Copy the value from XDM0 to XDIS1 by code.
g. Do the same thing by passing the [XDM0]DOMCOD by parameter in the action XDISDOMCOD.
Tips: Use the action parameters.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 8/19

LAB 2 – WINDOW ENTRY TEMPLATE

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. CREATING THE GRAPHICAL STRUCTURE

1.1. Screens
We will create 2 new screens:

a. Header screen XVIEWP0 [XVP0]


- ITMREF Product

Field Types Length Dimension Normal title


ITMREF ? 1 Product code

b. Detail screen XVIEWP1 [XVP1]


 POHNUM Order number
 POHFCY Site
 BPSNUM Supplier
 EXTRCPDAT Expected receipt date
 QTYSTU Quantity
 RCPQTYSTU Already received
 INVQTYSTU Already invoiced

Field Types Length Dimension Normal title


POHNUM VCR 1 Purchase Order number
POHFCY FCY 1 Purchase Site
BPSNUM BPS 1 Partner's ID
EXTRCPDAT D 1 Expected receipt date
QTYSTU QTY 1 Quantity (stock Unit)
RCPQTYST QTY 1 Received Qty (Stock Unit)
U
INVQTYSTU QTY 1 Invoiced Qty (Stock Unit)

Tips: Try to figure out which table you need to use to find the fields.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 9/19
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.

1.2. Window
We will now create a new window XVIEWPO containing our previous screens.

a. Add the screens XVIEWP0 and XVIEWP1


b. On the window OXDM, add a button “View PO”. Identify this button with the letter “z”.

2. CODING THE PROCESS

1.3. X3 Action
Development > Processes > Action > Action (GESACT)

Create an X3 action XVIEWPO.

a. Template: Window entry


Main window: XVIEWPO
Standard process: XVIEWPO

b. Assign your action XVIEWPO to your button “z” in OXDM

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.

1.4. Action’s parameter

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”.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 10/19

LAB 3 – PROCESSING TEMPLATE

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. CREATING THE GRAPHICAL STRUCTURE

1.1. Screens
Create a screen to enter launch criteria:
- Tab screen XRTZVER1 [DIA]

Field Type Lengt Dimensio Normal title


s h n
STRDOMCOD ? 1 Product code
ENDDOMCO ITM 1
D
EXPDAT D 1 Expiry date

Tips: Pay attention to your layout.

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.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 11/19

3. INTERACTIVE & BATCH MODE

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.

c. Try your function in interactive mode.

Now that your function is working, we are going to batch it.

1.6. Batch task


Create a batch task XRTZVER

Usage > Batch server > Task management (GESABT)

a. Set it up a processing type.


b. Assign your function XRTZVER
c. Launch your batch task.

Usage > Batch server > Request Submission (EXERQT)

d. Check the result of your process:

Usage > Batch server > Request management (AREQUETE)

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 12/19

LAB 4 – INQUIRY TEMPLATE


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.

1. CREATING THE GRAPHICAL STRUCTURE

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.

Create a new detail screen CNSXPO2 [XPO2]


Field Type Lengt Remarks : 1st block
h
NBLIG ABS
POHNUM VCR Order number
POHFCY FCY Site
BPSNUM BPS Supplier

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 13/19

EXTRCPDA D Expected received


T date
ITMREF ITM Product
UOM UO Purchase Unit
M
STU UO Stock Unit
M
QTYSTU QTY Quantity
RCPQTYST QTY Already received
U
INVQTYSTU QTY Already invoiced

Tips: Use a table block.

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

Development > Processes > Inquiries (GESACN)

a. Assign your previous window FCNSXPO as your main window.


b. Create 2 new processes
 CNSXPOSTD: Standard process
 CNSXPOSPE: Specific process

Those processes will stay blank for now.


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.

1.3. Action
Create a new Inquiry action CONSXPO

Development > Processes > Actions (GESACT)

a. Assign the Inquiry XPO to your action.

1.4. Function
Create the function CONSXPO

Development > Processes > Functions (GESAFC)

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 14/19
a. Put it under the menu XDEV, after the functions GESXDM.
b. Enter the title “PO Lines enquiry”
c. Set it up as a Process type and assign the action CONSXPO.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 15/19

2. CREATING AN INQUIRY PROCESS

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

e. Remove everything linked to X3 actions parameters


Tips: Scan the code for the use of the PARAM variable

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.

g. Look for required criteria: Do you have them prepared in $LOAD_FILTER?

h. Remove the code linked to fields that don’t exist in your screens.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 16/19

LAB 5 – SELECTIONS FROM TABLE

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.

a. Create the action XSELTAB (Selection on table example)

b. Create a process XSELTAB. This process will contain the code for the selection.

c. Code your own selection

Tips: Use the X3 help.


Find the right event to use in your code.
Use NBCOL, TIT, COL, DEFPAG and START.

d. Plug your new selection on the field [M: XDM0] DOMCOD, as a new selection.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 17/19

LAB 6 – SELECTIONS ON LIST

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.

a. Create the action XSELLIS (Selection on list example)

b. Create a process XSELLIS. This process will contain the code for the selection.

c. Code your own selection

Tips: Use the X3 help.


Find the right event to use in your code.
Use TIT, NBTEX, TEX and TEXTE.

d. Plug your new selection on the field [M: XDM0] DOMCOD, as a new selection.

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 18/19

LAB 7 – ENTRY POINTS

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.

Development > Processes > Processes> Entry points (GESAPE)

First you need to identify a way to take control on the function.

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

SAGE 2021 - Internal & Confidential.


TRAINING SAFE X3 DEVELOPMENT -EXERCISES – 19/19

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.

1. TRACING PRINT PARAMETERS

4. PRINTING REPORT TWICE


For this example, we need to use an entry point on the printing processes in order to launch reports one
after another.

Development > Processes > Processes> Entry points

a. Try to find an adequate entry point.

Tips: Search in the help file for an entry point on the process AIMP1.

b. Identify how to launch a report when the first one finishes.

c. Create an entry point on the process AIMP1. This entry point will use the code stored in the process
XREPMAG.

d. In the source file XREPMAG:


 Identify the report that just finishes
 Launch the second report

e. Test your customization by trying to print a sales order in

Sales > Orders > Orders (GESSOH)

SAGE 2021 - Internal & Confidential.

You might also like