SELECT
  AFKO.MANDT AS Client_MANDT,
  AFKO.AUFNR AS OrderNumber_AUFNR,
  AFKO.GLTRP AS BasicFinishDate_GLTRP,
  AFKO.GSTRP AS BasicStartDate_GSTRP,
  AFKO.FTRMS AS ScheduledReleaseDate_FTRMS,
  AFKO.GLTRS AS ScheduledFinish_GLTRS,
  AFKO.GSTRS AS ScheduledStart_GSTRS,
  AFKO.GSTRI AS ActualStartDate_GSTRI,
  AFKO.GETRI AS ConfirmedOrderFinishDate_GETRI,
  AFKO.GLTRI AS ActualFinishDate_GLTRI,
  AFKO.FTRMI AS ActualReleaseDate_FTRMI,
  AFKO.FTRMP AS PlannedReleaseDate_FTRMP,
  AFKO.RSNUM AS NumberOfReservationdependentRequirements_RSNUM,
  AFKO.GASMG AS TotalScrapQuantityInTheOrder_GASMG,
  AFKO.GAMNG AS TotalOrderQuantity_GAMNG,
  AFKO.GMEIN AS BaseUnitOfMeasure_GMEIN,
  AFKO.PLNBEZ AS MaterialNumber_PLNBEZ,
  AFKO.PLNTY AS TaskListType_PLNTY,
  AFKO.PLNNR AS KeyForTaskListGroup_PLNNR,
  AFKO.PLNAW AS ApplicationOfTheTaskList_PLNAW,
  AFKO.PLNAL AS GroupCounter_PLNAL,
  AFKO.PVERW AS TaskListUsage_PVERW,
  AFKO.PLAUF AS DateForRoutingExplosion_PLAUF,
  AFKO.PLSVB AS ToLotSize_PLSVB,
  AFKO.PLNME AS TaskListUnitOfMeasure_PLNME,
  AFKO.PLSVN AS FromLotSize_PLSVN,
  AFKO.PDATV AS ValidFromDate_PDATV,
  AFKO.PAENR AS ChangeNumber_PAENR,
  AFKO.PLGRP AS ResponsiblePlannerGroupdepartment_PLGRP,
  AFKO.LODIV AS LotSizeDivisor_LODIV,
  AFKO.STLTY AS BomCategory_STLTY,
  AFKO.STLBEZ AS MaterialNumber_STLBEZ,
  AFKO.STLST AS BomStatus_STLST,
  AFKO.STLNR AS BillOfMaterial_STLNR,
  AFKO.SDATV AS ValidFromDate_SDATV,
  AFKO.SBMNG AS BaseQuantity_SBMNG,
  AFKO.SBMEH AS BaseUnitOfMeasure_SBMEH,
  AFKO.SAENR AS ChangeNumber_SAENR,
  AFKO.STLAL AS AlternativeBom_STLAL,
  AFKO.STLAN AS BomUsage_STLAN,
  AFKO.SLSVN AS FromLotSize_SLSVN,
  AFKO.SLSBS AS ToLotSize_SLSBS,
  AFKO.AUFLD AS DateOfBomExplosionroutingTransfer_AUFLD,
  AFKO.DISPO AS MrpControllerForTheOrder_DISPO,
  AFKO.AUFPL AS RoutingNumberOfOperationsInTheOrder_AUFPL,
  AFKO.FEVOR AS ProductionSupervisor_FEVOR,
  AFKO.FHORI AS SchedulingMarginKeyForFloats_FHORI,
  AFKO.TERKZ AS SchedulingType_TERKZ,
  AFKO.REDKZ AS ReductionIndicatorForScheduling_REDKZ,
  AFKO.APRIO AS OrderPriority_APRIO,
  AFKO.NTZUE AS SuperiorNetworkNumber_NTZUE,
  AFKO.VORUE AS SuperiorActivity_VORUE,
  AFKO.PROFID AS NetworkProfile_PROFID,
  AFKO.VORGZ AS FloatBeforeProductionInDays_VORGZ,
  AFKO.SICHZ AS FloatAfterProductionInDays_SICHZ,
  AFKO.FREIZ AS ReleasePeriodInDays_FREIZ,
  AFKO.UPTER AS Indicator_ChangeToScheduledDates_UPTER,
  AFKO.BEDID AS IdOfTheCapacityRequirementsRecord_BEDID,
  AFKO.PRONR AS ProjectDefinition_PRONR,
  AFKO.ZAEHL AS InternalCounter_ZAEHL,
  AFKO.MZAEHL AS InternalCounter_MZAEHL,
  AFKO.ZKRIZ AS CounterForAdditionalCriteria_ZKRIZ,
  AFKO.PRUEFLOS AS InspectionLotNumber_PRUEFLOS,
  AFKO.KLVARP AS CostingVariantForPlannedCosts_KLVARP,
  AFKO.KLVARI AS CostingVariantForActualCosts_KLVARI,
  AFKO.RGEKZ AS Indicator_BackflushingForOrder_RGEKZ,
  AFKO.PLART AS BasisForScheduling_PLART,
  AFKO.FLG_AOB AS Indicator_Relationships_FLG_AOB,
  AFKO.FLG_ARBEI AS Indicator_DefaultValueWorkIsRelevant_FLG_ARBEI,
  AFKO.GLTPP AS FinishDate__forecast___GLTPP,
  AFKO.GSTPP AS ForecastStartDate_GSTPP,
  AFKO.GLTPS AS ScheduledForecastFinish_GLTPS,
  AFKO.GSTPS AS ScheduledForecastStart_GSTPS,
  AFKO.FTRPS AS ScheduledReleaseDate__forecast___FTRPS,
  AFKO.RDKZP AS ReductionIndicatorForScheduling__forecast___RDKZP,
  AFKO.TRKZP AS SchedulingType__forecast___TRKZP,
  AFKO.RUECK AS CompletionConfirmationNumberForTheOperation_RUECK,
  AFKO.RMZHL AS InternalCounter_RMZHL,
  AFKO.IGMNG AS YieldConfirmedFromOrderConfirmation_IGMNG,
  AFKO.RATID AS IdOfTheCapacityRequirementsRecord_RATID,
  AFKO.GROID AS IdOfTheCapacityRequirementsRecord_GROID,
  AFKO.CUOBJ AS Configuration__internalObjectNumber___CUOBJ,
  AFKO.GLUZS AS ScheduledFinish__time___GLUZS,
  AFKO.GSUZS AS ScheduledStart__time___GSUZS,
  AFKO.REVLV AS RevisionLevel_REVLV,
  AFKO.RSHTY AS ObjectTypesOfTheCimResource_RSHTY,
  AFKO.RSHID AS ObjectIdOfTheResource_RSHID,
  AFKO.RSNTY AS ObjectTypesOfTheCimResource_RSNTY,
  AFKO.RSNID AS ObjectIdOfTheResource_RSNID,
  AFKO.NAUTERM AS Indicator_DoNotScheduleAutomatically_NAUTERM,
  AFKO.NAUCOST AS Indicator_DoNotCostAutomatically_NAUCOST,
  AFKO.STUFE AS Level__inMultiLevelBomExplosions___STUFE,
  AFKO.WEGXX AS Path__forMultiLevelBomExplosions___WEGXX,
  AFKO.VWEGX AS Path__forMultiLevelBomExplosions___VWEGX,
  AFKO.ARSNR AS NumberOfReservationdependentRequirements_ARSNR,
  AFKO.ARSPS AS OrderItemNumber_ARSPS,
  AFKO.MAUFNR AS NumberOfSuperiorOrder_MAUFNR,
  AFKO.LKNOT AS LeftNodeInCollectiveOrder_LKNOT,
  AFKO.RKNOT AS RightNodeOfACollectiveOrder_RKNOT,
  AFKO.PRODNET AS Indicator_OrderIsPartOfCollectiveOrder_PRODNET,
  AFKO.IASMG AS ScrapConfirmedForOrder_IASMG,
  AFKO.ABARB AS Confirmation_DegreeOfProcessing_ABARB,
  AFKO.AUFNT AS NumberOfSuperiorNetwork_AUFNT,
  AFKO.AUFPT AS RoutingNumberOfOperationsInTheOrder_AUFPT,
  AFKO.APLZT AS GeneralCounterForOrder_APLZT,
  AFKO.NO_DISP AS EffectiveForMaterialsPlanning_NO_DISP,
  AFKO.CSPLIT AS ApportionmentStructure_CSPLIT,
  AFKO.AENNR AS ChangeNumber_AENNR,
  AFKO.CY_SEQNR AS SeqNumberOrder_CY_SEQNR,
  AFKO.BREAKS AS Indicator_SchedulingAllowingForBreaks_BREAKS,
  AFKO.VORGZ_TRM AS ScheduledFloatBeforeProductionInDays_VORGZ_TRM,
  AFKO.SICHZ_TRM AS ScheduledFloatAfterProductionInDays_SICHZ_TRM,
  AFKO.TRMDT AS DateOfTheLastScheduling_TRMDT,
  AFKO.GLUZP AS BasicFinish__time___GLUZP,
  AFKO.GSUZP AS BasicStart__time___GSUZP,
  AFKO.GSUZI AS ActualStartTime_GSUZI,
  AFKO.GEUZI AS ConfirmedOrderFinish__time___GEUZI,
  AFKO.GLUPP AS ForecastFinish__time___GLUPP,
  AFKO.GSUPP AS ForecastStart__time___GSUPP,
  AFKO.GLUPS AS ScheduledForecastFinishTime_GLUPS,
  AFKO.GSUPS AS ScheduledStartTime__forecast___GSUPS,
  AFKO.CHSCH AS SearchProcedureForBatchDetermination_CHSCH,
  AFKO.KAPT_VORGZ AS Float__befProduction__RemainingAfterFiniteScheduling_KAPT_VORGZ,
  AFKO.KAPT_SICHZ AS RemainingFloatAfterFiniteScheduling_KAPT_SICHZ,
  AFKO.LEAD_AUFNR AS LeadingOrderInCurrentProcessing_LEAD_AUFNR,
  AFKO.PNETSTARTD AS OutlineStartOfCollectiveOrder__date___PNETSTARTD,
  AFKO.PNETSTARTT AS OutlineStartOfCollectiveOrder__time___PNETSTARTT,
  AFKO.PNETENDD AS OutlineFinishOfCollectiveOrder__date___PNETENDD,
  AFKO.PNETENDT AS OutlineFinishOfCollectiveOrder__time___PNETENDT,
  AFKO.KBED AS Ind_DoNotCreateCapacityRequirements_KBED,
  AFKO.KKALKR AS Indicator_ComponentsWillNotBeCosted_KKALKR,
  AFKO.SFCPF AS ProductionSchedulingProfile_SFCPF,
  AFKO.RMNGA AS TotalConfirmedReworkQuantity_RMNGA,
  AFKO.GSBTR AS OverallCommitmentDate_GSBTR,
  AFKO.VFMNG AS CommittedQuantityForOrderAfterAtpCheckComponents_VFMNG,
  AFKO.NOPCOST AS DoNotCalculatePlannedCostsForOrder_NOPCOST,
  AFKO.NETZKONT AS IndicatorForTheAccountAssignmentOfANetwork__hdract___NETZKONT,
  AFKO.ATRKZ AS RequestId_ATRKZ,
  AFKO.OBJTYPE AS ChangeIndicator_OBJTYPE,
  AFKO.CH_PROC AS ProcessThatHasLeadToTheChangeOfAnObject_CH_PROC,
  AFKO.KAPVERSA AS VersionOfAvailableCapacity_KAPVERSA,
  AFKO.COLORDPROC AS CollectiveOrderWithwithoutAutomaticGoodsMovement_COLORDPROC,
  AFKO.KZERB AS Indicator_ProjectSummarizationViaMasterDataCharact_KZERB,
  AFKO.CONF_KEY AS IdenticalObject_CONF_KEY,
  AFKO.ST_ARBID AS ObjectId_ST_ARBID,
  AFKO.VSNMR_V AS SalesDocumentVersionNumber_VSNMR_V,
  AFKO.TERHW AS SchedulingNoteFromOrderScheduling_TERHW,
  AFKO.SPLSTAT AS StatusOfAnOrderInASplitHierarchy_SPLSTAT,
  AFKO.COSTUPD AS CostsAreUpdated_COSTUPD,
  AFKO.MAX_GAMNG AS MaximumValueOfTotalOrderQuantityAfterDistribution_MAX_GAMNG,
  AFKO.MES_ROUTINGID AS KeyOfARoutingFromAnMeSystem_MES_ROUTINGID,
  AFKO.ADPSP AS PmpsReferenceElement_ADPSP,
  AFKO.RMANR AS SalesAndDistributionDocumentNumber_RMANR,
  AFKO.POSNR_RMA AS ItemNumberOfTheSdDocument_POSNR_RMA,
  AFKO.POSNV_RMA AS ItemNumberOfTheSdDocument_POSNV_RMA,
  AFKO.CFB_MAXLZ AS MaximumStoragePeriod_CFB_MAXLZ,
  AFKO.CFB_LZEIH AS UnitForMaximumStoragePeriod_CFB_LZEIH,
  AFKO.CFB_ADTDAYS AS AdditionalDays_CFB_ADTDAYS,
  AFKO.CFB_DATOFM AS DateOfManufacture_CFB_DATOFM,
  AFKO.CFB_BBDPI AS BestBeforeDate__bbd__ShelfLifeExpirationDate__sled___CFB_BBDPI,
  AFKO.OIHANTYP AS ExciseDutyHandlingType_OIHANTYP,
  AFKO.FSH_MPROD_ORD AS MasterProductionOrderNumber_FSH_MPROD_ORD,
  AFKO.FLG_BUNDLE AS IndicatesBundleInformationMaintained_FLG_BUNDLE,
  AFKO.MILL_RATIO AS FactorForQuantityBasedSettlement_MILL_RATIO,
  AFKO.BMEINS AS BaseUnitOfMeasure_BMEINS,
  AFKO.BMENGE AS BaseQuantity_BMENGE,
  AFKO.MILL_OC_ZUSKZ AS CombinationIndicator_MILL_OC_ZUSKZ,
  --AFPO.MANDT AS Client_MANDT,
  --AFPO.AUFNR AS OrderNumber_AUFNR,
  AFPO.POSNR AS OrderItemNumber_POSNR,
  AFPO.PSOBS AS SpecialProcurementType_PSOBS,
  AFPO.QUNUM AS NumberOfQuotaArrangement_QUNUM,
  AFPO.QUPOS AS QuotaArrangementItem_QUPOS,
  AFPO.PROJN AS WorkBreakdownStructureElement__wbsElement___PROJN,
  AFPO.PLNUM AS PlannedOrderNumber_PLNUM,
  AFPO.STRMP AS StartDateOfPlannedOrder_STRMP,
  AFPO.ETRMP AS OpeningDateOfThePlannedOrder_ETRMP,
  AFPO.KDAUF AS SalesOrderNumber_KDAUF,
  AFPO.KDPOS AS SalesOrderItem_KDPOS,
  AFPO.KDEIN AS DeliveryScheduleForSalesOrder_KDEIN,
  AFPO.BESKZ AS ProcurementType_BESKZ,
  AFPO.PSAMG AS ScrapQuantityInItem_PSAMG,
  AFPO.PSMNG AS OrderItemQuantity_PSMNG,
  AFPO.WEMNG AS QuantityOfGoodsReceivedForTheOrderItem_WEMNG,
  AFPO.IAMNG AS ExpectedSurplusdeficitForGoodsReceipt_IAMNG,
  AFPO.AMEIN AS UnitOfMeasureForInHouseProduction_AMEIN,
  AFPO.MEINS AS BaseUnitOfMeasure_MEINS,
  AFPO.MATNR AS MaterialNumberForOrder_MATNR,
  AFPO.PAMNG AS FixedQuantityOfScrapFromProduction_PAMNG,
  AFPO.PGMNG AS TotalPlannedOrderQuantity_PGMNG,
  AFPO.KNTTP AS AccountAssignmentCategory_KNTTP,
  AFPO.TPAUF AS Indicator_PartialConversion_TPAUF,
  AFPO.LTRMI AS ActualDeliveryfinishDate_LTRMI,
  AFPO.LTRMP AS DelivDateFrPlannedOrd_LTRMP,
  AFPO.KALNR AS CostEstimateNumberForCostEstWoQtyStructure_KALNR,
  AFPO.UEBTO AS OverdeliveryToleranceLimit_UEBTO,
  AFPO.UEBTK AS Indicator_UnlimitedOverdeliveryAllowed_UEBTK,
  AFPO.UNTTO AS UnderdeliveryToleranceLimit_UNTTO,
  AFPO.INSMK AS StockType_INSMK,
  AFPO.WEPOS AS GoodsReceiptIndicator_WEPOS,
  AFPO.BWTAR AS ValuationType_BWTAR,
  AFPO.BWTTY AS ValuationCategory_BWTTY,
  AFPO.PWERK AS PlanningPlantForTheOrder_PWERK,
  AFPO.LGORT AS StorageLocation_LGORT,
  AFPO.UMREZ AS NumeratorForConversionToBaseUnitsOfMeasure_UMREZ,
  AFPO.UMREN AS DenominatorForConversionToBaseUnitsOfMeasure_UMREN,
  AFPO.WEBAZ AS GoodsReceiptProcessingTimeInDays_WEBAZ,
  AFPO.ELIKZ AS deliveryCompletedIndicator_ELIKZ,
  AFPO.SAFNR AS RunScheduleHeaderNumber_SAFNR,
  AFPO.VERID AS ProductionVersion_VERID,
  AFPO.SERNR AS BomExplosionNumber_SERNR,
  AFPO.TECHS AS ParameterVariantstandardVariant_TECHS,
  AFPO.DWERK AS Plant_DWERK,
  AFPO.DAUTY AS OrderCategory_DAUTY,
  AFPO.DAUAT AS OrderType_DAUAT,
  AFPO.DGLTP AS BasicFinishDate_DGLTP,
  AFPO.DGLTS AS ScheduledFinish_DGLTS,
  AFPO.DFREI AS Indicator_OrderReleasedpartiallyReleased__forMrp___DFREI,
  AFPO.DNREL AS Indicator_OrderItemNotRelevantForMrp_DNREL,
  AFPO.VERTO AS MrpDistributionKey_VERTO,
  AFPO.SOBKZ AS SpecialStockIndicator_SOBKZ,
  AFPO.KZVBR AS ConsumptionPosting_KZVBR,
  AFPO.WEWRT AS ValueOfGoodsReceivedInLocalCurrency_WEWRT,
  AFPO.WEUNB AS GoodsReceipt_NonValuated_WEUNB,
  AFPO.ABLAD AS UnloadingPoint_ABLAD,
  AFPO.WEMPF AS GoodsRecipient_WEMPF,
  AFPO.CHARG AS BatchNumber_CHARG,
  AFPO.GSBER AS BusinessArea_GSBER,
  AFPO.WEAED AS Indicator_GoodsReceiptIndicatorCanBeChanged_WEAED,
  --AFPO.CUOBJ AS Configuration__internalObjectNumber___CUOBJ,
  AFPO.KBNKZ AS KanbanIndicator_KBNKZ,
  --AFPO.ARSNR AS SettlementReservationNumber_ARSNR,
  --AFPO.ARSPS AS ItemNumberOfTheSettlementReservation_ARSPS,
  AFPO.KRSNR AS NumberOfReservationdependentRequirements_KRSNR,
  AFPO.KRSPS AS ItemNumberOfReservationDependentRequirements_KRSPS,
  AFPO.KCKEY AS CostCollectorKey_KCKEY,
  AFPO.RTP01 AS CostCollectorForRepetitiveManufacturing_RTP01,
  AFPO.RTP02 AS CostCollectorForKanban_RTP02,
  AFPO.RTP03 AS CostCollectorForValuatedSalesOrderStock_RTP03,
  AFPO.RTP04 AS CostCollectorForExternalPpc_RTP04,
  AFPO.KSVON AS CostCollectorValidFrom_KSVON,
  AFPO.KSBIS AS CostCollectorValidTo_KSBIS,
  AFPO.OBJNP AS ObjectNumber_OBJNP,
  --AFPO.VFMNG AS CommittedQuantityForOrderAfterAtpCheckComponents_VFMNG,
  --AFPO.GSBTR AS OverallCommitmentDate_GSBTR,
  AFPO.NDISR AS Ind_MaterialInOrderItemIsNotRelevantForMrp_NDISR,
  AFPO.KZAVC AS IndicatorForTypeOfAvailabilityCheck_KZAVC,
  AFPO.KZBWS AS ValuationOfSpecialStock_KZBWS,
  AFPO.XLOEK AS DeletionFlag_XLOEK,
  AFPO.SERNP AS SerialNumberProfile_SERNP,
  AFPO.ANZSN AS NumberOfSerialNumbers_ANZSN,
  --AFPO.OBJTYPE AS ChangeIndicator_OBJTYPE,
  --AFPO.CH_PROC AS ProcessThatHasLeadToTheChangeOfAnObject_CH_PROC,
  AFPO.FXPRU AS FixedPriceCoProduct_FXPRU,
  AFPO.CUOBJ_ROOT AS Configuration__internalObjectNumber___CUOBJ_ROOT,
  AFPO.BERID AS MrpArea_BERID,
  AFPO.TECHS_COPY AS ParameterVariantstandardVariant_TECHS_COPY,
  AFPO.SGT_SCAT AS StockSegment_SGT_SCAT,
  AFPO.KUNNR2 AS CustomerNumber_KUNNR2,
  AFPO.FSH_SEASON_YEAR AS SeasonYear_FSH_SEASON_YEAR,
  AFPO.FSH_SEASON AS Season_FSH_SEASON,
  AFPO.FSH_COLLECTION AS FashionCollection_FSH_COLLECTION,
  AFPO.FSH_THEME AS FashionTheme_FSH_THEME,
  AFPO.FSH_SALLOC_QTY AS AllocatedStockQuantity_FSH_SALLOC_QTY,
  AFPO.MILL_OC_AUFNR_U AS NumberOfOriginalOrder_MILL_OC_AUFNR_U,
  AFPO.MILL_OC_RUMNG AS ConfirmedQuantityForItem_MILL_OC_RUMNG,
  AFPO.MILL_OC_SORT AS ItemSequence_MILL_OC_SORT,
  --AUFK.MANDT AS Client_MANDT,
  --AUFK.AUFNR AS OrderNumber_AUFNR,
  AUFK.AUART AS OrderType_AUART,
  AUFK.AUTYP AS OrderCategory_AUTYP,
  AUFK.REFNR AS ReferenceOrderNumber_REFNR,
  AUFK.ERNAM AS EnteredBy_ERNAM,
  AUFK.ERDAT AS CreatedOn_ERDAT,
  AUFK.AENAM AS LastChangedBy_AENAM,
  AUFK.AEDAT AS ChangeDateForOrderMaster_AEDAT,
  AUFK.KTEXT AS Description_KTEXT,
  AUFK.LTEXT AS LongTextExists_LTEXT,
  AUFK.BUKRS AS CompanyCode_BUKRS,
  AUFK.WERKS AS Plant_WERKS,
  --AUFK.GSBER AS BusinessArea_GSBER,
  AUFK.KOKRS AS ControllingArea_KOKRS,
  AUFK.CCKEY AS CostCollectorKey_CCKEY,
  AUFK.KOSTV AS ResponsibleCostCenter_KOSTV,
  AUFK.STORT AS Location_STORT,
  AUFK.SOWRK AS LocationPlant_SOWRK,
  AUFK.ASTKZ AS IdentifierForStatisticalOrder_ASTKZ,
  AUFK.WAERS AS OrderCurrency_WAERS,
  AUFK.ASTNR AS OrderStatus_ASTNR,
  AUFK.STDAT AS DateOfLastStatusChange_STDAT,
  AUFK.ESTNR AS StatusReachedSoFar_ESTNR,
  AUFK.PHAS0 AS PhaseorderCreated_PHAS0,
  AUFK.PHAS1 AS PhaseorderReleased_PHAS1,
  AUFK.PHAS2 AS PhaseorderCompleted_PHAS2,
  AUFK.PHAS3 AS PhaseorderClosed_PHAS3,
  AUFK.PDAT1 AS PlannedReleaseDate_PDAT1,
  AUFK.PDAT2 AS PlannedCompletionDate_PDAT2,
  AUFK.PDAT3 AS PlannedClosingDate_PDAT3,
  AUFK.IDAT1 AS ReleaseDate_IDAT1,
  AUFK.IDAT2 AS TechnicalCompletionDate_IDAT2,
  AUFK.IDAT3 AS CloseDate_IDAT3,
  AUFK.OBJID AS ObjectId_OBJID,
  AUFK.VOGRP AS GroupOfDisallowedTransactions_VOGRP,
  AUFK.LOEKZ AS DeletionFlag_LOEKZ,
  AUFK.PLGKZ AS IdentifierForPlanningWithLineItems_PLGKZ,
  AUFK.KVEWE AS UsageOfTheConditionTable_KVEWE,
  AUFK.KAPPL AS Application_KAPPL,
  AUFK.KALSM AS CostingSheet_KALSM,
  AUFK.ZSCHL AS OverheadKey_ZSCHL,
  AUFK.ABKRS AS ProcessingGroup_ABKRS,
  AUFK.KSTAR AS SettlementCostElement_KSTAR,
  AUFK.KOSTL AS CostCenterForBasicSettlement_KOSTL,
  AUFK.SAKNR AS GlAccountForBasicSettlement_SAKNR,
  AUFK.SETNM AS AllocationSet_SETNM,
  AUFK.CYCLE AS CostCenterToWhichCostsAreActuallyPosted_CYCLE,
  AUFK.SDATE AS StartDate_SDATE,
  AUFK.SEQNR AS SequenceNumber_SEQNR,
  AUFK.USER0 AS Applicant_USER0,
  AUFK.USER1 AS ApplicantsTelephoneNumber_USER1,
  AUFK.USER2 AS PersonResponsible_USER2,
  AUFK.USER3 AS TelephoneNumberOfPersonInCharge_USER3,
  AUFK.USER4 AS EstimatedTotalCostsOfOrder_USER4,
  AUFK.USER5 AS ApplicationDate_USER5,
  AUFK.USER6 AS Department_USER6,
  AUFK.USER7 AS WorkStart_USER7,
  AUFK.USER8 AS EndOfWork_USER8,
  AUFK.USER9 AS IdentifierForWorkPermitIssued_USER9,
  AUFK.OBJNR AS ObjectNumber_OBJNR,
  AUFK.PRCTR AS ProfitCenter_PRCTR,
  AUFK.PSPEL AS WorkBreakdownStructureElement__wbsElement___PSPEL,
  AUFK.AWSLS AS VarianceKey_AWSLS,
  AUFK.ABGSL AS ResultsAnalysisKey_ABGSL,
  AUFK.TXJCD AS TaxJurisdiction_TXJCD,
  AUFK.FUNC_AREA AS FunctionalArea_FUNC_AREA,
  AUFK.SCOPE AS ObjectClass_SCOPE,
  AUFK.PLINT AS IndicatorForIntegratedPlanning_PLINT,
  --AUFK.KDAUF AS SalesOrderNumber_KDAUF,
  --AUFK.KDPOS AS ItemNumberInSalesOrder_KDPOS,
  AUFK.AUFEX AS ExternalOrderNumber_AUFEX,
  AUFK.IVPRO AS InvestmentMeasureProfile_IVPRO,
  AUFK.LOGSYSTEM AS LogicalSystem_LOGSYSTEM,
  AUFK.FLG_MLTPS AS OrderWithMultipleItems_FLG_MLTPS,
  AUFK.ABUKR AS RequestingCompanyCode_ABUKR,
  AUFK.AKSTL AS RequestingCostCenter_AKSTL,
  AUFK.SIZECL AS ScaleOfInvestmentObjects_SIZECL,
  AUFK.IZWEK AS ReasonForInvestment_IZWEK,
  AUFK.UMWKZ AS ReasonForEnvironmentalInvestment_UMWKZ,
  AUFK.KSTEMPF AS Indicator_DirectCostCollector_KSTEMPF,
  AUFK.ZSCHM AS InterestProfileForProjectorderInterestCalculation_ZSCHM,
  AUFK.PKOSA AS CostCollectorForProductionProcessProcnr_PKOSA,
  AUFK.ANFAUFNR AS RequestingOrder_ANFAUFNR,
  AUFK.PROCNR AS ProductionProcess_PROCNR,
  AUFK.PROTY AS ProcessCategory__procurementconsumption___PROTY,
  AUFK.RSORD AS RefurbishmentOrderIndicator__pm___RSORD,
  AUFK.BEMOT AS AccountingIndicator_BEMOT,
  AUFK.ADRNRA AS AddressNumber_ADRNRA,
  AUFK.ERFZEIT AS TimeCreated_ERFZEIT,
  AUFK.AEZEIT AS ChangedAt_AEZEIT,
  AUFK.CSTG_VRNT AS CostingVariant_CSTG_VRNT,
  AUFK.COSTESTNR AS CostEstimateNumberForCostEstWoQtyStructure_COSTESTNR,
  AUFK.VERAA_USER AS PersonResponsibleForCoInternalOrder_VERAA_USER,
  AUFK.VNAME AS JointVenture_VNAME,
  AUFK.RECID AS RecoveryIndicator_RECID,
  AUFK.ETYPE AS EquityType_ETYPE,
  AUFK.OTYPE AS JointVentureObjectType_OTYPE,
  AUFK.JV_JIBCL AS JibjibeClass_JV_JIBCL,
  AUFK.JV_JIBSA AS JibjibeSubclassA_JV_JIBSA,
  AUFK.JV_OCO AS JvOriginalCostObject_JV_OCO,
  AUFK.CUM_INDCU AS Cu_OrderIsUsedForCompatibleUnits_CUM_INDCU,
  AUFK.CUM_CMNUM AS Cu_ConstructionMeasureNumber_CUM_CMNUM,
  AUFK.CUM_AUEST AS Cu_AutomaticCopyOfEstimatedCosts_CUM_AUEST,
  AUFK.CUM_DESNUM AS Cu_DesignNumber_CUM_DESNUM,
  AUFK.VAPLZ AS MainWorkCenterForMaintenanceTasks_VAPLZ,
  AUFK.WAWRK AS PlantAssociatedWithMainWorkCenter_WAWRK,
  AUFK.FERC_IND AS RegulatoryIndicator_FERC_IND,
  AUFK.CLAIM_CONTROL AS ClaimCreationControlIndicator_CLAIM_CONTROL,
  AUFK.UPDATE_NEEDED AS ClaimInconsistencyWithOrderIndicator_UPDATE_NEEDED,
  AUFK.UPDATE_CONTROL AS ClaimUpdateTriggerPointFromServiceOrder_UPDATE_CONTROL,
  --JEST.MANDT AS Client_MANDT,
  --JEST.OBJNR AS ObjectNumber_OBJNR,
  JEST.STAT AS ObjectStatus_STAT,
  JEST.INACT AS Indicator_StatusIsInactive_INACT,
  JEST.CHGNR AS ChangeNumber_CHGNR,
  JEST._DATAAGING AS DataFilterValueForDataAging__DATAAGING,
  --TJ02T.ISTAT AS SystemStatus_ISTAT,
  TJ02T.SPRAS AS LanguageKey_SPRAS,
  --TJ02T.TXT04 AS IndividualStatusOfAnObject__shortForm___TXT04,
  TJ02T.TXT30 AS ObjectStatus_TXT30
FROM
  `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.afko` AS AFKO
INNER JOIN
  `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.afpo` AS AFPO
  ON
    AFKO.mandt = AFPO.mandt
    AND AFKO.aufnr = AFPO.aufnr
INNER JOIN
  `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.aufk` AS AUFK
  ON
    AFKO.mandt = AUFK.mandt
    AND AFKO.aufnr = AUFK.aufnr
INNER JOIN
  `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.jest` AS JEST
  ON
    AUFK.mandt = JEST.mandt
    AND AUFK.objnr = JEST.objnr
INNER JOIN
  `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tj02t` AS TJ02T
  ON
    JEST.stat = TJ02T.istat
