C_BudgetWorkflowEmail

DDL: C_BUDGETWORKFLOWEMAIL SQL: IFMBDEMAIL Type: view CONSUMPTION Package: PSM_S4CO_ODATA_BDGT_FM_WF

Budget Document for WF ApprovalEmail

C_BudgetWorkflowEmail is a Consumption CDS View that provides data about "Budget Document for WF ApprovalEmail" in SAP S/4HANA. It reads from 1 data source (I_WorkflowTask) and exposes 7 fields with key field WorkflowTaskInternalID. Part of development package PSM_S4CO_ODATA_BDGT_FM_WF.

Data Sources (1)

SourceAliasJoin Type
I_WorkflowTask Workflowtask from

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName IFMBDEMAIL view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #REQUIRED view
EndUserText.label Budget Document for WF ApprovalEmail view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
Metadata.ignorePropagatedAnnotations true view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY WorkflowTaskInternalID I_WorkflowTask WorkflowTaskInternalID
BudgetDocument _BudgetDocument BudgetDocument
PlanningCategory _BudgetDocument PlanningCategory
BudgetDocumentType _BudgetDocument BudgetDocumentType
UserDescription
WorkflowTaskResultReasonText
WorkflowTaskCurrentUser _WorkflowtaskDecision WorkflowTaskCurrentUser
@AbapCatalog.sqlViewName: 'IFMBDEMAIL'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'Budget Document for WF ApprovalEmail'
@VDM.viewType : #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType : { serviceQuality: #C,
                           sizeCategory: #L,
                           dataClass: #TRANSACTIONAL }
@ObjectModel.supportedCapabilities: [ #OUTPUT_EMAIL_DATA_PROVIDER ]
@Metadata.ignorePropagatedAnnotations:true

define view C_BudgetWorkflowEmail
  as select from            I_WorkflowTask           as Workflowtask
    left outer to many join I_WorkflowTaskApplObject as _WorkflowTaskApplObject     on  _WorkflowTaskApplObject.WorkflowTaskInternalID = Workflowtask.WorkflowTaskInternalID
                                                                                    and _WorkflowTaskApplObject.WorkflowObjectRole     = '01'
    left outer to one join  I_BudgetDocument         as _BudgetDocument             on  _BudgetDocument.ControllingArea    = substring( _WorkflowTaskApplObject.TechnicalWrkflwObject, 1, 4 )
                                                                                    and _BudgetDocument.BudgetDocumentYear = substring( _WorkflowTaskApplObject.TechnicalWrkflwObject, 5, 4 )
                                                                                    and _BudgetDocument.BudgetDocument     = substring( _WorkflowTaskApplObject.TechnicalWrkflwObject, 9, 10 )
    left outer to one join  I_WorkflowTaskApplObject as _WorkflowTaskApplObDecision on  _WorkflowTaskApplObDecision.WorkflowTaskInternalID = Workflowtask.WorkflowTaskInternalID
                                                                                    and _WorkflowTaskApplObDecision.WorkflowObjectRole     = '99'
    left outer to one join  I_WorkflowTask           as _WorkflowtaskDecision       on  _WorkflowtaskDecision.WorkflowTaskInternalID = _WorkflowTaskApplObDecision.TechnicalWrkflwObject
                                                                                    and _WorkflowtaskDecision.WorkflowTaskStatus     = 'COMPLETED'
    left outer to one join  I_WorkflowTaskResult     as _WorkflowTaskResult         on _WorkflowTaskResult.WorkflowInternalID   = Workflowtask.WorkflowTaskInternalID
                                                                                    and(
                                                                                      _WorkflowTaskResult.WorkflowTaskResult    = 'APPROVED'
                                                                                      or _WorkflowTaskResult.WorkflowTaskResult = 'REJECTED'
                                                                                    )
    left outer to one join  I_User                   as _User                       on _User.UserID = _WorkflowtaskDecision.WorkflowTaskCurrentUser                                                                                    

{
  key Workflowtask.WorkflowTaskInternalID,

      _BudgetDocument.BudgetDocument                                      as BudgetDocument,
      _BudgetDocument.PlanningCategory                                    as PlanningCategory,
      _BudgetDocument.BudgetDocumentType                                  as BudgetDocumentType,

      //      cast(substring(_WorkflowTaskApplObject.TechnicalWrkflwObject, 8 , 10) as bdgt_docnr preserving type ) as BudgetDocument,


      case Workflowtask.WorkflowTaskResult
        when 'requestApproved'
          then 'Approved'
        when 'requestRejected'
          then 'Rejected'
      else Workflowtask.WorkflowTaskResult end                            as WorkflowTaskResult,

      cast(_User.UserDescription as vdm_userdescription preserving type ) as UserDescription,

      Workflowtask._WorkflowTaskResult._WorkflowTaskResultReason._WorkflowTaskResultReasonText[1:Language=$session.system_language].WorkflowTaskResultReasonText,

      _WorkflowtaskDecision.WorkflowTaskCurrentUser                       as WorkflowTaskCurrentUser
}
where
  Workflowtask.WorkflowTaskType = 'F'