Pulling the tax request and response from SAP
How to find the XML that SAP sent to an external tax engine, and the response it got back, for one document, using the connector’s log reader. Then what to look at first.
By Herb Park, Clarent Technologies
In an SAP system with an external engine, the tax on a document is whatever the engine returned for it. When it is wrong or missing, the request and response tell you whether SAP sent the wrong facts or the engine applied the wrong rule. The steps below use the ONESOURCE Indirect Tax connector for SAP, whose log reader is transaction /IDT/LOG. Other connectors have their own log transactions with similar selection fields.
Open the log reader
Enter /n/IDT/LOG in the command field. You need authorization for the transaction in the right system and client.
Enter the selection
| Field | What to enter |
|---|---|
| Document number | The SAP document number (billing document, accounting document, purchase order). |
| Company code | Always fill this in. The same document number exists in many company codes. |
| Log date | A range around when the issue happened. It keeps the search fast. |
| User name (optional) | For example the interface user that posted the document. |
| Search string (optional) | Text inside the XML, such as a material number or postal code. |
Leave message filtering off so you see every call, then execute (F8).
- Document number: 90012345
- Company code: US01
- Log date from: 2026-10-14
- Log date to: 2026-10-16
- User name:
- Search string:
- Message filtering: Off
- Execute (F8)
- (1) The SAP document number: billing document, accounting document or purchase order.
- (2) Always filled in. The same number exists in other company codes.
- (3) A few days around the issue keeps the search fast.
- (4) Left off, so every call is listed.
Pick the right rows
- Each tax call creates two rows a few seconds apart: the request and the response. You need both.
- Check that document number, company code and date match the issue.
- A document usually has several calls: at order or document creation, at billing, and again at release to accounting or posting. Compare them. A difference between the creation call and the posting call is often the answer.
- If a row shows errors, start there.
- Counter: 4411; Date: 2026-10-15; Time: 08:40:12; Company: US01; Row: Request; Call: Billing; Errors:
- Counter: 4412; Date: 2026-10-15; Time: 08:40:14; Company: US01; Row: Response; Call: Billing; Errors:
- Counter: 4487; Date: 2026-10-15; Time: 09:05:31; Company: US01; Row: Request; Call: Release to accounting; Errors:
- Counter: 4488; Date: 2026-10-15; Time: 09:05:33; Company: US01; Row: Response; Call: Release to accounting; Errors: 1
- 4 rows, 2 calls. Click a counter to open the XML.
- (1) Request and response, two seconds apart. Open both.
- (2) A second call for the same document. Compare its request with the billing request.
- (3) A row with errors. Start here.
Open and save the XML
- Open the row. Click the log counter. The XML opens in a display window.
- Save it. Right-click, choose View Source, and save the file, or select all and copy it into a text file.
- Repeat for the other row of the pair. The request contains
INDATAor a calculation request element; the response containsOUTDATAor a calculation response element.
What to look at first
- Request (INDATA): <INDATA> <INVOICE_DATE>2026-10-15</INVOICE_DATE> <LINE ID="1"> <PRODUCT_CODE>MAT-55021</PRODUCT_CODE> <SHIP_TO> <COUNTRY>US</COUNTRY> <STATE>CO</STATE> <CITY>Denver</CITY> <POSTCODE/> </SHIP_TO> </LINE> </INDATA>
- Response (OUTDATA): <OUTDATA> <SUCCESS>true</SUCCESS> <PARTIAL_SUCCESS>true</PARTIAL_SUCCESS> <LINE ID="1"> <MESSAGE>Address incomplete</MESSAGE> <TOTAL_TAX>0.00</TOTAL_TAX> (no TAX block) </LINE> </OUTDATA>
- (1) Request first: the ship-to has a region and no postal code.
- (2) Both flags are true. The call did not fail, so nothing stopped the document.
- (3) The line has no jurisdiction or tax block, so SAP has nothing to post as a tax line.
- Request: ship-from, ship-to and supply addresses (is the region and postal code there?), dates, product codes, the tax code passed in, and any user-defined fields your rules depend on.
- Response: success and partial-success flags, the jurisdiction and tax blocks on each line, the rate, the rule that fired, and the ERP tax code returned.
- A response that is successful and partially successful, with no tax blocks on the lines, is a classic cause of a missing tax line at posting. See the casebook entry.
Then follow Diagnosing an unexpected tax result and, for the SAP side of the flow, How SAP calls an external tax engine.