Extending Inspection Lot Functionality with Custom Objects in SAP S/4HANA Public Cloud

Business Need:

A semiconductor service provider handling customer-owned components needed a more effective way to manage its Quality Assurance (QA) inspection process within SAP. The company services critical parts such as vacuum pipes and chamber components, where every item must undergo detailed inspection before being returned to the customer.

Given the precision involved in semiconductor manufacturing, even minor deviations in parameters like coating thickness, surface roughness, flatness, or particle count can significantly impact the final output. As a result, the inspection process is highly data-intensive, requiring multiple measurement readings to be captured for each characteristic.

For each inspection characteristic, there was a need to record multiple readings—up to 80 entries per characteristic within a single Inspection Lot—making accurate data capture and management essential.

At the end of each inspection cycle, a comprehensive QA report must be generated and shared with the customer as proof of quality compliance. This created a need for a system that could reliably handle large volumes of granular inspection data while maintaining accuracy and traceability.


However, the standard Inspection Results screen in SAP S/4HANA Public Cloud is not equipped to handle this requirement:

  • It does not support capturing such a high number of repeated entries for a single characteristic. 
  • It is not feasible to create a dedicated section within the standard screen to manage these entries in a structured way. 
  • This makes it difficult to handle the required volume of inspection data within the standard process.
As a result, the system fell short in supporting this specific operational need, highlighting the necessity for a scalable and seamlessly integrated approach to manage high-frequency inspection data.

Solution Details

1. Custom Object for Inspection Results

A Custom Business Object is created in SAP S/4HANA Public Cloud to serve as a dedicated data container for storing inspection results. Since the standard inspection result fields are limited, this custom object is built with 80 fields—each field corresponding to one measurement reading (result value) of a specific inspection characteristic within an inspection lot.

Structure of the Custom Business Object:

Each inspection characteristic can have multiple individual measurement readings. Across all characteristics of an inspection lot, the total number of individual result values accumulates. The 80 fields are designed to cover the maximum possible number of result entries across all characteristics.

The custom object fields are mapped as follows:

  • Key fields — Inspection Lot number, Characteristic code, Operation ID — to uniquely identify the inspection context. 
  • Result fields (Info 1 to Info 80) — store the numeric measurement values entered by the user. 
  • Limit fields — Lower Limit and Upper Limit, derived from the characteristic specification. 
  • Status / Metadata fields — WorkCenter ID, Number of Results, and other contextual data.

Custom Object - Master data of Characteristics with respective Inspection Lot

Embedding as a Component in the Standard Screen

Once the custom business object is created, it is exposed as a UI application (Fiori-based) and embedded as a component within the standard Record Inspection Results screen using SAP’s UI extensibility framework.


Process flow:


Step 1 — Access the standard application

The user opens the Record Inspection Results app and searches using the Inspection Lot number to view available records.

Step 2 — Select the inspection lot

The selected inspection lot opens a detailed screen displaying all associated characteristics.

Step 3 — Custom Tab within the Standard Screen

Each characteristic is displayed with tabs such as Specifications, Results, and Attachments. The custom UI is embedded within the same screen as an additional tab labelled “Results – Additional,” allowing users to access it directly alongside the standard tabs.

Step 4 — Entry of inspection values

The embedded interface displays the 80 result fields (Info 1 to Info 80) as input fields. Users enter the required measurement readings directly within this tab.

Step 5 — Data persistence

On saving, the entered values are stored in the custom business object, linked to the corresponding Inspection Lot, Characteristic, and Operation ID.

Standard Application – Record Inspection Results  - Characteristics with Embedded Component

Edit the Custom Object using Embedded Componenet

2. Custom Object for Sales and Inspection Integration

A second custom business object is used to drive report generation. The user creates a record by selecting a Sales Order, enters inspection-related details (Inspected By, Approved By, Notes), and triggers the Get MSO Details action.


This action retrieves:

  • Part information and serial numbers 
  • Characteristic results from the inspection custom object 
  • Report IDs (QA and FQA) from a master data custom object

This object acts as a central structure linking sales data, product line items, and quality inspection results.

The Get MSO Details Action

The core functionality of this object is driven by the “Get MSO Details” action. When triggered, it performs a backend data retrieval that:

  • Reads the Sales Order and identifies associated parts and their details from the Manufacturing Service Order (MSO) in SAP.
  • Retrieves characteristic results from the inspection results custom object linked to the inspection lot.
  • Fetches QA and FQA Report IDs from the master data object. 
All relevant data—header details, parts sub-table, and characteristics sub-table—is populated in a single operation.

Custom Object :  Sales Order with Respective Items and respective results

The characteristics sub-table includes a Select flag (Yes / No) for each characteristic, allowing control over which characteristics and readings are included in the final report. 

Custom Object :  Respective Characteristics with basic information 

Retrieve Sales Order Item Details using Sales Order number:

Snippet ⧉ Copy Code
MODIFY ENTITIES OF zr_qa_report IN LOCAL MODE "Sales Order item creation
                ENTITY ZrQaReport
                UPDATE SET FIELDS WITH VALUE #( ( Salesorder = ls_qa_report-Salesorder
                                                  ZRoot = 'Qa_RepId'
                                                  ZrootFnqa = 'Fqa_RepId'
            ) )
                CREATE BY \_SalesOrderItem
                SET FIELDS WITH
                VALUE #(
                            FOR ls_achieved_item IN lt_achieved_item
                            (
                                Salesorder = ls_achieved_item-i_salesorder
                                %target = VALUE #(
                                                    (
                                                        %cid = ls_achieved_item-i_salesorderitem
                                                        Salesorder = ls_qa_report-Salesorder
                                                        Salesorderitem = ls_achieved_item-i_salesorderitem
                                                        ArchiveDocument = ls_achieved_item-i_archivedocumentid
                                                        DocumentNumber = ls_achieved_item-i_documentnumber
                                                        LinkedSAPObjKey = ls_achieved_item-i_linkedsapobjectkey
                                                        LogicalDocument = ls_achieved_item-i_logicaldocument
                                                        %control = VALUE #(
                                                                                Salesorder = if_abap_behv=>mk-on
                                                                                Salesorderitem = if_abap_behv=>mk-on
                                                                                ArchiveDocument = if_abap_behv=>mk-on
                                                                                DocumentNumber = if_abap_behv=>mk-on
                                                                                LinkedSAPObjKey = if_abap_behv=>mk-on
                                                                                LogicalDocument = if_abap_behv=>mk-on
                                                                          )
                                                    )
                                                 )
                            )
                       )
                MAPPED DATA(lt_create_mapped)
                REPORTED DATA(lt_create_reported)
                FAILED DATA(lt_create_failed).

Report Generation

Once the record is completed and saved, it is used to generate the QA report in Excel:

  • Header fields → customer details, job information, dates, and report IDs
  • Parts sub-table → part-level details including part numbers, serial numbers, shipping quantity, appearance check, recycle time, and images
  • Characteristics sub-table + result values → measurement rows grouped by WorkCenter, including all recorded readings (Info 1 to Info 80)
  • Inspection sign-off fields → Inspected By and Approved By

An Excel VBA integration consumes APIs to retrieve Sales Order details, line items, and mapped characteristic inspection results for report generation.

Excel Report : img1 - having Sales Order and respective items (Quality Results of respective Products)

Excel Report : img2

Excel Report : img3

VBA Script for fetching the Data using API

Snippet ⧉ Copy Code
'Results Details Query
    res_url = "https://my422894-api.s4hana.cloud.sap/sap/opu/odata4/sap/zws_qa_report_o4/srvd_a2x/sap/zui_qa_report_o4/0001/ZC_QA_CHAR?$count=true&$filter=salesorder eq '" & i_SalesOrder & "' and selector eq true and Noofres ne null"
    Set res_http_client = CreateObject("MSXML2.XMLHTTP")
    res_http_client.Open "GET", res_url, False, UserName, Password
    res_http_client.send
    res_response = res_http_client.responseText
    res_responce_code = res_http_client.Status
    
    If res_responce_code = "200" Or res_responce_code = "201" Then
        Set Res_Responce_Json = JsonConverter.ParseJson(res_response)
        If Res_Responce_Json Is Nothing Then
        Else
            res_Count = Res_Responce_Json("@odata.count")
            If res_Count > 0 Then
            Else
                MsgBox "0 Results found for sales order " & i_SalesOrder
                Exit Sub
            End If
        End If
    End If
    'Results Details Query

Technical Architecture

Benefits

  • Overcomes the limitations of the standard Inspection Results screen in SAP S/4HANA Public Cloud without modifying it
  • Supports handling of high-volume inspection entries (up to 80 per characteristic) through the custom object approach
  • Provides a centralized structure by linking inspection data, sales data, and part-level details for reporting
  • Enables structured and automated QA report generation through Excel integration 

Conclusion

The standard SAP S/4HANA Public Cloud inspection process was not sufficient to support the requirement of capturing large volumes of inspection readings within a single inspection lot. By extending the standard process with custom business objects and an embedded UI, the solution enabled structured recording of multiple inspection values directly within the existing inspection workflow. It also established seamless integration between inspection results, sales data, and QA reporting processes.

With automated retrieval of inspection data and Excel-based QA report generation, the solution significantly reduced manual effort and simplified the management of complex inspection records. Overall, the enhancement provided a scalable and efficient approach to handle high-frequency inspection data while improving accuracy, traceability, and operational efficiency across the quality assurance process.

Praveenkumar