cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP S4HANA Billing Document OData - Pricing Elements No Data

saurabh__khare38
Participant
535

Hi,

We've identified the following OData for our use case. We are on S/4HANA 2022 FPS 02.

Billing Document - Read, Cancel, GetPDF

However, this does not fetch the SD Pricing Data for a given billing document although it is documented in the API reference.

saurkhare_0-1715177314487.png

On further analysis, we found that the Pricing Elements CDS view that this OData uses does not display any data. The base view I_PricingElement that gets its data from prcd_elements has an access control that is designed to never return any data

@EndUserText.label: 'Auto assigned mapping role for I_PricingElement' 
@MappingRole: true 
define role I_PricingElement { 
  grant 
    select 
      on 
        I_PricingElement 
          where 
            PricingDocument is null and PricingDocument is not null; 
}

This is a whitelisted, documented API on the API hub that does not work as expected. Am I missing something?

Regards,

Saurabh

Accepted Solutions (0)

Answers (1)

Answers (1)

Preikian
Explorer
0 Likes

The reason is that the access control of I_PricingElement cds is set to @AccessControl.authorizationCheck: #PRIVILEGED_ONLY In order to access the data, you can use 'with privileged access' keyword in your SQL command like I did below INNER JOIN I_PricingElement WITH PRIVILEGED ACCESS. This is how I solved it right now.