Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view C_MassChangeSlsDocRequest.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
CREATE VIEW C_MassChangeSlsDocRequest AS
SELECT
MCCReq.SlsDocMassChangeRequestUUID AS SlsDocMassChangeRequestUUID,
MCCReq.SlsDocMassChgEntityLevel AS SlsDocMassChgEntityLevel,
MCCReq.SDDocumentCategory AS SDDocumentCategory,
MCCReq.SlsDocMassChangeRequestRefUUID AS SlsDocMassChangeRequestRefUUID,
_SalesDocumentHdrNewValue.SDDocumentReason AS SDDocumentReason,
_SalesDocumentHdrNewValue._SDDocumentReason._Text[1:Language = $session.system_language].SDDocumentReasonText AS SDDocumentReasonText,
_SalesDocumentHdrNewValue.SalesOffice AS SalesOffice,
_SalesDocumentHdrNewValue._SalesOffice._Text[1:Language = $session.system_language].SalesOfficeName AS SalesOfficeName,
_SalesDocumentHdrNewValue.SalesGroup AS SalesGroup,
_SalesDocumentHdrNewValue._SalesGroup._Text[1:Language = $session.system_language].SalesGroupName AS SalesGroupName,
_SalesDocumentHdrNewValue.SalesDistrict AS SalesDistrict,
_SalesDocumentHdrNewValue._SalesDistrict._Text[1:Language = $session.system_language].SalesDistrictName AS SalesDistrictName,
_SalesDocumentHdrNewValue.RequestedDeliveryDate AS RequestedDeliveryDate,
_SalesDocumentHdrNewValue.ShippingCondition AS ShippingCondition,
_SalesDocumentHdrNewValue._ShippingCondition._Text[1:Language = $session.system_language].ShippingConditionName AS ShippingConditionName,
_SalesDocumentHdrNewValue.ShippingType AS ShippingType,
_SalesDocumentHdrNewValue._ShippingType._Text[1:Language = $session.system_language].ShippingTypeName AS ShippingTypeName,
_SalesDocumentHdrNewValue.ReceivingPoint AS ReceivingPoint,
_SalesDocumentHdrNewValue.CustomerPaymentTerms AS CustomerPaymentTerms,
_SalesDocumentHdrNewValue._CustomerPaymentTerms._Text[1:Language = $session.system_language].CustomerPaymentTermsName AS CustomerPaymentTermsName,
_SalesDocumentHdrNewValue.PaymentMethod AS PaymentMethod,
_SalesDocumentHdrNewValue.TransactionCurrency AS TransactionCurrency,
_SalesDocumentHdrNewValue._TransactionCurrency._Text[1:Language = $session.system_language].CurrencyName AS CurrencyName,
_SalesDocumentHdrNewValue.PricingDate AS PricingDate,
_SalesDocumentHdrNewValue.BillingDocumentDate AS BillingDocumentDate,
_SalesDocumentHdrNewValue.SalesDocumentDate AS SalesDocumentDate,
_SalesDocumentHdrNewValue.IncotermsClassification AS IncotermsClassification,
_SalesDocumentHdrNewValue._IncotermsClassification._Text[1:Language = $session.system_language].IncotermsClassificationName AS IncotermsClassificationName,
_SalesDocumentHdrNewValue.IncotermsTransferLocation AS IncotermsTransferLocation,
_SalesDocumentHdrNewValue.IncotermsLocation1 AS IncotermsLocation1,
_SalesDocumentHdrNewValue.IncotermsLocation2 AS IncotermsLocation2,
_SalesDocumentHdrNewValue.IncotermsVersion AS IncotermsVersion,
_SalesDocumentHdrNewValue._IncotermsVersion._Text[1:Language = $session.system_language].IncotermsVersionName AS IncotermsVersionName,
_SalesDocumentHdrNewValue.DeliveryBlockReason AS DeliveryBlockReason,
_SalesDocumentHdrNewValue.HeaderBillingBlockReason AS HeaderBillingBlockReason,
_SalesDocumentHdrNewValue.SalesDocumentRjcnReason AS SalesDocumentRjcnReason,
_SalesDocumentHdrNewValue.PurchaseOrderByCustomer AS PurchaseOrderByCustomer,
_SalesDocumentHdrNewValue.CustomerPurchaseOrderDate AS CustomerPurchaseOrderDate,
_SalesDocumentHdrNewValue.CompleteDeliveryIsDefined AS CompleteDeliveryIsDefined,
_SalesDocumentHdrNewValue.CustomerPriceGroup AS CustomerPriceGroup,
_SalesDocumentHdrNewValue._CustomerPriceGroup._Text[1:Language = $session.system_language].CustomerPriceGroupName AS CustomerPriceGroupName,
_SalesDocumentItmNewValue.SalesDocumentItemCategory AS SalesDocumentItemCategory,
_SalesDocumentItmNewValue._ItemCategory._Text[1:Language = $session.system_language].SalesDocumentItemCategoryName AS SalesDocumentItemCategoryName,
_SalesDocumentItmNewValue.Product AS Product,
_SalesDocumentItmNewValue._Product._Text[1:Language = $session.system_language].ProductName AS ProductName,
_SalesDocumentItmNewValue.SalesDocumentItemText AS SalesDocumentItemText,
_SalesDocumentItmNewValue.ProductHierarchyNode AS ProductHierarchyNode,
_SalesDocumentItmNewValue.Batch AS Batch,
_SalesDocumentItmNewValue.Division AS Division,
_SalesDocumentItmNewValue.DeliveryPriority AS DeliveryPriority,
_SalesDocumentItmNewValue._DeliveryPriority._Text[1:Language = $session.system_language].DeliveryPriorityDesc AS DeliveryPriorityDesc,
_SalesDocumentItmNewValue.Plant AS Plant,
_SalesDocumentItmNewValue._Plant.PlantName AS PlantName,
_SalesDocumentItmNewValue.UnloadingPointName AS UnloadingPointName,
_SalesDocumentItmNewValue.StorageLocation AS StorageLocation,
_SalesDocumentItmNewValue._StorageLocation.StorageLocationName AS StorageLocationName,
_SalesDocumentItmNewValue.ShippingPoint AS ShippingPoint,
_SalesDocumentItmNewValue._ShippingPoint._Text[1:Language = $session.system_language].ShippingPointName AS ShippingPointName,
_SalesDocumentItmNewValue.Route AS Route,
_SalesDocumentItmNewValue._Route._Text[1:Language = $session.system_language].RouteName AS RouteName,
_SalesDocumentItmNewValue.ItemBillingBlockReason AS ItemBillingBlockReason,
_SalesDocumentItmNewValue.ExpdDelivQuantityChangeReason AS ExpdDelivQuantityChangeReason,
_SalesDocumentItmNewValue.ReturnReason AS ReturnReason,
_SalesDocumentItmNewValue.CustRetItmFollowUpActivity AS CustRetItmFollowUpActivity,
_SalesDocumentItmNewValue.WBSElementInternalID AS WBSElementInternalID,
cast(' ' as ps_posid_edit ) AS WBSElementExternalID,
cast ( ' ' as ps_s4_post1 ) AS WBSDescription,
_SalesDocumentItmNewValue.MaterialByCustomer AS MaterialByCustomer,
_SalesDocumentItmNewValue.PricingType AS PricingType,
_SalesDocumentItmNewValue.ProfitCenter AS ProfitCenter,
cast(' ' as abap.char( 100 ) ) AS ProfitCenterName,
_SalesDocumentSlnNewValue.ScheduleLineCategory AS ScheduleLineCategory,
_SalesDocumentSlnNewValue.DelivBlockReasonForSchedLine AS DelivBlockReasonForSchedLine,
_SalesDocumentPartNewValue.PartnerFunction AS PartnerFunction,
cast( _SalesDocumentPartNewValue.Partner as kunnr ) AS Customer,
cast( _SalesDocumentPartNewValue.Partner as lifnr ) AS Supplier,
cast( _SalesDocumentPartNewValue.Partner as pernr_d ) AS Personnel,
cast( _SalesDocumentPartNewValue.Partner as parnr ) AS ContactPerson,
_SalesDocumentPartNewValue.PartnerIsDeleted AS PartnerIsDeleted,
_SalesDocumentPartNewValue.AddressID AS AddressID,
_SalesDocumentPartNewValue.BusinessPartner AS BusinessPartner,
_SalesDocumentItmNewValue.AdditionalMaterialGroup1 AS AdditionalMaterialGroup1,
_SalesDocumentItmNewValue._AdditionalMaterialGroup1._Text[1:Language = $session.system_language].AdditionalMaterialGroup1Name AS AdditionalMaterialGroup1Name,
_SalesDocumentItmNewValue.AdditionalMaterialGroup2 AS AdditionalMaterialGroup2,
_SalesDocumentItmNewValue._AdditionalMaterialGroup2._Text[1:Language = $session.system_language].AdditionalMaterialGroup2Name AS AdditionalMaterialGroup2Name,
_SalesDocumentItmNewValue.AdditionalMaterialGroup3 AS AdditionalMaterialGroup3,
_SalesDocumentItmNewValue._AdditionalMaterialGroup3._Text[1:Language = $session.system_language].AdditionalMaterialGroup3Name AS AdditionalMaterialGroup3Name,
_SalesDocumentItmNewValue.AdditionalMaterialGroup4 AS AdditionalMaterialGroup4,
_SalesDocumentItmNewValue._AdditionalMaterialGroup4._Text[1:Language = $session.system_language].AdditionalMaterialGroup4Name AS AdditionalMaterialGroup4Name,
_SalesDocumentItmNewValue.AdditionalMaterialGroup5 AS AdditionalMaterialGroup5,
_SalesDocumentItmNewValue._AdditionalMaterialGroup5._Text[1:Language = $session.system_language].AdditionalMaterialGroup5Name AS AdditionalMaterialGroup5Name,
cast( '' as vbeln_va ) AS SalesDocument,
cast( '' as posnr_va ) AS SalesDocumentItem,
cast( '' as etenr ) AS ScheduleLine
FROM I_SDMassChgCkptMassChgReqBsc AS MCCReq
LEFT OUTER JOIN I_SDMassChgCkptSlsDocHdrChg AS _SalesDocumentHdrNewValue ON SlsDocMassChangeRequestUUID = _SalesDocumentHdrNewValue.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN I_SDMassChgCkptSlsDocItemChg AS _SalesDocumentItmNewValue ON SlsDocMassChangeRequestUUID = _SalesDocumentItmNewValue.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN I_SDMassChgCkptSlsSchdLnChg AS _SalesDocumentSlnNewValue ON SlsDocMassChangeRequestUUID = _SalesDocumentSlnNewValue.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN I_SDMassChgCkptSlsPartChg AS _SalesDocumentPartNewValue ON SlsDocMassChangeRequestUUID = _SalesDocumentPartNewValue.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN I_SDMassChgCkptChgFldList AS _SalesDocumentChgFieldList ON SlsDocMassChangeRequestUUID = _SalesDocumentChgFieldList.SlsDocMassChangeRequestUUID -- association [0..*]
LEFT OUTER JOIN C_SDMassChgCkptChgSlsDoc AS _SalesDocumentSelectionList ON SlsDocMassChangeRequestUUID = _SalesDocumentSelectionList.SlsDocMassChangeRequestUUID -- association [0..*]
LEFT OUTER JOIN C_MassChangeSlsDocReadRequest AS _MassChangeReadRequest ON SlsDocMassChangeRequestUUID = _MassChangeReadRequest.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN C_MassChangeSlsDocCtrlParam AS _MassChangeCntrlParam ON SlsDocMassChangeRequestUUID = _MassChangeCntrlParam.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN E_SDMassChgCkptSlsDocHdrChgBsc AS _HeaderExtension ON SlsDocMassChangeRequestUUID = _HeaderExtension.SlsDocMassChangeRequestUUID -- association [0..1]
LEFT OUTER JOIN E_SDMassChgCkptSlsDocItmChgBsc AS _ItemExtension ON SlsDocMassChangeRequestUUID = _ItemExtension.SlsDocMassChangeRequestUUID -- association [0..1]
;