This section describes the main functionalities in the VSS Communication Framework. :
Imagine the following user stories:
...
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. For example:
...
Definition
Dynamic Parameter type
...
Reference to predefined objects of the framework
xxxx
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
...
Source business object in the scope of task instance or notification. In this case you can access any attribute supported by the object provider (refer to BAdI for source object provider and check list of objects delivered by the framework).
Usage syntax:
Code Block |
---|
$source|$src|$s-<attribute>[-<subattribute1>[-<subattribute2>…]] |
Communication task instance. Here you can access any attribute available from task instance header detail structure. Additionally, there are some special attributes supported (refer to the description of task special attributes).
Usage syntax:
Code Block |
---|
$task|$tsk|$t-<attribute>[-<subattribute1>[-<subattribute2>…]] |
Current trigger context. You can access value of any context field by parameter name. The result can be single value or a list (in case of parameter with multiple values).
Usage syntax:
Code Block |
---|
$context|$ctx|$c-<field_name> |
All of the above objects (source business object, task instance, context) beside simple attribute access, support also function calls. It includes build-in functions (provided by the standard Communication Framework engine implementation) and customer defined functions, provided by dedicated BAdI implementations. For details on function definition please refer to function calling chapter.
Usage syntax:
Code Block |
---|
$task|$tsk|$t-$<function_name>[(<param1>, <param2>, ...)][-<subattribute1>[-<subattribute2>…]]
$source|$src|$s-$<function_name>[(<param1>, <param2>, ...)][-<subattribute1>[-<subattribute2>…]]
$context|$ctx|$c-$get|$cnt[(<param1>, <param2>, ...)][-<subattribute1>[-<subattribute2>…]] |
Examples:
$src-ms_vbak_com-vbeln
– in case of VSS Order as source object, this gets field ‘vbeln’ of attribute ‘ms_vbak_com’ of VSS Order instance; check attribute nesting chapter below for more details; list of all available attributes can be found in documentation.$tsk-duedate
– gets attribute ‘duedate’ of communication task instance; for list of all available attributes of task instance, please refer to documentation.$tsk-$property('VEHICLE_NO')
– calls built-in function ‘PROPERTY’ of the task instance, passing ‘VEHICLE_NO’ as function parameter$ctx-reference_no
– gets value of parameter ‘REFERENCE_NO’ from current trigger context.$ctx-@attachment
– gets value of parameter ‘@ATTACHMENT’ from current trigger context; if there was more than one context params with the same name, the result of this dynamic parameter will be list of strings, containing all values found.$ctx-$cnt('JOBNR')
– gets number of occurrences of field with name ‘JOBNR’ in the context.
Function call
Communication Framework supports framework-predefined built-in functions and customer-defined functions as well. Function in general is a part of logic, that is executed on demand and should return single result value based on input parameters.
Function can take zero, one or more importing parameters. Each parameter can be any type. Function must return one single returning value. Returning value can be any type. Parameters to functions can be provided in parentheses, comma separated. Parameters are referenced by their order (so parameter name plays no role from function call perspective).
Refer to chapter function calling for more details.
Function can be provided as:
Global function (framework-predefined or customer defined),
Source object function (framework-predefined or customer defined),
Task instance function.
Global predefined functions are provided by Communication Framework. You can check the list of all available functions in documentation. Such functions are called using syntax:
Code Block |
---|
$function|$fnc|$f-<function_name>[(<param1>, <param2>, ...)] |
Global customer-defined function indicates each compatible, publicly available class method. Compatible means, that interface of the method must conform to function requirement. Publicly available means public static method. This way any public static method of global class, with compatible interface, can be used as function in Communication Framework dynamic parameter. It can be SAP-delivered or customer-defined class. Functions of this type are called using following syntax:
Code Block |
---|
$function|$fnc|$f-<class_name>-<method_name>[(<param1>, <param2>, ...)] |
Source object functions are functions offered by source object provider implementation. Customer can define his own function both in predefined source object and in customer-defined objects by implementing corresponding source object provider BAdI. Source object functions are called using following syntax:
Code Block |
---|
$source|$src|$s-$<function_name>[(<param1>, <param2>, ...)] |
Task instance functions are functions offered by Communication Task instance implementation. List of all available functions can be found in documentation. Such functions are called using following syntax:
Code Block |
---|
$task|$tsk|$t-$<function_name>[(<param1>, <param2>, ...)] |
Context functions are functions offered by Communication Task context. List of all available functions can be found in documentation. Such functions are called using following syntax:
Code Block |
---|
$context|$ctx|$c-$<function_name>[(<param1>, <param2>, ...)] |
Examples:
$fnc-username(sy-uname)
– calls built-in global function ‘USERNAME’, providing sy-uname as input parameter.$fnc-zcl_util-read_text('HEADER', 'Z001', $src-detail-vbeln)
– calls static method ‘READ_TEXT’ of global class ‘ZCL_UTIL’, providing 3 parameters.$src-$get_field_job('000001', 'DESCR1')
– calls built-in function ‘GET_FIELD_JOB’ of VSS Order source object provider, passing 2 parameters.$task-$actor_key('RES')
– calls built-in task function ‘ACTOR_KEY’ with one parameter.$ctx-$get($src-zzname)
– calls built-in context function ‘GET’ with parameter read from source object field ZZNAME.
Dynamic date
Communication Framework provides Dynamic Date Processor (DDP), that can be used to dynamically create date value. To use DDP, you must declare specific DDP operator together with parameters (optional). As result, single date value (of internal type DATS) is generated. List of all available DDP operators can be found in documentation.
Dynamic date utilizes function call denotation for definition and parameter passing. It can be defined using following syntax:
Code Block |
---|
$date|$d-<operator>[(<param1>, <param2>)] |
Examples:
$date-month_end(6) – gets end of June of the current year.
$d-week_begin – gets begin of the current week.
Case sensitivity
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.
Error handling
If dynamic parameter refers to non-existing attribute, non-existing context parameter or not existing or invalid function, it simply returns no value. No error is raised in this case and task/notification processing is not aborted. It depends on the usage, whether no value gives reasonable result or not.
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 componenthigh
of predefined, global constanttask_priority
.cl_global_class-header-field
– refers to fieldfield
of structureheader
, which is static attribute of global classcl_global_class
.$source-detail-customer-name1
– getsdetail
attribute of the source business object, then accesses componentcustomer
of thedetail
attribute and finally reads fieldname1
ofcustomer
component; bothdetail
andcustomer
must be structure-type components.
Calculations
Dynamic parameter supports simple calculation: addition/concatenation. 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_' + $src-detail-plant + '_ABC'
assuming$src-detail-plant
contains value ‘0001’, the result is decoded into string 'PFCG_ROLE_A_0001_ABC'.
Function calls
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.
Functions are specified in dynamic parameter using special syntax. It looks similar to simple variable access but supports additionally 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 as they are optional, 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).
As task instance function (via CMF Task BAdI 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.
o In general, type of the return parameter is not restricted, but it should be the type that can be used as dynamic parameter value. It includes any primitive type, structure type or table type.
Usage syntax:
Code Block |
---|
$func|$fnc|$f-<class_name>-<method_name>[(param1, param2, …)][-<subattribute1>[-<subattribute2>…]] |
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 for customers to define functions that work as built-in functions in source object or Task instance. In that case, function call is passed to the source object via source object provider implementation (refer to BAdI for source object provider) or Task instance (refer to BAdI for CMF Task processing). With that approach, 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 corresponding method of the BAdI implementation:
For business source object
o BAdI: /DBE/CF_SRCOB_PROVIDER
o Method: /DBE/IF_CF_ENH_SRCOB_PROVIDER~GET_ATTRIBUTE
For Task instance
o BAdI: /DBE/CF_TASK
o Method: /DBE/IF_CF_ENH_TASK~GET_FIELD
Internal logic of the method is fully responsible for providing correct result for the call, based on input parameters.
Usage syntax:
Code Block |
---|
$source|$src|$s-$<function_name>[(param1, param2, …)][-<subattribute1>[-<subattribute2>…]]
$task|$tsk|$t-$<function_name>[(param1, param2, …)][-<subattribute1>[-<subattribute2>…]] |
Examples:
$src-$partner_name('WE', true)
o Call function partner_name
of current source object providing ‘WE
’ and true
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.
Predefined attributes, functions, DDP operators
Global attributes
TRIGGER
Information about current event/action trigger
Type: /DBE/CF_STR_ITRIGGER_DATA (DDIC structure)
TRUE
Constant value abap_true (‘X’)
Type: ABAP_BOOL
FALSE
Constant value abap_false (‘ ‘)
Type: ABAP_BOOL
UNDEFINED
Constant value abap_undefined (‘-‘)
Type: ABAP_BOOL
INITIAL
Initial value (empty string)
Type: String
DATE
Constants for date
Type: DATS
Components
o MIN (equal to 00-00-0000)
o MAX (equal to 31-12-9999)
TIME
Constants for time
Type: TIMS
Components:
o MIN (equal to 00:00:00)
o MAX (equal to 23:59:59)
NOTIF_PRIORITY
Constants for notification priority
Type: CHAR(1)
Components:
o NOT_SPECIFIED
o LOW
o MEDIUM
o HIGH
o CRITICAL
TASK_PRIORITY
Constants for Task priority
Type: CHAR(1)
Components:
o NOT_SPECIFIED
o LOW
o MEDIUM
o HIGH
o CRITICAL
Examples:
true
– equivalent for ‘X’trigger-event_id
– ID of the Communication Framework event currently processingtrigger-task_action
– ID of the Task Action in case processing was triggered by actionnotif_priority-high
– constant for high notification priority high (‘3
’).
Predefined functions
COUNT
Returns number of lines for table-type variable and 1 on case of any other not empty variable.
Parameters:
o Variable [any]
Result:
o Number
LENGTH
Returns text length for character-like variable and 0 for any other variable.
Parameters:
o Variable [any]
Result:
o Number
USERNAME
Returns long name of the SAP user provided as input parameter
Parameters:
o SAP user ID [character-like]
Result:
o String
CUSTOMER_NAME
Returns customer name for customer number. GDPR conditions are considered.
Parameters:
o Customer number [KUNNR]
Result:
o String
DAYS_SINCE
Calculates number of days that passed from specific date. If provided date is from the future, result is negative.
Parameters:
o Date [DATS]
Result:
o Number
WRITE
Returns output presentation of variable passed as input parameter.
Parameters:
o Variable [any]
Result:
o String
FORMAT
Formats text based on template and up to 9 parameters. Template variable must be defined as: &n, where n is variable number.
Parameters:
o Template [character-like]
o Variable 1 [any, optional]
o Variable 2 [any, optional]
o Variable 3 [any, optional]
o Variable 4 [any, optional]
o Variable 5 [any, optional]
o Variable 6 [any, optional]
o Variable 7 [any, optional]
o Variable 8 [any, optional]
o Variable 9 [any, optional]
Result:
o String
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 fieldERNAM
ofHEADER_DETAIL
attribute$f-days_since($src-header_detail-erdat)
– returns number of days since the source document creation.
Source objects
VSS Order
Object ID
Class: BO
Type: BUS2400
Attributes
HEADER
Access to MS_VBAK_COM attribute of the VSS Order instance
Data type: DDIC structure /DBE/VBAK_COM
HEADER_DB
Access to MS_VBAK_DB attribute of the VSS Order instance
Data type: DDIC structure /DBE/VBAK_COM
DIALOG_CONTROL
Access to MS_DIALOG_CONTROL of the VSS Order instance
Data type: DDIC structure /DBE/OE_DIALOG_CONTROL
Built-in functions
GET_JOB
Access to the Job data
Parameters:
o Job number [character-like | number]
Result type: DDIC structure /DBE/JOB_COM
GET_JOB_FIELD
Access to the single Job field value
Parameters:
o Job number [character-like | number]
o Field name [character-like]
Result type: any
GET_ITEM
Access to the Item data
Parameters:
o Item number [character-like | number]
Result type: DDIC structure /DBE/VBAP_COM
GET_ITEM_FIELD
Access to the single Item field value
Parameters:
o Item number [character-like | number]
o Field name [character-like]
Result type: any
GET_DPR
Access to the DPR document data
Parameters:
o DPR document number [character-like (BELNR_D)]
Result type: DDIC structure /DBE/ORD_DPR_LIST
GET_PARTNER_INFO
Get data for the partner of the given role. If there are more than one partner for the role, only first one is selected.
Parameters:
o Partner function [CHAR 2 (PARVW)]
optional, default: ‘AG’
Result type: DDIC structure /DBE/ORD_PARTNER_S
GET_PARTNER_NAME
Get name of the partner in given role. If there are more than one partner for the role, only first one is selected. Takes GDPR rules into account.
Parameters:
o Partner function [CHAR 2 (PARVW)]
optional, default: ‘AG’
o Use manual address data [boolean]
Optional, default: false
Result type: string
Examples:
$src-ms_vbak_com-vbeln
– for VSS Order as source object: return VSS Order number (fieldVBELN
of attributeMS_VBAK_COM
).$src-$get_field_job($ctx-/dbe/jobnr, 'DESCR1'
) – for VSS Order as source object: return value of fieldDESCR1
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 fieldZMENG
(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.
SRS Order
Object ID
Class: BO
Type: /DBME/WORD
Attributes
Any field from DDIC structure /DBME/WMA_STR_ORDH_DATA.
VSS Vehicle
Object ID
Class: BO
Type: /DBE/VEHI
Attributes
Any field from DDIC structure VLCVEHICLE.
DPF Transaction
Object ID
Class: OT
Type: /DBE/DP_TRANSACTION
Attributes
Any field from DDIC structure /DBE/DP_STR_PYMNT_TR_DETAIL.
Task instance
Attributes
In general, all simple fields of structure /DBE/CF_STR_INS_TASK_BASE are available as Task instance attributes. It means, that any customer-enhancement fields added to that structure will become available as well. Below is the list of most important standard Task instance attributes.
TASK_ID
Task ID
Data type (internal): CHAR 30 (/DBE/CF_TASK_ID)
TASK_KEY
Key properties formatted into one field
Data type (internal): CHAR 70
STATUS
Current status
Data type (internal): CHAR 10 (/DBE/CF_TASK_STATUS)
STATUS_PR
Previous status
Data type (internal): CHAR 10 (/DBE/CF_TASK_STATUS)
STATUS_TS
Time of the status change (timestamp)
Data type (internal): DEC 15 (TZNTSTMPS)
HISTRY_TS
Time of history change (timestamp)
Data type (internal): DEC 15 (TZNTSTMPS)
SRCOB_CL
Source object class
Data type (internal): CHAR 2 (/DBE/CF_SRCOB_CLASS)
SRCOB_TYPE
Source object type
Data type (internal): CHAR 30 (/DBE/CF_SRCOB_TYPE)
SRCOB_KEY
Source object key
Data type (internal): CHAR 70
SRCOB_EXTID
Source object external key
Data type (internal): CHAR 50
PRIORITY
Task priority (priority code)
Data type (internal): CHAR 1 (/DBE/CF_TASK_PRIORITY)
DUEDATE
Due date (date)
Data type (internal): CHAR 8 (DATS)
XREATM_TS
Expected reaction time (timestamp)
Data type (internal): DEC 15 (TZNTSTMPS)
CREATED_AT
Time of the task creation (timestamp)
Data type (internal): DEC 15 (TZNTSTMPS)
CHANGED_AT
Time of the task update (timestamp)
Data type (internal): DEC 15 (TZNTSTMPS)
CLOSED
Task closed indicator (Boolean)
Data type (internal): CHAR 1(XFELD)
CREATED_BY
Username of the task creator
Data type (internal): CHAR 12 (UBNAME)
CHANGED_BY
Username of the task last processor
Data type (internal): CHAR 12 (UBNAME)
PROGRESS
Progress value (percentage number)
Data type (internal): DEC 3.0
ITS_OBJTID
Internal Task Instance UID
Data type (internal): CHAR 32
ITSUID
Internal Task Instance UID (url-formatted)
Data type (internal): CHAR 32
STATUS_CT
Time elapsed from the status change (in seconds)
Data type (internal): DEC 10
HISTRY_CT
Time elapsed from the previous history update (in seconds)
Data type (internal): DEC 10
INITIATED_BY
Initiator of the last task update (encoded recipient ID)
Data type (internal): CHAR 82
XREATM_DATE
Expected reaction time (date part)
Data type (internal): CHAR 8 (DATS)
XREATM_TIME
Expected reaction time (time part)
Data type (internal): CHAR 6 (TIMS)
XREATM_EXC
Expected reaction time has exceeded (Boolean)
Data type (internal): CHAR 1(XFELD)
Special attributes
There are also special attributes predefined by the framework, that are used for access to some Task instance information, that is not available directly as simple attribute. It includes access to texts, attachments and Task properties. Special attributes are indicated by ‘@’ at the beginning of the name.
@TEXT
@T
Return text element information.
Usage syntax:
Code Block |
---|
$task|$tsk|$t-@text|@t[-<text_id>[-<field_name>[-<option>]]] |
Component meaning:
o TEXT_ID – ID of the text; possible values:
‘REMARKS’ for comments (default value),
‘DESCRIPTION’ for task description,
Any customer defined text ID).
o FIELD_NAME – ID of the text attribute that should be returned, possible values:
‘CONTENT’ – text content (default value),
‘SEQNO’ – text sequence number,
‘VERSION’ – text version number,
'CREATED_AT’ – username of the author,
‘CREATED_BY’ – time of the text creation (timestamp),
‘INITIATED_BY’ – text author (external).
o OPTION – control option; possible values:
‘ALL’ – return information of all text entries (result is a list),
‘LAST’ – return information for only last text entry (with last sequence number) (default value),
‘NEW’ – return information only for text added by last task transaction.
Components are optional, default values are used when not provided. Component can be omitted only if there is no subsequent component that needs to be provided.
Return type:
o FIELD_NAME: CONTENT, CREATED_BY, INITIATED_BY
String | String table
o FIELD_NAME: SEQNO, VERSION
Number | Number table
o FIELD_NAME: CREATED_AT
DEC 15 (TZNTSTMPS) | DEC 15 (TZNTSTMPS) table
@ATTACHMENT
@ATTA
@A
Return attachment information.
Usage syntax:
Code Block |
---|
$task|$tsk|$t-@attachment|@atta|@a[-<mimetype>[-<field_name>[-<option>]]] |
Component meaning:
o MIMETYPE – can be used to filter attachments by the type; by default, all types are selected (*/*)
o FIELD_NAME – ID of the attachment information attribute; possible values:
‘ID’ – attachment ID (default value),
‘FILENAME’ – file name of the attachment,
‘FILESIZE’ – size of the attachment,
‘MIMETYPE’ – type of the attachment.
o OPTION – control option; possible values:
‘ALL’ – get information for all attachments (result is a list) (default value),
‘LAST’ – get information about last attachment (of given type)
Components are optional, default values are used when not provided. Component can be omitted only if there is no subsequent component that needs to be provided.
Return type:
o FIELD_NAME: ID, FILENAME, MIMETYPE
String | String table
o FIELD_NAME: FILESIZE
Number | Number table
@PROPERTY
@PROP
@P
Returns value of the property ID. Works in similar way as function $PROPERTY, but property ID must be provided directly here (cannot be variable)
Usage syntax:
Code Block |
---|
$task|$tsk|$t-@property|@prop|@p-<property_id> |
Component meaning:
o PROPERTY_ID – ID of the property
Return type:
o String
Functions
Task instance provides few built-in functions, that operate on Task internal data and provide information not available via simple attributes. Customers are allowed to implement own build-int Task instance functions (refer to BAdI for Task instance processing).
PROPERTY
Returns value of the property passed by the name (ID). Property ID can be provided as dynamic parameter variable (in contrast to special attribute @PROPERTY).
Parameters:
o Property ID [character-like (/DBE/CF_TASK_PROP)]
Result type: string
INITIATOR_NAME
Returns name of the last task update initiatorP
arameters:
o none
Result type: string
STATUS_NAME
Returns name of the Task status
Parameters:
o Status ID [character-like (/DBE/CF_TASK_STATUS)]
Result type: string
Examples:
$task-xreatm_ext
– returns ‘X’ (ABAP ‘true’) when expected reaction time has exceeded$task-$actor_id('RES')-recip_key
– 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
DAY
Parameters:
o Days [number, default: 0]
Result:
o Current date shifted by Days days.
WEEK_BEGIN
Parameters:
o Date [date, default: today]
o Weeks [number, default: 0]
Result:
o Begin of the week calculated from Date shifted by Weeks weeks.
WEEK_END
Parameters:
o Date [date, default: today]
o Weeks [number, default: 0]
Result:
o End of the week calculated from date Date shifted by Weeks weeks.
MONTH_BEGIN
Parameters:
o Date [date, default: today]
o Months [number, default: 0]
Result:
o Begin of the month calculated from date Date shifted by Months months.
MONTH_END
Parameters:
o Date [date, default: today]
o Months [number, default: 0]
Result:
o End of the month calculated from date Date shifted by Months months.
QUARTER_BEGIN
Parameters:
o Date [date, default: today]
o Quarters [number, default: 0]
Result:
o Begin of the quarter calculated from Date shifted by Quarters quarters.
QUARTER_END
Parameters:
o Date [date, default: today]
o Quarters [number, default: 0]
Result:
o End of the quarter calculated from Date shifted by Quarters quarters.
YEAR_BEGIN
Parameters:
o Date [date, default: today]
o Years [number, default: 0]
Result:
o Begin of the year calculated from Date shifted by Years years.
YEAR_END
Parameters:
o Date [date, default: today]
o Years [number, default: 0]
Result:
o End of the year calculated from Date shifted by Years years.
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
...