Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SAP Pricing, TPO, and Control Points
00:00
5 left

SAP Pricing, TPO, and Control Points

HardSQL · PostgreSQL

Problem

Walk me through routes determination, split analysis for invoice, Mwst in pricing procedure, and TPO details including vendor ask vs automatic restock control.

Use the supplied Accenture procurement data to produce one reconciliation row for every invoice line. Select the latest route and MwSt pricing record, summarize invoice splits, and classify the applicable TPO restock behavior.

Output

  1. One row per invoice line, including lines without a route or split.
  2. Return invoice_id, line_no, route_code, split_total, split_status, mwst_rate, mwst_amount, vendor_request_qty, auto_restock_qty, control_mode, and control_result.
  3. Order by invoice_id, then line_no.

Schema

route_determinations
ColumnTypeDescription
route_idPKINTRoute determination record identifier
order_idINTProcurement order identifier
route_codeVARCHAR(30)Determined logistics route
determination_tsTIMESTAMPTime at which the route was determined
invoice_headers
ColumnTypeDescription
invoice_idPKINTInvoice identifier
order_idINTRelated procurement order
invoice_dateDATEInvoice date
vendor_idINTVendor identifier
invoice_lines
ColumnTypeDescription
invoice_idPKINTInvoice identifier
line_noPKINTInvoice line number
skuVARCHAR(30)Material or product identifier
quantityINTInvoiced quantity
net_amountNUMERIC(12,2)Net invoice amount before tax
invoice_splits
ColumnTypeDescription
split_idPKINTInvoice split identifier
invoice_idINTInvoice identifier
line_noINTInvoice line number
split_quantityINTQuantity assigned to this split
amount_splitNUMERIC(12,2)Amount assigned to this split
pricing_conditions
ColumnTypeDescription
condition_idPKINTPricing condition identifier
invoice_idINTInvoice identifier
line_noINTInvoice line number
condition_seqINTPricing procedure sequence
condition_typeVARCHAR(20)Pricing condition type
mwst_rateNUMERIC(5,2)MwSt percentage rate
tax_amountNUMERIC(12,2)Calculated tax amount
effective_atTIMESTAMPCondition effective timestamp
tpo_controls
ColumnTypeDescription
tpo_idPKINTTPO control record identifier
vendor_idINTVendor identifier
skuVARCHAR(30)Material or product identifier
vendor_request_qtyINTQuantity requested by the vendor
auto_restock_qtyINTQuantity generated by automatic restock
control_modeVARCHAR(25)TPO control mode
control_tsTIMESTAMPControl record timestamp
Tablesroute_determinationsinvoice_headersinvoice_linesinvoice_splitspricing_conditionstpo_controls
Interviewer

Your question is SAP Pricing, TPO, and Control Points. Start with the requirements and the six tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.