P_CntrlPurContrClassification

DDL: P_CNTRLPURCONTRCLASSIFICATION SQL: PCCTRCLASSFCTN Type: view BASIC

P_CntrlPurContrClassification is a Basic CDS View in SAP S/4HANA. It reads from 2 data sources (I_PurchasingDocumentType, t162) and exposes 2 fields with key field PurchasingDocumentType.

Data Sources (2)

SourceAliasJoin Type
I_PurchasingDocumentType _PurchasingDocumentType from
t162 t162 left_outer

Annotations (5)

NameValueLevelField
AbapCatalog.sqlViewName PCCTRCLASSFCTN view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #BASIC view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocumentType PurchasingDocumentType
PurgDocFieldSelControlKey PurgDocFieldSelControlKey
@AbapCatalog.sqlViewName: 'PCCTRCLASSFCTN'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #BASIC

define view P_CntrlPurContrClassification as select from I_PurchasingDocumentType as _PurchasingDocumentType
left outer join t162 
    on _PurchasingDocumentType.PurgDocFieldSelControlKey = t162.flref
{
  /* keys */
    key  PurchasingDocumentType,
     PurgDocFieldSelControlKey,
    
    cast(case substring(faus1,15,1)     //Amount Type(WK)

        when '+' then '0'
        else case substring(faus1,51,1)     //Quantity Type(MK)

                when '+' then '1'
                else '2' 
             end 
    end as contracttype_d ) as PurchaseContractClassification
 
}

where PurchasingDocumentCategory = 'C'