@AbapCatalog.sqlViewName: 'PIQCDSMODBKNDATA'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Module Data'
@ClientDependent: true
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #X
define view PiqCds_Moduledata with parameters p_idate:abap.dats,p_lang:abap.lang //will define validity
as select distinct from hrp1000 as O
left outer join hrp1741 as OT on O.objid = OT.objid and O.otype = OT.otype and O.plvar = OT.plvar
and OT.begda <= $parameters.p_idate and OT.endda >= $parameters.p_idate
left outer join hrp1024 as OP on O.objid = OP.objid and O.otype = OP.otype and O.plvar = OP.plvar
and OP.begda <= $parameters.p_idate and OP.endda >= $parameters.p_idate
left outer join hrp1746 as OS on O.objid = OS.objid and O.otype = OS.otype and O.plvar = OS.plvar
and OS.begda <= $parameters.p_idate and OS.endda >= $parameters.p_idate
left outer join hrp1751 as OQ on O.objid = OQ.objid and O.otype = OQ.otype and O.plvar = OQ.plvar
and OQ.begda <= $parameters.p_idate and OQ.endda >= $parameters.p_idate
left outer join dd07t as text on text.domname = 'PIQWAITL_LEVEL' and text.ddlanguage = $parameters.p_lang and text.domvalue_l = OS.waitl_level
association [0..*] to PiqCdsRepetitionType as _RepetitionType on _RepetitionType.MODREPEATTYPE = OS.modrepeattype
association [0..*] to PiqCdsModuleCategory as _ModuleCategory on _ModuleCategory.CATEGORY = OS.category
association [0..*] to PiqCdsAcademicLevl as _AcademicLevel on _AcademicLevel.SEVERITY = OS.severity
association [0..*] to PiqCdsSessionPattern as _SessionPattern on _SessionPattern.offerpattern = OQ.offerpattern
{
O.mandt as mandt,
O.objid as StudyModule,
O.mc_short as StudyModuleShortName,
O.stext as StudyModuleName,
OT.cpmin as StudyModuleMinCredits,
OT.cpmax as StudyModuleMaxCredits,
OT.cpopt as StudyModuleOptimumCredits,
OP.kapz1 as StudyModuleMinCapacity,
OP.kapz2 as StudyModuleOptimumCapacity,
OP.kapz3 as StudyModuleMaxCapacity,
OQ.offerpattern as StudyModuleSessionPattern,
OS.severity as StudyModuleAcademicLevel,
OS.category as StudyModuleCategory,
OS.modrepeattype as StudyModuleRepetitionType,
OS.waitl_level as StudyModuleWaitingListLevel,
text.ddtext as StudyModuleWaitListLevelName,
OS.waitl_number as StudyModuleWaitlistInPercent,
OS.waitl_disabled as StudyModuleWaitListIsDisabled,
OS.mult_sec_enabled as StudyModuleMltplSctnIsEnabled,
O.begda as ModuleBeginDate,
O.endda as ModuleEndDate,
_RepetitionType._RepetitionTypeText[1: Language = $parameters.p_lang ].StudyModuleRepetitionTypeName,
_ModuleCategory._ModuleCategoryText[1:Language = $parameters.p_lang ].StudyModuleCategoryName,
_AcademicLevel._AcademicLevelText[1:Language = $parameters.p_lang ].StudyModuleAcademicLevelName,
_SessionPattern._SessionPatternText[1:Language = $parameters.p_lang ].StudentSessionPatternText
}
where O.otype = 'SM' and O.begda <= $parameters.p_idate and O.endda >= $parameters.p_idate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"PIQCDSACADEMICLEVELTXT",
"PIQCDSACADEMICLEVL",
"PIQCDSMODULECATEGORY",
"PIQCDSMODULECATEGORYTEXT",
"PIQCDSREPETITIONTYPE",
"PIQCDSREPETITIONTYPETEXT",
"PIQCDSSESSIONPATTERN",
"PIQCDSSESSIONPATTERNTEXT",
"DD07T",
"HRP1000",
"HRP1024",
"HRP1741",
"HRP1746",
"HRP1751"
],
"ASSOCIATED":
[
"PIQCDSACADEMICLEVL",
"PIQCDSMODULECATEGORY",
"PIQCDSREPETITIONTYPE",
"PIQCDSSESSIONPATTERN"
],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0
}
}*/