VISITOR TABLE | KEY | Data Element | Domain | Fixed Value | |
---|---|---|---|---|---|
MANDT | X | MANDT | |||
GUID | GUID | X | GUID | ||
Visit ID | VISITID | VISITID | |||
First Name | FNAME | FNAME | |||
Last Name | LNAME | LNAME | |||
Company Name | CMPNY | CMPNY | |||
Telephone Country Code | TELCODE | TELCODE | |||
Telephone | TELNUM | TELNUM | |||
Reason | REASON | REASON | ZXXX_DO_VIS_REASON | Meeting, Interview, Maintance, Other | |
Host Information | VHOST | VHOST | |||
Visit Date | VDATE | VDATE | |||
Check-In Date | INTIME | INTIME | |||
Check-Out Date | OUTTIME | OUTTIME | |||
Status | STATUS | STATUS | ZXXX_DO_VIS_STATUS | Done, Postponed, Canceled, In Progress |
@AbapCatalog.sqlViewName: 'ZXXXCDSVIS01'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Visitor CDS'
define view ZXXX_CDS_VIS_01
as select from zxxx_visitor2
{
key guid as Guid,
visitid as Visitid,
fname as Fname,
lname as Lname,
cmpny as Cmpny,
telcode as Telcode,
telnum as Telnum,
email as Email,
reason as Reason,
vhost as Vhost,
vdate as Vdate,
intime as Intime,
outtime as Outtime,
status as Status
}
@AbapCatalog.sqlViewName: 'ZXXXCDSVIS02'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Visitor CDS View'
@ObjectModel:{
modelCategory: #BUSINESS_OBJECT,
compositionRoot: true,
representativeKey: 'Guid',
semanticKey: ['Visitid'],
transactionalProcessingEnabled: true,
writeActivePersistence: 'ZXXX_VISITOR2',
// enable crud
createEnabled: true,
updateEnabled: true,
deleteEnabled: true
}
@UI.headerInfo: {typeName: 'Visitor', typeNamePlural: 'Visitors', title: {value: 'Visitid'}}
@UI: {
presentationVariant: [{
sortOrder: [{
by: 'Visitid',
direction: #ASC
}],
visualizations: [{
type: #AS_LINEITEM
}]
}]
}
@OData.publish: true
define view ZXXX_CDS_VIS_02
as select from ZXXX_CDS_VIS_01
association [0..1] to ZXXX_CDS_VIS_REASON_DOM as _ReasonValueHelp on $projection.Reason = _ReasonValueHelp.Low
association [0..1] to ZXXX_CDS_VIS_STATUS_DOM as _StatusValueHelp on $projection.Status = _StatusValueHelp.Low
{
@UI.facet: [
// Section General Information
{
label: 'General Information',
position: 10,
type: #COLLECTION,
id: 'GeneralInfo'
},
{
label: 'General',
purpose: #STANDARD,
position: 10,
type: #IDENTIFICATION_REFERENCE,
parentId: 'GeneralInfo'
}
]
@UI.hidden: true
key Guid,
@EndUserText.label: 'Visit ID'
@UI: {
lineItem: [{ position: 10}],
identification: [{position: 10}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
@ObjectModel.readOnly: true
Visitid,
@EndUserText.label: 'First Name'
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZXXX_CDS_VIS_02',
element: 'Fname'
}
} ]
@UI: {
lineItem: [{ position: 20}],
identification: [{position: 20}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Fname,
@EndUserText.label: 'Last Name'
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZXXX_CDS_VIS_02',
element: 'Lname'
}
} ]
@UI: {
lineItem: [{ position: 30}],
identification: [{position: 30}],
fieldGroup: [{qualifier: 'Basic'}]
}
@UI.selectionField: [{ position: 11 }]
@ObjectModel.mandatory: true
Lname,
@EndUserText.label: 'Company'
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZXXX_CDS_VIS_02',
element: 'Cmpny'
}
} ]
@UI: {
lineItem: [{ position: 40}],
identification: [{position: 40}],
fieldGroup: [{qualifier: 'Basic'}]
}
@UI.selectionField: [{ position: 12 }]
@ObjectModel.mandatory: true
Cmpny,
@EndUserText.label: 'Tel.No. Country Code'
@UI.hidden: true
@UI: {
lineItem: [{ position: 50}],
identification: [{position: 50}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Telcode,
@EndUserText.label: 'Tel.No.'
@UI: {
lineItem: [{ position: 60}],
identification: [{position: 60}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Telnum,
@EndUserText.label: 'E-Mail'
@UI: {
lineItem: [{ position: 70}],
identification: [{position: 70}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Email,
@EndUserText.label: 'Reason'
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZXXX_CDS_VIS_REASON_DOM',
element: 'Low'
}
} ]
@ObjectModel.text.element: ['ReasonText']
@UI: {
lineItem: [{ position: 80}],
identification: [{position: 80}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
@UI.textArrangement: #TEXT_ONLY
@UI.selectionField: [{ position: 20 }]
Reason,
_ReasonValueHelp.Text as ReasonText,
@EndUserText.label: 'Host Information'
@UI: {
lineItem: [{ position: 90}],
identification: [{position: 90}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Vhost,
@EndUserText.label: 'Date'
@UI: {
lineItem: [{ position: 100}],
identification: [{position: 100}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Vdate,
@EndUserText.label: 'Check-In Time'
@UI: {
lineItem: [{ position: 110}],
identification: [{position: 110}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Intime,
@EndUserText.label: 'Check-Out Time'
@UI: {
lineItem: [{ position: 120}],
identification: [{position: 120}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
Outtime,
@EndUserText.label: 'Status'
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZXXX_CDS_VIS_STATUS_DOM',
element: 'Low'
}
} ]
@ObjectModel.text.element: ['StatusText']
@UI: {
lineItem: [{ position: 81}],
identification: [{position: 81}],
fieldGroup: [{qualifier: 'Basic'}]
}
@ObjectModel.mandatory: true
@UI.textArrangement: #TEXT_ONLY
@UI.selectionField: [{ position: 30 }]
Status,
}
@AbapCatalog.sqlViewName: 'ZXXXCDSDOMVAL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Domain Value Fetch'
define view ZXXX_CDS_DOMVAL
as select from dd07l as FixedValue
left outer join dd07t as ValueText on FixedValue.domname = ValueText.domname
and FixedValue.domvalue_l = ValueText.domvalue_l
and FixedValue.as4local = ValueText.as4local
{
@UI.hidden
key FixedValue.domname as DomainName,
@UI.hidden
key FixedValue.as4local as Status,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
key FixedValue.domvalue_l as Low,
@Semantics.text: true -- identifies the text field
ValueText.ddtext as Text
}
where
FixedValue.as4local = 'A' --Active
and ValueText.ddlanguage = $session.system_language
@AbapCatalog.sqlViewName: 'ZXXXVISRSNDOM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Reason Domain Values'
@Search.searchable: true
@ObjectModel.resultSet.sizeCategory: #XS
define view ZXXX_CDS_VIS_REASON_DOM
as select from ZXXX_CDS_DOMVAL as DomValues
{
@UI.hidden
key DomValues.DomainName,
@EndUserText.label: 'Status' -- Custom label text
@UI.textArrangement: #TEXT_ONLY
@ObjectModel.text.element: [ 'Text' ]
key DomValues.Low,
@Semantics.text: true -- identifies the text field
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@UI.hidden: true
DomValues.Text
}
where
DomValues.DomainName = 'ZXXX_DO_VIS_REASON'
Select Application type and template
DATA:
lt_head TYPE ztxxx_cds_vis_02,
lv_nextnum TYPE numc10.
io_read->retrieve(
EXPORTING
iv_node = is_ctx-node_key
it_key = it_key
iv_fill_data = abap_true
IMPORTING
et_data = lt_head
).
LOOP AT lt_head REFERENCE INTO DATA(lr_head).
IF lr_head->status NE 'D'.
lr_head->status = 'D'.
io_modify->update(
EXPORTING
iv_node = is_ctx-node_key
iv_key = lr_head->key
iv_root_key = lr_head->root_key
is_data = lr_head
).
ENDIF.
ENDLOOP.
@UI: {
lineItem: [{ type: #FOR_ACTION, position: 1,
dataAction: 'BOPF:SET_STATUS_DONE',
label: 'Set Status: Done' }],
identification: [{type: #FOR_ACTION,
position: 1,
dataAction: 'BOPF:SET_STATUS_DONE',
label: 'Set Status: Done' }]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |