...
Example scenario: Trigger a notification to service advisor when a service order is created.
Requirement | Condition | What is required? |
I want to send notification when a service order is created |
|
|
I want to send notification only to service advisor in my sales area |
|
|
I want to send notification only for order type 2000 |
|
|
I want to send an email as the notification and I have specific email template |
|
|
I want to send notification to all service advisors |
|
|
Trigger notification from VSS Time Clocking event
Example scenario: Trigger a notification to service advisor when technician starts working on a job.
Requirement | Condition | What is required? |
I want to send notification when I start working on a job |
|
|
I want to send notification only to service advisor in my sales area |
|
|
I want to send notification only for order type 2000 and 2001 |
|
|
I want to send a FIORI push notification with simple text |
|
|
I want to send notification to a specific SAP user |
|
|
Task Processing
A transaction to define processing steps for task. Steps of processes can be defined to be executed one after another and while processing the steps, task attributes can be updated, task action or event can be executed, and notification can be sent to target recipient.
...
Refer to “VSS 4.0 Communication Framework Cookbook” for explanation on how to use the notification trigger functionality.
Dynamic Parameters
Essentials
Process design in Communication Framework in general involves definition of the trigger, starting conditions and actions to be performed. Actions are executed for the trigger when all starting conditions are met. In the process definition you have to cover particular business requirement, but you abstract from a specific business document, department, or organization. For example: when you define notification, that needs to be sent as a result of an event, in most cases the recipient (or recipients) is not known in advance and can only be determined depending on specific context (document, order or type of the event). In other words, Task (process) definition in Communication Framework acts as a template, that is applied for specific business object (document) when specific trigger occurs.
To address this requirement, most of the parameters that make up process definition in Communication Framework can be specified as dynamic parameters. It means, that their values are not saved as constants, but refer to variables, that are calculated on demand only when the process is triggered in the runtime. Such variables can point to simple globally available static value, to source business object attribute, current context value but can also form quite complex calculations using predefined or customer-defined functions. Of course, constant values are also supported.
Dynamic parameters can be used in notification customizing, notification trigger definition and task transaction definition. To check, whether given field value can be entered as dynamic parameter, please refer to Performance Assistant (F1 help) for the field in SAP-GUI:
Definition
Dynamic parameters can be used in multiple ways. Here is the detailed description of all types of usage.
All references in dynamic parameter are case-insensitive, except of string literals. It means that $ctx‑reference_no works the same as $CTX‑REFERENCE_NO. But $tsk‑$property('VIN') is not the same as $tsk‑$property('Vin') although internal implementation of the corresponding function (like built-in function property for Task instance) can ignore case for input parameters.
Attribute nesting
You can access nested attributes of the variable. Variable must be flat structure - accessing internal table lines is not supported. Sub-attributes must be separated by hyphen '-'. Any level of nesting is supported.
Examples:
task_priority-high – refers to component high of predefined, global constant task_priority.
cl_global_class-header-field – refers to field field of structure header, which is static attribute of global class cl_global_class.
$source-ms_detail-customer-name1 – gets ms_detail attribute of the source business object, then accesses component customer of the ms_detail attribute and finally reads field name1 of customer component; both ms_detail and customer must be structure-type components.
Calculations
Dynamic parameter supports simple calculation: addition. You can define value as combination (summary) of more than one component. Each component must be valid value in terms of dynamic parameter. Components must be separated by '+' sign.
Depending on the resulting type of the components, the calculation can be concatenation (for character-like components) or addition (for numbers, dates, etc).
Examples:
sy-datum + 2 results in date equal to two days after today,
'PFCG_ROLE_A_' + t001w-werks + '_ABC' is translated into string 'PFCG_ROLE_A_0001_ABC' (assuming t001w-werks is globally accessible and equal to '0001').
Function callings
Dynamic parameters support not only access to static variables but allow also function execution. Functions in terms of dynamic parameter can be provided in following ways:
Predefined (built-in) Communication Framework function,
Customer-defined function (including any compatible method of the global class),
Function defined by source object implementation.
Function execution can be defined in dynamic parameter using special syntax. It looks similar to simple variable access, but in contrast to it, functions can support input parameters. Parameters can be provided to function by putting them as comma-separated list in parentheses ‘()’. If function does not require any parameter, or you don’t want to pass any parameter and they are not obligatory, the parentheses can be omitted. Parameter values are passed to the function by their sequence. You can skip parameter only if it is not obligatory and there is no other parameter that must be provided after it. Each parameter must be valid value in terms of dynamic parameter. It means that parameter can be specified as constant, reference to variable or even another function call.
New functions can be implemented in two ways:
As class method,
As source object function (via source-object provider implementation).
Any class method is function-compatible when following conditions are met:
It is accessible in the context of the execution. This is always true for public static method of the global class.
It has zero or more importing parameters.
It has exactly one returning parameter.
Customer can define his own functions by implementing compatible methods in global classes in customer namespace or use any compatible method in already existing class.
Such functions can be called using following syntax:
$func|$fnc|$f-<class_name>-<method_name>[(parameter1, parameter2, …)]
Examples:
$fnc-zcl_utils-get_user_name(sy-uname)
o Calls method get_user_name of class zcl_utils, providing current username as first input parameter.
It is also possible to define functions that refers directly to source object during task/notification processing. In this case, function call is passed to the source object via source object provider implementation (refer to BAdI for source object provider). This way customers can add new functions to standard/already existing source objects or define functions for own source object implementation. During function execution, system passes function name together with parameter values into method /DBE/IF_CF_ENH_SRCOB_PROVIDER~GET_ATTRIBUTE of BAdI /DBE/CF_SRCOB_PROVIDER. Internal logic of this method is fully responsible for providing correct result for the call, based on input parameters.
Functions of this type can be called using following syntax:
$source|$src|$s-$<function_name>[(parameter1, parameter2, …)]
Examples:
$src-$partner_name('WE', true)
o Call function partner_name of current source object providing ‘WE’ as input parameter.
o Technically method GET_ATTRIBUTE of BAdI /DBE/CF_SRCOB_PROVIDER is called in this case with following input:
IS_SOURCE_ID à contains identification of the current source business object,
IV_ATTRIB à is set to value ‘$partner_name’,
IT_PARAMS à contains value ‘WE’ in first line and value ‘X’ (internal representation of ABAP true value) in second line.
The BAdI implementation must then provide valid value as result of the call.
List of delivered attributes, function, DDP operators
Predefined attributes
...
Examples:
true – equivalent for ‘X’
ms_trigger_data-task_action – ID of the Task Action in case processing was triggered by action
notif_priority-high – constant for high notification priority high (‘3’).
Predefined functions
...
Examples:
$fnc-count($task-@attachment) – returns number of task attachments; refer to task instance special attribute @attachment for details
$fnc-username($src-header_detail-ernam) – returns name of the source object creator (assuming source object provides creator username in field ERNAM of HEADER_DETAIL attribute
$f-days_since($src-header_detail-erdat) – returns number of days since the source document creation.
Source objects
...
Examples::
$src-ms_vbak_com-vbeln – for VSS Order as source object: return VSS Order number (field VBELN of attribute MS_VBAK_COM).
$src-$get_field_job($ctx-/dbe/jobnr, 'DESCR1') – for VSS Order as source object: return value of field DESCR1 of Job with number provided by context parameter /DBE/JOBNR.
$src-$get_item($ctx-/dbe/posnr)-zmeng – for VSS Order as source object: return value of the field ZMENG (quantity) for order item number equal to context field /DBE/POSNR.
$src-$get_partner_name('AG', true) – for VSS Order as source object: returns Sold-To-Party name; when manual address has been entered in the order, it takes name from order document, not customer master data.
Task instance
...
Examples:
$task-xreatm_ext – returns ‘X’ (ABAP ‘true’) when expected reaction time has exceeded
$task-$actor_key('RES') – returns recipient key for the ‘Responsible’ actor role
$task-@text – returns content of the last comment
$task-@text-description-created_at – returns time of the task description update
$task-@property-vin – returns value of the ‘VIN’ task property
$task-@attachment-image/* – returns ID of all image attachments (result is a list of attachment ID)
Dynamic Date Processor operators
...
Examples:
$date-year_end – gets end of the current year
$date-year_end(sy-datum, 1) – gets end of the next year
$date-quarter_begin(sy-datum, -1) – gets begin of the previous quarter
$date-quarter_end($date-year_begin, 1) – gets end of the 2nd quarter of the current year
VSS Task Center
VSS Task Center is a FIORI application that is built to track and monitor progress of task of VSS business objects. It is designed according to SAP FIORI design guideline and utilizes SAP FIORI Notification functionality to support the push notification and notification management.
...