EITV_EXP_TEMPL_LATEST_VER

CDS View

Latest Template Version Base View

EITV_EXP_TEMPL_LATEST_VER is a CDS View in S/4HANA. Latest Template Version Base View. It contains 5 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
EITV_EXP_TEMPL view inner UI View for Export Templates

Fields (5)

KeyField CDS FieldsUsed in Views
action action 1
action_status action_status 1
collection_version latest_version 1
latest_ballog_handle latest_ballog_handle 1
status status 1
@AbapCatalog.sqlViewName: 'EIT_V_EXP_VER_L'
@ClientHandling:{ type: #INHERITED, algorithm: #SESSION_VARIABLE }
@EndUserText.label: 'Latest Template Version Base View'
define view EITV_EXP_TEMPL_LATEST_VER
  as

  select from EITV_EXP_TEMPL_LATEST_VER_BASE as Collection_Version_Key

  association [1]    to ato_col_versions          as Collection_Version_Detail     on  Collection_Version_Detail.collection_id = Collection_Version_Key.collection_id
                                                                                   and Collection_Version_Detail.version       = Collection_Version_Key.collection_version
                                                                                   and Collection_Version_Detail.timestamp     = Collection_Version_Key.timestamp
                                                                                                                                                                                                                                                                                                                                      
{
  key Collection_Version_Key.collection_id,
      Collection_Version_Key.collection_version,
      Collection_Version_Key.timestamp,

      case
      //calculate "scheduled" status

        when Collection_Version_Key.action_status = 'P' then
          case Collection_Version_Key.action
            when 'C' then 'X'
            when 'A' then 'Y'
            else Collection_Version_Key.status
          end
        else
      //calculate "running" status

        case when Collection_Version_Key.action_status = 'R' then
          case Collection_Version_Key.action
            when 'C' then 'X'
            when 'A' then 'Y'
            else Collection_Version_Key.status
          end
        else
      //calculate "failed" status

        case when Collection_Version_Key.action_status = 'F' then
          case Collection_Version_Key.action
            when 'C' then 'B'
            when 'A' then 'F'
            else Collection_Version_Key.status
          end
        else        
      //calculate "success" status

        case when Collection_Version_Key.action_status = 'S' then
          case Collection_Version_Key.action
            when 'C' then 'C'
            when 'A' then 'A'
            else Collection_Version_Key.status
          end
         else
          case when Collection_Version_Key.collection_version = 1
            then 'N'
            else 'A'  
        end
        end
        end
        end
      end as  status,
      
      Collection_Version_Key.action,
      //calculate "running" status

      case when Collection_Version_Key.action_status = 'P' 
        then 'R'
        else Collection_Version_Detail.action_status
      end                                       as action_status,      

     // calculate latest assignment or last action higher

      Collection_Version_Detail.last_changed_by as last_changed_by,
      Collection_Version_Detail.last_changed_at as last_changed_at,
      //

      Collection_Version_Detail.ballog_handle as latest_ballog_handle


}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"EITV_EXP_TEMPL_LATEST_VER_BASE",
"ATO_COL_VERSIONS"
],
"ASSOCIATED":
[
"ATO_COL_VERSIONS"
],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/