Using BOPF to find relationships between documents in SAP TM

The challenge: locating document links without direct tables

In SAP Transportation Management (TM) there is no single transparent table that tells you which documents are connected. For example, if you want to know which forwarding‑settlement document (customer freight invoice request – CFIR) was created from a particular forwarding order, you won’t find a simple foreign‑key relationship in the database. Freight orders and forwarding orders are stored in abstract structures that are connected to their corresponding settlement documents via business objects instead of traditional table joins. That is why consultants and developers need to use the Business Object Processing Framework (BOPF) and the BOPF tools (BOBF and BOBT) to follow these relationships.

What is the Business Object Processing Framework?

The Business Object Processing Framework (BOPF) is an ABAP framework for modelling and managing business objects in the SAP Business Suite. Instead of writing individual function modules or classes for each database table, BOPF models a complete object (for example, a forwarding order) with its nodes (sub‑objects), associations, actions and queries. It provides a standard API to create, read, update and delete objects and ensures consistent behaviour, validations and determinations. BOPF is modular and separates business logic from the underlying data structure, which makes it ideal for complex TM processes.

Why BOPF instead of tables?

  • BOPF manages lifecycle and behaviour of business objects. It hides complex internal structures and relations behind a stable API.
  • Cross‑BO associations allow you to navigate from one business object to another (for example from a forwarding order to its settlement document). Nodes have association keys which behave like joins.
  • BOPF objects are used by analytical tools such as the PPF and by the TM UI. Therefore, locating and testing relationships via BOPF ensures you are using the same logic as standard TM.

Key TM business objects (BOPFs)

SAP TM exposes many business objects through BOPF. Below is a non‑exhaustive list of some commonly used objects. The first two entries are supported by primary sources; the others are included for completeness from TM experience.

  • TRQ – Forwarding order / Transportation requirement: Used for forwarding orders (FWO) and outbound / inbound transportation requirements.
  • TOR – Transportation order: Represents freight orders, freight units and freight bookings.
  • CFIR – Customer freight invoice request (forwarding‑settlement document): Stores invoices for forwarding orders; used to settle customer charges.
  • SUPPFREIGHTINVREQ – Supplier freight invoice request (freight‑settlement document): Settlement document for freight orders; used to settle carrier charges.
  • FREIGHTAGREEMENT – Freight agreement / Rate sheet: Manages freight agreements and rates for carriers and customers.
  • CHARGE – Transportation charge: Stores charge items calculated during rating and is often accessed as a delegated node in /SCMTMS/TOR.
  • FWO – Forwarding order (legacy object): Earlier releases used /SCMTMS/FWO before TRQ; some implementations still refer to it.
  • TCC_TRNSP_CHRG – Transportation charge calculation: Contains data for charge calculation results.

Note: Many more business objects exist (for locations, business partners, transportation cockpit, etc.). You can explore them using transaction BOBF.

Finding relationships using the BOPF tools

SAP provides two main transactions for exploring BOPF objects and testing relationships:

  1. /BOBF/TEST_UI (also known as BOBT tcode in S/4HANA) – The test UI displays business objects, their nodes, associations and data. According to SAP, it can be used to view freight orders (TOR) or forwarding orders (TRQ) and explore their cross‑BO relationships. You can use it in implementation projects or support to analyse data of a specific document without launching the TM UI.
  2. BOBT – The Business Object Browser in the SAP GUI for S/4HANA. It provides an overview of all registered business objects and allows you to look at their nodes, associations, actions and determinations. BOBT is helpful to explore the meta‑data of each BO and to generate code snippets for ABAP.

Step‑by‑step example

  1. Identify the business objects. In our case we need to link a forwarding order (TRQ) to its customer freight invoice request (CFIR). Make sure you know the keys of the documents (e.g., forwarding order number).
  2. Start the test UI. Run transaction /BOBF/TEST_UI. Select business object /SCMTMS/TRQ and click Start. Use the Query tab to search for your forwarding order instance using a query like FORWARDING_ORDER. Execute the query to load the root node instance.
  3. Explore the associations. Expand the Associations tree on the left. Look for an association pointing to CFIR. In TM the root node ROOT has a cross‑BO association to CUSTFREIGHTINVREQ (CFIR). Click the association; the system navigates to the target node and displays the invoice request.
  4. Test in BOBT (optional). If you are defining functional specifications for an ABAP developer, use transaction BOBT to open business object /SCMTMS/TRQ and drill into its node definitions. Here you can see the available associations (including those to CFIR) and determine which keys need to be passed to the API.
  5. Document your findings. Note the association names and keys. When writing functional specifications, instruct the developer to use the BOPF API (e.g., cl_bo_factory and if_/bobf/bo_srv_manager) to read the TRQ object, follow the association to CFIR and retrieve the invoice document number.

For test, we can use the t-code BOBT, and follow the steps below:

Enter the Object that you need to test (for example: /SCMTMS/TRQ):

Click on path, and choose the Alternative Key, and use some Document number that you have in your hands (like TRQ_ID):

Now, when execute you can see all documents related of this document:

Conclusion

The challenge: locating document links without direct tables

In SAP Transportation Management (TM) there is no single transparent table that tells you which documents are connected. For example, if you want to know which forwarding‑settlement document (customer freight invoice request – CFIR) was created from a particular forwarding order, you won’t find a simple foreign‑key relationship in the database. Freight orders and forwarding orders are stored in abstract structures that are connected to their corresponding settlement documents via business objects instead of traditional table joins. That is why consultants and developers need to use the Business Object Processing Framework (BOPF) and the BOPF tools (BOBF and BOBT) to follow these relationships.

Note: Many more business objects exist (for locations, business partners, transportation cockpit, etc.). You can explore them using transaction BOBF.When working in SAP TM there is no single table that directly links your operational documents (orders) to their settlement documents. Instead, TM relies on the Business Object Processing Framework to model complex relationships. Using transactions /BOBF/TEST_UI and BOBT, you can load a specific object, explore its nodes and follow associations to find related documents. This approach not only helps you understand the data model but also makes it easier to create functional specifications for developers because you know exactly which business object and association to call. Although the list above includes some of the most common TM business objects, many more exist; feel free to explore them with BOBF to understand how they are linked.

Leave a Reply

Your email address will not be published. Required fields are marked *