SELECT
  likp.MANDT AS Client_MANDT,
  likp.VBELN AS Delivery_VBELN,
  likp.ERNAM AS CreatedBy_ERNAM,
  likp.ERZET AS CreateTime_ERZET,
  likp.ERDAT AS DateCreated_ERDAT,
  likp.BZIRK AS SalesDistrict_BZIRK,
  likp.VSTEL AS ShippingPointreceivingPoint_VSTEL,
  likp.VKORG AS SalesOrganization_VKORG,
  likp.LFART AS DeliveryType_LFART,
  likp.AUTLF AS CompleteDeliveryDefinedForEachSalesOrder_AUTLF,
  likp.KZAZU AS OrderCombinationIndicator_KZAZU,
  likp.WADAT AS PlannedGoodsMovementDate_WADAT,
  likp.LDDAT AS LoadingDate_LDDAT,
  likp.TDDAT AS TransportationPlanningDate_TDDAT,
  likp.LFDAT AS DeliveryDate_LFDAT,
  likp.LFUHR AS DeliveryTime_LFUHR,
  likp.KODAT AS PickingDate_KODAT,
  likp.ABLAD AS UnloadingPoint_ABLAD,
  likp.INCO1 AS Incoterms__part1___INCO1,
  likp.INCO2 AS Incoterms__part2___INCO2,
  likp.EXPKZ AS ExportIndicator_EXPKZ,
  likp.ROUTE AS Route_ROUTE,
  likp.FAKSK AS BillingBlockInSdDocument_FAKSK,
  likp.LIFSK AS DeliveryBlock_DocumentHeader_LIFSK,
  likp.VBTYP AS SdDocumentCategory_VBTYP,
  likp.KNFAK AS CustomerFactoryCalendar_KNFAK,
  likp.LPRIO AS DeliveryPriority_LPRIO,
  likp.VSBED AS ShippingConditions_VSBED,
  likp.KUNNR AS ShipToParty_KUNNR,
  likp.KUNAG AS SoldToParty_KUNAG,
  likp.KDGRP AS CustomerGroup_KDGRP,
  likp.BTGEW AS TotalWeight_BTGEW,
  likp.NTGEW AS NetWeightHdr_NTGEW,
  likp.GEWEI AS WeightUnitHdr_GEWEI,
  likp.VOLUM AS VolumeHdr_VOLUM,
  likp.VOLEH AS VolumeUnitHdr_VOLEH,
  likp.ANZPK AS TotalNumberOfPackagesInDelivery_ANZPK,
  likp.BEROT AS PickedItemsLocation_BEROT,
  likp.LFUHR AS TimeOfDelivery_LFUHR,
  likp.GRULG AS WeightGroupForDelivery_GRULG,
  likp.LSTEL AS LoadingPoint_LSTEL,
  likp.TRAGR AS TransportationGroupHdr_TRAGR,
  likp.FKARV AS ProposedBillingTypeForADeliveryRelatedBillingDoc_FKARV,
  likp.FKDAT AS BillingDateForBillingIndexAndPrintout_FKDAT,
  likp.PERFK AS InvoiceDates_PERFK,
  likp.ROUTA AS Route_ROUTA,
  likp.STAFO AS UpdateGroupForStatisticsHdr_STAFO,
  likp.KALSM AS PricingProcedure_KALSM,
  likp.KNUMV AS NumberOfTheDocumentCondition_KNUMV,
  likp.WAERK AS SdDocumentCurrency_WAERK,
  likp.VKBUR AS SalesOfficeHdr_VKBUR,
  likp.VBEAK AS ShippingProcessingTimeForTheEntireDocument_VBEAK,
  likp.ZUKRL AS CombinationCriteriaForDelivery_ZUKRL,
  likp.VERUR AS DistributionDelivery_VERUR,
  likp.COMMN AS CommunicationNumberForQApiInterface_COMMN,
  likp.STWAE AS StatisticsCurrency_STWAE,
  likp.STCUR AS ExchangeRateForStatistics_STCUR,
  likp.EXNUM AS NumberOfForeignTradeDataInMmAndSdDocuments_EXNUM,
  likp.AENAM AS NameOfPersonWhoChangedObjectHdr_AENAM,
  likp.AEDAT AS DateOfLastChangeHdr_AEDAT,
  likp.LGNUM AS WarehouseNumberWarehouseComplex_LGNUM,
  likp.LISPL AS DeliveryWithinOneWarehouse_LISPL,
  likp.VKOIV AS SalesOrganizationForIntercompanyBilling_VKOIV,
  likp.VTWIV AS DistributionChannelForIntercompanyBilling_VTWIV,
  likp.SPAIV AS DivisionForIntercompanyBilling_SPAIV,
  likp.FKAIV AS BillingTypeForIntercompanyBilling_FKAIV,
  likp.PIOIV AS DateForInterCompanyBilling_PIOIV,
  likp.FKDIV AS BillingDateForInterCompanyBilling_FKDIV,
  likp.KUNIV AS CustomerNumberForInterCompanyBilling_KUNIV,
  likp.KKBER AS CreditControlArea_KKBER,
  likp.KNKLI AS CreditLimitReference_KNKLI,
  likp.GRUPP AS CustomerCreditGroup_GRUPP,
  likp.SBGRP AS CreditRepresentativeGroupForCreditManagement_SBGRP,
  likp.CTLPC AS CreditManagement_RiskCategory_CTLPC,
  likp.CMWAE AS CurrencyKeyOfCreditControlArea_CMWAE,
  likp.AMTBL AS ReleasedCreditValueOfTheDocument_AMTBL,
  likp.BOLNR AS BillOfLading_BOLNR,
  likp.LIFNR AS VendorsAccountNumber_LIFNR,
  likp.TRATY AS MeansOfTransportType_TRATY,
  likp.TRAID AS MeansOfTransportId_TRAID,
  likp.CMFRE AS ReleaseDateOfTheDocumentDeterminedByCreditManagement_CMFRE,
  likp.CMNGV AS NextDate_CMNGV,
  likp.XABLN AS GoodsReceiptissueSlipNumber_XABLN,
  likp.BLDAT AS DocumentDateInDocument_BLDAT,
  likp.WADAT_IST AS ActualGoodsMovementDate_WADAT_IST,
  likp.TRSPG AS ShipmentBlockingReason_TRSPG,
  likp.TPSID AS IdForExternalTransportSystem_TPSID,
  likp.LIFEX AS ExternalIdentificationOfDeliveryNote_LIFEX,
  likp.TERNR AS OrderNumber_TERNR,
  likp.KALSM_CH AS SearchProcedureForBatchDetermination_KALSM_CH,
  likp.KLIEF AS CorrectionDelivery_KLIEF,
  likp.KALSP AS Shipping_PricingProcedure_KALSP,
  likp.KNUMP AS NumberOfDocumentConditionPricing_KNUMP,
  likp.AULWE AS RouteSchedule_AULWE,
  likp.WERKS AS ReceivingPlantForDeliveries_WERKS,
  likp.LCNUM AS FinancialDocNumber_LCNUM,
  likp.ABSSC AS PaymentGuaranteeProcedure_ABSSC,
  likp.KOUHR AS PickingTime_KOUHR,
  likp.TDUHR AS TranspPlanningTime_TDUHR,
  likp.LDUHR AS LoadingTime_LDUHR,
  likp.WAUHR AS TimeOfGoodsIssue_WAUHR,
  likp.LGTOR AS DoorForWarehouseNumber_LGTOR,
  likp.LGBZO AS StagingAreaForWarehouseComplexHdr_LGBZO,
  likp.AKWAE AS CurrencyKeyForeignTrade_AKWAE,
  likp.AKKUR AS ExchangeRateForLetterCreditProcgInForeignTrade_AKKUR,
  likp.AKPRZ AS DepreciationPercentageForFinancialDocumentProcessing_AKPRZ,
  likp.PROLI AS DangerousGoodsManagementProfileInSdDocuments_PROLI,
  likp.XBLNR AS ReferenceDocumentNumber_XBLNR,
  likp.HANDLE AS WorldwideUniqueKeyForlikpVbeln_HANDLE,
  likp.TSEGFL AS TimeSegmentExists_TSEGFL,
  likp.TSEGTP AS EventGroupTimeSegmentDeliveryHeader_TSEGTP,
  likp.TZONIS AS TimeZoneOfDeliveringLocation_TZONIS,
  likp.TZONRC AS TimeZoneOfRecipientLocation_TZONRC,
  likp.CONT_DG AS Indicator_DocumentContainsDangerousGoods_CONT_DG,
  likp.VERURSYS AS DistributionDelivery_OriginalSystem_VERURSYS,
  likp.KZWAB AS IndicatorForControllingGoodsMovement_KZWAB,
  likp.VLSTK AS DistributionStatus_VLSTK,
  likp.TCODE AS TransactionCode_TCODE,
  likp.VSART AS ShippingType_VSART,
  likp.TRMTYP AS MeansOfTransport_TRMTYP,
  likp.SDABW AS SpecialProcessingIndicator_SDABW,
  likp.VBUND AS CompanyId_VBUND,
  likp.XWOFF AS CalculationOfValOpen_XWOFF,
  likp.DIRTA AS AutomaticToCreationImmediatelyAfterTrGeneration_DIRTA,
  likp.PRVBE AS ProductionSupplyArea_PRVBE,
  likp.FOLAR AS DeliveryType_FOLAR,
  likp.PODAT AS Date__proofOfDelivery___PODAT,
  likp.POTIM AS ConfirmationTime_POTIM,
  likp.VGANZ AS NumberOfDeliveryItemsWithPrecedessOrInOtherSystem_VGANZ,
  likp.IMWRK AS DeliveryHasStatusInPlant_IMWRK,
  likp.SPE_LOEKZ AS DocumentDeletionIndicator_SPE_LOEKZ,
  likp.SPE_LOC_SEQ AS SequenceOfIntermediateLocationsInReturnsProcess_SPE_LOC_SEQ,
  likp.SPE_ACC_APP_STS AS DeliveryConfirmationStatus_SPE_ACC_APP_STS,
  likp.SPE_SHP_INF_STS AS ShipmentInformationStatus_SPE_SHP_INF_STS,
  likp.SPE_RET_CANC AS Returns_FlagShowingThatAnAsnIsCancelled_SPE_RET_CANC,
  likp.SPE_WAUHR_IST AS TimeOfGoodsIssue_Local,
  likp.SPE_WAZONE_IST AS TimeZone_SPE_WAZONE_IST,
  likp.SPE_REV_VLSTK AS DistributionStatus_DecentralizedWarehouseProcessing_SPE_REV_VLSTK,
  likp.SPE_LE_SCENARIO AS ScenarioLogisticExecution_SPE_LE_SCENARIO,
  likp.SPE_ORIG_SYS AS OriginalSystemType_SPE_ORIG_SYS,
  likp.SPE_CHNG_SYS AS LastChangerSystemType_SPE_CHNG_SYS,
  likp.SPE_GEOROUTE AS DescriptionOfAGeographicalRoute_SPE_GEOROUTE,
  likp.SPE_GEOROUTEIND AS ChangeIndicatorForTheRoute_SPE_GEOROUTEIND,
  likp.SPE_CARRIER_IND AS ChangeIndicatorForTheCarrier_SPE_CARRIER_IND,
  likp.SPE_GTS_REL AS GoodsTrafficType_SPE_GTS_REL,
  likp.SPE_GTS_RT_CDE AS RouteCodeForSapGlobalTradeServices_SPE_GTS_RT_CDE,
  likp.SPE_REL_TMSTMP AS ReleaseTimeStamp_SPE_REL_TMSTMP,
  likp.SPE_UNIT_SYSTEM AS MeasurementUnitSystem_SPE_UNIT_SYSTEM,
  likp.SPE_INV_BFR_GI AS InvoiceCreationBeForeGoodsIssue_SPE_INV_BFR_GI,
  likp.SPE_QI_STATUS AS StatusOfQualityInspectionForReturnsDeliveries_SPE_QI_STATUS,
  likp.SPE_RED_IND AS SpeIndicatorIfRedirectingHasOccured_SPE_RED_IND,
  likp.SAKES AS SapGlobalTradeServices_StorageStatusOfDelivery_SAKES,
  likp.SPE_LIFEX_TYPE AS TypeOfExternalIdentification_SPE_LIFEX_TYPE,
  likp.SPE_TTYPE AS MeansOfTransport_SPE_TTYPE,
  likp.SPE_PRO_NUMBER AS PartnerIdentification_ProgressiveIdentificationNumber_SPE_PRO_NUMBER,
  likp.LOC_GUID AS Akkreditiv_Guid_LOC_GUID,
  likp.SPE_BILLING_IND AS EwmBillingIndicator_SPE_BILLING_IND,
  likp.PRINTER_PROFILE AS DescriptionOfPrintProfile_PRINTER_PROFILE,
  likp.MSR_ACTIVE AS AdvancedReturnsManagementActive_MSR_ACTIVE,
  likp.PRTNR AS ConfirmationNumber_PRTNR,
  likp.STGE_LOC_CHANGE AS TemporaryChangeOfStorageLocationsInDelivery_STGE_LOC_CHANGE,
  likp.TM_CTRL_KEY AS ControlKeyForDocumentTransferToTm_TM_CTRL_KEY,
  likp.DLV_SPLIT_INITIA AS DeliverySplitInitiator_DLV_SPLIT_INITIA,
  likp.DLV_VERSION AS DeliveryVersion_DLV_VERSION,
  likp.HANDOVERLOC AS LocationForAPhysicalHandoverOfGoods_HANDOVERLOC,
  likp.HANDOVERDATE AS HandoverDateAtTheHandoverLocation_HANDOVERDATE,
  likp.INCO3_L AS IncotermsLocation2_INCO3_L,
  likp.BORGR_GRP AS MultiLevelGoodsReceiptAutomotive_BORGR_GRP,
  likp.FSH_TRANSACTION AS TransactionNumberHdr_FSH_TRANSACTION,
  likp.FSH_VAS_LAST_ITEM AS LastVasItemNumber_FSH_VAS_LAST_ITEM,
  likp.FSH_VAS_CG AS ValueAddedServicesCustomerGroup_FSH_VAS_CG,
  lips.POSNR AS DeliveryItem_POSNR,
  lips.PSTYV AS DeliveryItemCategory_PSTYV,
  lips.ERNAM AS NameOfPersonWhoCreatedTheObject_ERNAM,
  lips.ERZET AS EntryTime_ERZET,
  lips.ERDAT AS DateOnWhichRecordWasCreated_ERDAT,
  lips.MATNR AS MaterialNumber_MATNR,
  lips.MATWA AS MaterialEntered_MATWA,
  lips.MATKL AS MaterialGroup_MATKL,
  lips.WERKS AS Plant_WERKS,
  lips.LGORT AS StorageLocation_LGORT,
  lips.CHARG AS BatchNumber_CHARG,
  lips.LICHN AS VendorBatchNumber_LICHN,
  lips.KDMAT AS MaterialBelongingToTheCustomer_KDMAT,
  lips.PRODH AS ProductHierarchy_PRODH,
  lips.LFIMG AS ActualQuantityDelivered_InSalesUnits_LFIMG,
  lips.MEINS AS BaseUnitOfMeasure_MEINS,
  lips.VRKME AS SalesUnit_VRKME,
  lips.UMVKZ AS Numerator_Factor_ForConversionOfSalesQuantityIntoSku_UMVKZ,
  lips.UMVKN AS Denominator_Divisor_ForConversionOfSalesQtyIntoSku_UMVKN,
  lips.GEWEI AS WeightUnit_GEWEI,
  lips.VOLEH AS VolumeUnit_VOLEH,
  lips.KZTLF AS PartialDeliveryAtItemLevel_KZTLF,
  lips.UEBTK AS Indicator_UnlimitedOverdeliveryAllowed_UEBTK,
  lips.UEBTO AS OverdeliveryToleranceLimit_UEBTO,
  lips.UNTTO AS UnderdeliveryToleranceLimit_UNTTO,
  lips.CHSPL AS BatchSplitAllowed_CHSPL,
  lips.FAKSP AS BillingBlock_FAKSP,
  lips.MBDAT AS MaterialAvailabilityDate_MBDAT,
  lips.LGMNG AS ActualQuantityDeliveredInStockKeepingUnits_LGMNG,
  lips.ARKTX AS ShortTextForSalesOrderItem_ARKTX,
  lips.LGPBE AS StorageBin_LGPBE,
  lips.VBELV AS OriginatingDocument_VBELV,
  lips.POSNV AS OriginatingItem_POSNV,
  lips.VBTYV AS SdDocumentCategory_VBTYV,
  lips.VGSYS AS LogicalSystemInThePrecedingDocument_VGSYS,
  lips.VGBEL AS SalesOrderNumber_VGBEL,
  lips.VGPOS AS SalesOrderItem_VGPOS,
  lips.UPFLU AS UpdateIndicatorForDeliveryDocumentFlow_UPFLU,
  lips.UEPOS AS HigherLevelItemInBOM_UEPOS,
  lips.FKREL AS RelevantForBilling_FKREL,
  lips.LADGR AS LoadingGroup_LADGR,
  lips.TRAGR AS TransportationGroup_TRAGR,
  lips.KOMKZ AS IndicatorForPickingControl_KOMKZ,
  lips.LGNUM AS WarehouseNumber_LGNUM,
  lips.LISPL AS SplitToWarehouseNumberRequired_LISPL,
  lips.LGTYP AS StorageType_LGTYP,
  lips.LGPLA AS StorageBin_LGPLA,
  lips.BWTEX AS Indicator_SeparateValuation_BWTEX,
  lips.BWART AS MovementType_InventoryManagement_BWART,
  lips.BWLVS AS MovementTypeForWarehouseManagement_BWLVS,
  lips.KZDLG AS Indicator_DynamicStorageBinInWarehouseManagement_KZDLG,
  lips.BDART AS RequirementType_BDART,
  lips.PLART AS PlanningType_PLART,
  lips.MTART AS MaterialType_MTART,
  lips.XCHPF AS BatchManagementRequirementIndicator_XCHPF,
  lips.XCHAR AS BatchManagementIndicator_Internal_XCHAR,
  lips.VGREF AS PrecedingDocumentHasResultedFromReference_VGREF,
  lips.POSAR AS ItemType_POSAR,
  lips.BWTAR AS ValuationType_BWTAR,
  lips.SUMBD AS SummingUpOfRequirements_SUMBD,
  lips.MTVFP AS CheckingGroupForAvailability_MTVFP,
  lips.GSBER AS BusinessArea_GSBER,
  lips.VKBUR AS SalesOffice_VKBUR,
  lips.VKGRP AS SalesGroup_VKGRP,
  lips.VTWEG AS DistributionChannel_VTWEG,
  lips.SPART AS Division_SPART,
  lips.GRKOR AS DeliveryGroup_ItemsAreDeliveredTogether_GRKOR,
  lips.FMENG AS QuantityIsFixed_FMENG,
  lips.ANTLF AS MaximumNumberOfPartialDeliveriesAllowedPerItem_ANTLF,
  lips.VBEAF AS FixedShippingProcessingTimeInDays_VBEAF,
  lips.VBEAV AS VariableShippingProcessingTimeInDays_VBEAV,
  lips.STAFO AS UpdateGroupForStatisticsUpdate_STAFO,
  lips.KZWI1 AS Subtotal1FromPricingProcedureForCondition_KZWI1,
  lips.KZWI2 AS Subtotal2FromPricingProcedureForCondition_KZWI2,
  lips.KZWI3 AS Subtotal3FromPricingProcedureForCondition_KZWI3,
  lips.KZWI4 AS Subtotal4FromPricingProcedureForCondition_KZWI4,
  lips.KZWI5 AS Subtotal5FromPricingProcedureForCondition_KZWI5,
  lips.KZWI6 AS Subtotal6FromPricingProcedureForCondition_KZWI6,
  lips.SOBKZ AS SpecialStockIndicator_SOBKZ,
  lips.AEDAT AS DateOfLastChange_AEDAT,
  lips.EAN11 AS InternationalArticleNumber_Eanupc_EAN11,
  lips.KVGR1 AS CustomerGroup1_KVGR1,
  lips.KVGR2 AS CustomerGroup2_KVGR2,
  lips.KVGR3 AS CustomerGroup3_KVGR3,
  lips.KVGR4 AS CustomerGroup4_KVGR4,
  lips.KVGR5 AS CustomerGroup5_KVGR5,
  lips.MVGR1 AS MaterialGroup1_MVGR1,
  lips.MVGR2 AS MaterialGroup2_MVGR2,
  lips.MVGR3 AS MaterialGroup3_MVGR3,
  lips.MVGR4 AS MaterialGroup4_MVGR4,
  lips.MVGR5 AS MaterialGroup5_MVGR5,
  lips.VPZUO AS AllocationIndicator_VPZUO,
  lips.VGTYP AS SdDocumentCategory_VGTYP,
  lips.RFVGTYP AS TypeOfPrecedingDocumentInCentralSystem_RFVGTYP,
  lips.KOSTL AS CostCenter_KOSTL,
  lips.KOKRS AS ControllingArea_KOKRS,
  lips.PAOBJNR AS ProfitabilitySegmentNumber_PAOBJNR,
  lips.PRCTR AS ProfitCenter_PRCTR,
  lips.PS_PSP_PNR AS WorkBreakdownStructureElement_WbsElement_PS_PSP_PNR,
  lips.AUFNR AS OrderNumber_AUFNR,
  lips.POSNR_PP AS OrderItemNumber_POSNR_PP,
  lips.KDAUF AS SalesOrderNumber_KDAUF,
  lips.KDPOS AS ItemNumberInSalesOrder_KDPOS,
  lips.VPMAT AS PlanningMaterial_VPMAT,
  lips.VPWRK AS PlanningPlant_VPWRK,
  lips.PRBME AS BaseUnitOfMeasureForProductGroup_PRBME,
  lips.UMREF AS ConversionFactor_Quantities_UMREF,
  lips.KNTTP AS AccountAssignmentCategory_KNTTP,
  lips.KZVBR AS ConsumptionPosting_KZVBR,
  lips.FIPOS AS CommitmentItem_FIPOS,
  lips.FISTL AS FundsCenter_FISTL,
  lips.GEBER AS Fund_GEBER,
  lips.PCKPF AS PackingControl_PCKPF,
  lips.BEDAR_LF AS RequirementsClass_BEDAR_LF,
  lips.CMPNT AS Id_ItemWithActiveCreditFunctionRelevantForCredit_CMPNT,
  lips.KCMENG AS CumulativeBatchQuantityOfAllSplitItems_InStckunit_KCMENG,
  lips.KCBRGEW AS CumulativeGrossWeightOfAllBatchSplitItems_KCBRGEW,
  lips.KCNTGEW AS CumulativeNetWeightOfAllBatchSplitItems_KCNTGEW,
  lips.KCVOLUM AS CumulativeVolumeOfAllBatchSplitItems_KCVOLUM,
  lips.UECHA AS HigherLevelItemOfBatchSplitItem_UECHA,
  lips.CUOBJ AS Configuration_CUOBJ,
  lips.CUOBJ_CH AS InternalObjectNumberOfTheBatchClassification_CUOBJ_CH,
  lips.ANZSN AS NumberOfSerialNumbers_ANZSN,
  lips.SERAIL AS SerialNumberProfile_SERAIL,
  lips.KCGEWEI AS WeightUnit_KCGEWEI,
  lips.KCVOLEH AS VolumeUnit_KCVOLEH,
  lips.SERNR AS BomExplosionNumber_SERNR,
  lips.ABRLI AS InternalDeliveryScheduleNumber_ABRLI,
  lips.ABART AS RelType_ABART,
  lips.ABRVW AS UsageIndicator_ABRVW,
  lips.QPLOS AS InspectionLotNumber_QPLOS,
  lips.QTLOS AS PartialLotNumber_QTLOS,
  lips.NACHL AS CustomerHasNotPostedGoodsReceipt_NACHL,
  lips.MAGRV AS MaterialGroup_PackagingMaterials_MAGRV,
  lips.OBJKO AS ObjectNumberAtHeaderLevel_OBJKO,
  lips.OBJPO AS ObjectNumberAtItemLevel_OBJPO,
  lips.AESKD AS CustomerEngineeringChangeStatus_AESKD,
  lips.SHKZG AS ReturnsItem_SHKZG,
  lips.PROSA AS IdForMaterialDetermination_PROSA,
  lips.UEPVW AS HigherLevelItemUsage_UEPVW,
  lips.EMPST AS ReceivingPoint_EMPST,
  lips.ABTNR AS DepartmentNumber_ABTNR,
  lips.KOQUI AS PickingIsSubjectToConfirmation_KOQUI,
  lips.STADAT AS StatisticsDate_STADAT,
  lips.AKTNR AS Promotion_AKTNR,
  lips.KNUMH_CH AS NumberOfConditionRecordFromBatchDetermination_KNUMH_CH,
  lips.PREFE AS PreferenceIndicatorInExportimport_PREFE,
  lips.EXART AS BusinessTransactionTypeForForeignTrade_EXART,
  lips.CLINT AS InternalClassNumber_CLINT,
  lips.CHMVS AS Batches_ExitToQuantityProposal_CHMVS,
  lips.ABELN AS AllocationTableNumber_ABELN,
  lips.ABELP AS ItemNumberOfAllocationTable_ABELP,
  lips.LFIMG_FLO AS InternalFieldDoNotUseLfimgInFloatMum_LFIMG_FLO,
  lips.LGMNG_FLO AS InternalFieldDoNotUseLgmngInFloatMum_LGMNG_FLO,
  lips.KCMENG_FLO AS InternalFieldDoNotUseKcmengInFloatMum_KCMENG_FLO,
  lips.KZUMW AS EnvironmentallyRelevant_KZUMW,
  lips.KMPMG AS ComponentQuantity_KMPMG,
  lips.AUREL AS RelevantToAllocationTable_AUREL,
  lips.KPEIN AS ConditionPricingUnit_KPEIN,
  lips.KMEIN AS ConditionUnit_KMEIN,
  COALESCE(lips.NETPR * currency_decimal.CURRFIX, lips.NETPR) AS NetPrice_NETPR,
  lips.KOWRR AS StatisticalValues_KOWRR,
  lips.KZBEW AS MovementIndicator_KZBEW,
  lips.MFRGR AS MaterialFreightGroup_MFRGR,
  lips.CHHPV AS PackAccumulatedBatchesMovementTypeItem_CHHPV,
  lips.ABFOR AS FormOfPaymentGuarantee_ABFOR,
  lips.ABGES AS Guaranteed_FactorBetween0And1_ABGES,
  lips.MBUHR AS MaterialStagingTime_MBUHR,
  lips.WKTNR AS ValueContractNo_WKTNR,
  lips.WKTPS AS ValueContractItem_WKTPS,
  lips.J_1BCFOP AS CfopCodeAndExtension_J_1BCFOP,
  lips.J_1BTAXLW1 AS TaxLaw_Icms_J_1BTAXLW1,
  lips.J_1BTAXLW2 AS TaxLaw_Ipi_J_1BTAXLW2,
  lips.J_1BTXSDC AS SdTaxCode_J_1BTXSDC,
  lips.SITUA AS IndicatorForSituation_SITUA,
  lips.RSNUM AS NumberOfReservationdependentRequirements_RSNUM,
  lips.RSPOS AS ItemNumberOfReservationDependentRequirements_RSPOS,
  lips.RSART AS RecordType_RSART,
  lips.KANNR AS KanbansequenceNumber_KANNR,
  lips.KZFME AS Id_LeadingUnitOfMeasureForCompletingATransaction_KZFME,
  lips.PROFL AS DangerousGoodsIndicatorProfile_PROFL,
  lips.KCMENGVME AS CumulativeBatchQuantityOfAllSplitItemsInSalesUnits_KCMENGVME,
  lips.KCMENGVMEF AS CumulatedBatchSplitQuantityInVrkmeAndFloat_KCMENGVMEF,
  lips.KZBWS AS ValuationOfSpecialStock_KZBWS,
  lips.PSPNR AS ProjectDefinition_Internal_PSPNR,
  lips.EPRIO AS WithdrawalSequenceGroupForStocks_EPRIO,
  lips.RULES AS StockDeterminationRule_RULES,
  lips.KZBEF AS IndicatorInventoryManagementActive_KZBEF,
  lips.MPROF AS MfrPartProfile_MPROF,
  lips.EMATN AS MaterialNumberCorrespondingToManufacturerPartNumber_EMATN,
  lips.LGBZO AS StagingAreaForWarehouseComplex_LGBZO,
  lips.HANDLE AS WorldwideUniqueKeyForlips_HANDLE,
  lips.VERURPOS AS DistributionDelivery_OriginalItem_VERURPOS,
  lips.LIFEXPOS AS ExternalItemNumber_LIFEXPOS,
  lips.NOATP AS Indicator_DeactivateAvailabilityCheck_NOATP,
  lips.NOPCK AS Indicator_NotRelevantForPicking_NOPCK,
  lips.RBLVS AS ReferenceMovementTypeForWmFromMaterialMovements_RBLVS,
  lips.BERID AS MrpArea_BERID,
  lips.BESTQ AS StockCategoryInTheWarehouseManagementSystem_BESTQ,
  lips.UMBSQ AS StockCategoryInTheWarehouseManagementSystem_UMBSQ,
  lips.UMMAT AS ReceivingIssuingMaterial_UMMAT,
  lips.UMWRK AS ReceivingPlantIssuingPlant_UMWRK,
  lips.UMLGO AS ReceivingIssuingStorageLocation_UMLGO,
  lips.UMCHA AS ReceivingIssuingBatch_UMCHA,
  lips.UMBAR AS ValuationTypeOfTransferBatch_UMBAR,
  lips.UMSOK AS SpecialStockIndicatorForPhysicalStockTransfer_UMSOK,
  lips.SONUM AS SpecialStockNumber_SONUM,
  lips.USONU AS SpecialStockNumber_USONU,
  lips.AKKUR AS ExchangeRateForLetterForeignTrade_AKKUR,
  lips.AKMNG AS CurrentQtyFieldForArithmeticOperations_AKMNG,
  lips.VKGRU AS RepairProcessing_ClassificationOfItems_VKGRU,
  lips.SHKZG_UM AS Indicator_UnmatInMainPosting_SHKZG_UM,
  lips.INSMK AS StockType_INSMK,
  lips.KZECH AS DeterminationOfBatchEntryInTheProductionprocessOrder_KZECH,
  lips.FLGWM AS DestStorageDataFromPrecedingDocument_FLGWM,
  lips.BERKZ AS MaterialStagingIndicatorForProductionSupply_BERKZ,
  lips.HUPOS AS Indicator_DeliveryItemIsAHuItem_HUPOS,
  lips.NOWAB AS Indicator_ItemNotRelevantForGoodsMovements_NOWAB,
  lips.KONTO AS GlAccountNumber_KONTO,
  lips.KZEAR AS FinalIssueForThisReservation_KZEAR,
  lips.HSDAT AS DateOfManufacture_HSDAT,
  lips.VFDAT AS BestBeforeDate_VFDAT,
  lips.LFGJA AS FiscalYearOfCurrentPeriod_LFGJA,
  lips.LFBNR AS AReferenceDocument_LFBNR,
  lips.LFPOS AS ItemOfAReferenceDocument_LFPOS,
  lips.GRUND AS ReasonForGoodsMovment_GRUND,
  lips.FOBWA AS SubsequentMovementType_FOBWA,
  lips.DLVTP AS DeliveryCategory_DLVTP,
  lips.EXBWR AS ExternallyEnteredPostingAmountInLocalCurrency_EXBWR,
  lips.BPMNG AS QuantityInPurchaseOrderPriceUnit_BPMNG,
  lips.EXVKW AS ExternallyEnteredSalesValueInLocalCurrency_EXVKW,
  lips.CMPRE_FLT AS ItemCreditPrice_CMPRE_FLT,
  lips.KZPOD AS PodIndicator_KZPOD,
  lips.LFDEZ AS NotRelevantForDistributionForWms_LFDEZ,
  lips.UMREV AS ConversionFactorOfDeliveryQuantityVrkmeForMeins_UMREV,
  lips.PODREL AS PodControl_ProofOfDelivery_PODREL,
  lips.KZUML AS StockTransfertransferPosting_KZUML,
  lips.FKBER AS FunctionalArea_FKBER,
  lips.GRANT_NBR AS Grant_GRANT_NBR,
  lips.KZWSO AS UnitsOfMeasureUsage_KZWSO,
  lips.GMCONTROL AS GoodsMovementControl_GMCONTROL,
  lips.POSTING_CHANGE AS GoodsMovementControl_Hu_POSTING_CHANGE,
  lips.UM_PS_PSP_PNR AS Receivingissuing_WbsElement_UM_PS_PSP_PNR,
  lips.PRE_VL_ETENS AS SequentialNumberOfVendorConfirmation_PRE_VL_ETENS,
  lips.SPE_GEN_ELIKZ AS DeliveryCompleted_SPE_GEN_ELIKZ,
  lips.SPE_SCRAP_IND AS ScrapIndicatorForEwmProcessing_SPE_SCRAP_IND,
  lips.SPE_AUTH_NUMBER AS ReturnMaterialAuthorizationNumber_SPE_AUTH_NUMBER,
  lips.SPE_INSPOUT_GUID AS Inspections_InspectionOutcomeGuidSetByEwm_SPE_INSPOUT_GUID,
  lips.SPE_FOLLOW_UP AS DefaultFollow_SPE_FOLLOW_UP,
  lips.SPE_EXP_DATE_EXT AS EndDateOfValidityPeriodOfReturnsDelivery_SPE_EXP_DATE_EXT,
  lips.SPE_EXP_DATE_INT AS EndDateOfInternalValidityPeriodOfReturnsDelivery_SPE_EXP_DATE_INT,
  lips.SPE_AUTH_COMPLET AS RmaCompletionIndicator_SPE_AUTH_COMPLET,
  lips.ORMNG AS OriginalQuantityOfDeliveryItem_ORMNG,
  lips.SPE_ATP_TMSTMP AS AtpTimeStamp_SPE_ATP_TMSTMP,
  lips.SPE_ORIG_SYS AS OriginalSystemTypeItm_SPE_ORIG_SYS,
  lips.SPE_LIEFFZ AS CumulativeQtyForSchedagrVendorPOV_SPE_LIEFFZ,
  lips.SPE_IMWRK AS InboundDeliveryItemHasStatusinPlant_SPE_IMWRK,
  lips.SPE_LIFEXPOS2 AS ExternalItemIdentifier_SPE_LIFEXPOS2,
  lips.SPE_EXCEPT_CODE AS ExceptionCodeWarehouseForQuantityDifference_SPE_EXCEPT_CODE,
  lips.SPE_KEEP_QTY AS RetentionQuantityForScrap_SPE_KEEP_QTY,
  lips.SPE_ALTERNATE AS AlternateProductNumber_SPE_ALTERNATE,
  lips.SPE_MAT_SUBST AS ReasonForMaterialSubstitution_SPE_MAT_SUBST,
  lips.SPE_STRUC AS StructureOfItemsThatAreDeliveredTogether_SPE_STRUC,
  lips.SPE_APO_QNTYFAC AS NumeratorOfQuotientForUnitOfMeasureConversion_SPE_APO_QNTYFAC,
  lips.SPE_APO_QNTYDIV AS DenominatorOfQuotientForUnitOfMeasureConversion_SPE_APO_QNTYDIV,
  lips.SPE_HERKL AS NonPreferentialOrigin_SPE_HERKL,
  lips.SPE_BXP_DATE_EXT AS BeginDateOfValidityPeriodOfReturnsDelivery_SPE_BXP_DATE_EXT,
  lips.SPE_VERSION AS DeliveryVersionAtConfirmation_SPE_VERSION,
  lips.SPE_COMPL_MVT AS CompletionOfGoodsMovementsAfterDifferencePostings_SPE_COMPL_MVT,
  lips.J_1BTAXLW4 AS CofinsTaxLaw_J_1BTAXLW4,
  lips.J_1BTAXLW5 AS PisTaxLaw_J_1BTAXLW5,
  lips.J_1BTAXLW3 AS IssTaxLaw_J_1BTAXLW3,
  lips.BUDGET_PD AS Fm_BudgetPeriod_BUDGET_PD,
  lips.KBNKZ AS KanbanIndicator_KBNKZ,
  lips.FARR_RELTYPE AS RevenueAccountingType_FARR_RELTYPE,
  lips.SITKZ AS SpecificationForIssuingValuatedStockInTransit_SITKZ,
  lips.SGT_RCAT AS RequirementSegment_SGT_RCAT,
  lips.SGT_SCAT AS StockSegment_SGT_SCAT,
  lips.FSH_SEASON_YEAR AS SeasonYear_FSH_SEASON_YEAR,
  lips.FSH_SEASON AS Season_FSH_SEASON,
  lips.FSH_COLLECTION AS FashionCollection_FSH_COLLECTION,
  lips.FSH_THEME AS FashionTheme_FSH_THEME,
  lips.FSH_KVGR6 AS CustomerGroup6_FSH_KVGR6,
  lips.FSH_KVGR7 AS CustomerGroup7_FSH_KVGR7,
  lips.FSH_KVGR8 AS CustomerGroup8_FSH_KVGR8,
  lips.FSH_KVGR9 AS CustomerGroup9_FSH_KVGR9,
  lips.FSH_KVGR10 AS CustomerGroup10_FSH_KVGR10,
  lips.FSH_VAS_REL AS VasRelevant_FSH_VAS_REL,
  lips.FSH_VAS_PRNT_ID AS DeliveryItem_FSH_VAS_PRNT_ID,
  lips.FSH_TRANSACTION AS TransactionNumber_FSH_TRANSACTION,
  lips.FSH_ITEM_GROUP AS ItemGroup_FSH_ITEM_GROUP,
  lips.FSH_ITEM AS ItemNumber_FSH_ITEM,
  lips.FSH_RSNUM AS NumberOfReservationdependentRequirements_FSH_RSNUM,
  lips.FSH_RSPOS AS ItemNumberOfReservationDependentRequirements_FSH_RSPOS,
  lips.CONS_ORDER AS PurchaseOrderForConsignment_CONS_ORDER,
  lips.WRF_CHARSTC1 AS CharacteristicValue1_WRF_CHARSTC1,
  lips.WRF_CHARSTC2 AS CharacteristicValue2_WRF_CHARSTC2,
  lips.WRF_CHARSTC3 AS CharacteristicValue3_WRF_CHARSTC3,
  --##CORTEX-CUSTOMER Consider adding other dimensions from the calendar_date_dim table as per your requirement
  CalendarDateDimension_LFDAT.CalYear AS YearOfDeliveryDate_LFDAT,
  CalendarDateDimension_LFDAT.CalMonth AS MonthOfDeliveryDate_LFDAT,
  CalendarDateDimension_LFDAT.CalWeek AS WeekOfDeliveryDate_LFDAT,
  CalendarDateDimension_LFDAT.DayOfMonth AS DayOfDeliveryDate_LFDAT,
  CalendarDateDimension_LFDAT.CalQuarter AS QuarterOfDeliveryDate_LFDAT,
  CalendarDateDimension_PODAT.CalYear AS YearOfProofOfDeliveryDate_PODAT,
  CalendarDateDimension_PODAT.CalMonth AS MonthOfProofOfDeliveryDate_PODAT,
  CalendarDateDimension_PODAT.CalWeek AS WeekOfProofOfDeliveryDate_PODAT,
  CalendarDateDimension_PODAT.DayOfMonth AS DayOfProofOfDeliveryDate_PODAT,
  CalendarDateDimension_PODAT.CalQuarter AS QuarterOfProofOfDeliveryDate_PODAT,
  -- ##CORTEX-CUSTOMER If you prefer to use currency conversion, uncomment below
  -- currency_conversion.UKURS AS ExchangeRate_UKURS,
  -- currency_conversion.TCURR AS TargetCurrency_TCURR,
  -- currency_conversion.conv_date AS Conversion_date,
  -- IF(
  --   likp.VBTYP IN ('H', 'K', 'N', 'O', 'T', '6'),
  --   COALESCE(likp.NETWR * currency_decimal.CURRFIX, likp.NETWR) * currency_conversion.UKURS * -1,
  --   COALESCE(likp.NETWR * currency_decimal.CURRFIX, likp.NETWR) * currency_conversion.UKURS
  -- ) AS NetValueOfTheSalesOrderInTargetCurrency_NETWR,
  -- COALESCE(lips.WAVWR * currency_decimal.CURRFIX, lips.WAVWR) * currency_conversion.UKURS AS CostInTargetCurrency_WAVWR,
  -- COALESCE(lips.NETWR * currency_decimal.CURRFIX, lips.NETWR) * currency_conversion.UKURS AS NetValueInTargetCurrency_NETWR,
  -- lips.LFIMG * COALESCE(lips.NETPR * currency_decimal.CURRFIX, lips.NETPR) * currency_conversion.UKURS AS DeliveredNetValueInTargetCurrency,
  IF(
    likp.VBTYP IN ('H', 'K', 'N', 'O', 'T', '6'),
    COALESCE(likp.NETWR * currency_decimal.CURRFIX * -1, likp.NETWR * -1),
    COALESCE(likp.NETWR * currency_decimal.CURRFIX, likp.NETWR)
  ) AS NetValueOfTheSalesOrderInDocumentCurrency_NETWR,
  IF(lips.SHKZG IN ('B', 'S', 'X'), (lips.NTGEW * -1), lips.NTGEW) AS NetWeight_NTGEW,
  IF(lips.SHKZG IN ('B', 'S', 'X'), (lips.BRGEW * -1), lips.BRGEW) AS GrossWeight_BRGEW,
  IF(lips.SHKZG IN ('B', 'S', 'X'), (lips.VOLUM * -1), lips.VOLUM) AS Volume_VOLUM,
  COALESCE(lips.WAVWR * currency_decimal.CURRFIX, lips.WAVWR) AS CostInDocumentCurrency_WAVWR,
  COALESCE(lips.NETWR * currency_decimal.CURRFIX, lips.NETWR) AS NetValueInDocumentCurrency_NETWR,
  DATE_DIFF(likp.WADAT, likp.WADAT_IST, DAY) AS Delivery_Delay,
  COALESCE(
    lips.LFIMG * lips.NETPR * currency_decimal.CURRFIX, lips.LFIMG * lips.NETPR
  ) AS DeliveredNetValue,
  IF(likp.VBTYP IN ('H', 'K', 'N', 'O', 'T', '6') OR lips.SHKZG IN ('B', 'S', 'X'), 'X', '') AS IS_RETURN
FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.lips` AS lips
INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.likp` AS likp
  ON
    likp.VBELN = lips.VBELN
    AND likp.MANDT = lips.MANDT
LEFT JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.currency_decimal` AS currency_decimal
  ON likp.WAERK = currency_decimal.CURRKEY
-- ##CORTEX-CUSTOMER If you prefer to use currency conversion, uncomment below
-- LEFT JOIN
--   `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.currency_conversion` AS currency_conversion
--   ON likp.MANDT = currency_conversion.MANDT
--     AND likp.WAERK = currency_conversion.FCURR
--     AND likp.LFDAT = currency_conversion.conv_date
--     AND currency_conversion.TCURR IN UNNEST({{ sap_currencies }})
-- ##CORTEX-CUSTOMER Modify the exchange rate type based on your requirement
--     AND currency_conversion.KURST = 'M'
LEFT JOIN `{{ project_id_src }}.{{ k9_datasets_processing }}.calendar_date_dim` AS CalendarDateDimension_LFDAT
  ON CalendarDateDimension_LFDAT.Date = likp.LFDAT
LEFT JOIN `{{ project_id_src }}.{{ k9_datasets_processing }}.calendar_date_dim` AS CalendarDateDimension_PODAT
  ON CalendarDateDimension_PODAT.Date = LIKP.PODAT
