Here’s a comprehensive solution addressing all three focus areas:
OData Service Configuration:
The root issue is that the standard BOM OData service (API_BOM_DATA) doesn’t automatically handle variant BOM explosion. You need to use the explosion function import with proper parameters:
-
Service activation check (transaction /IWFND/MAINT_SERVICE):
- Verify service API_BOM_DATA is active
- Check that function import ‘ExplodeBOM’ is registered in service metadata
- If missing, regenerate service using /IWFND/GW_CLIENT → Execute → GET $metadata
- Ensure technical service version matches your SAP PLM 2022 support package level
-
Correct OData query structure for variant BOMs:
GET /sap/opu/odata/sap/API_BOM_DATA/ExplodeBOM?
MaterialNumber='100234'&
Plant='1000'&
BOMUsage='1'&
BOMApplication='PP01'&
ConfigurationString='COLOR=RED;SIZE=M;VOLTAGE=220V'
- Authorization requirements:
- Object C_STUE_BER (BOM explosion) with activity 03
- Object S_DEVELOP (configuration access) for variant characteristics
- Service user must have these in role assigned via PFCG
Variant BOM Explosion Logic:
The explosion requires configuration context that standard queries don’t provide:
-
Characteristic-based configuration:
- Query characteristic definitions: GET /sap/opu/odata/sap/API_CONFIGURATION/CharacteristicSet
- Retrieve valid values for material: Filter by MaterialNumber=‘100234’
- Build configuration string format: CHARC1=VAL1;CHARC2=VAL2
- Character limit: 255 chars for ConfigurationString parameter
-
Alternative using configuration profile:
- If you have saved configurations in transaction CU41
- Query: ConfigurationProfile=‘PROFILE_001’ instead of ConfigurationString
- Profile must exist in table CUKB (configuration database)
- More efficient for frequently-used configurations
-
Handling multiple variant conditions:
- Some components have complex selection conditions (e.g., COLOR=RED AND SIZE IN (M,L))
- The OData explosion resolves these automatically based on your configuration string
- Result includes only components matching the provided characteristic values
- Components with no variant conditions (100% items) always appear
SBOM Extraction for Configurable Materials:
For compliance reporting, implement this extraction pattern:
- Full query with $expand for nested components:
GET /sap/opu/odata/sap/API_BOM_DATA/ExplodeBOM?
MaterialNumber='100234'&
Plant='1000'&
ConfigurationString='COLOR=RED;SIZE=M'&
$expand=BOMComponents,BOMComponents/ComponentMaterial
- Response parsing for SBOM data:
{
"d": {
"MaterialBOM": "100234",
"BOMComponents": [
{
"BOMComponentNumber": "0010",
"ComponentMaterial": "MAT-001",
"ComponentQuantity": "2",
"BOMComponentCategory": "L",
"VariantCondition": "COLOR=RED"
}
]
}
}
-
Filter for compliance-relevant components:
- Include: BOMComponentCategory IN (‘L’,‘R’,‘N’) - physical materials
- Exclude: BOMComponentCategory IN (‘T’,‘D’,‘M’) - text/doc/phantom items
- Check field ComponentScrapPercent for waste calculations
- Extract ComponentMaterial for substance data lookup
-
Multi-level explosion for nested assemblies:
- Enable recursive explosion: $expand=BOMComponents($expand=BOMComponents)
- Set explosion depth: Add parameter BOMExplosionLevel=‘99’ for full depth
- Performance consideration: Deep explosions can timeout - limit to level 5 for OData
Implementation Code Pattern:
// JavaScript example for OData query with variant explosion
const bomQuery = {
method: 'GET',
url: '/sap/opu/odata/sap/API_BOM_DATA/ExplodeBOM',
params: {
MaterialNumber: '100234',
Plant: '1000',
ConfigurationString: buildConfigString(characteristics),
$expand: 'BOMComponents'
}
};
function buildConfigString(chars) {
return chars.map(c => `${c.name}=${c.value}`).join(';');
}
Troubleshooting Steps:
- Test explosion in SAP GUI first (transaction CS11 with variant conditions)
- Verify configuration string format matches characteristic names in CAWN table
- Check explosion log in transaction CS12 for any errors
- Enable OData tracing: /IWFND/ERROR_LOG to see backend calls
- Validate that variant conditions in CS02 are properly maintained
Performance Optimization:
- Cache configuration strings for frequently-used variants
- Use batch requests ($batch) when extracting multiple BOMs
- Implement delta extraction based on change documents (table CDHDR)
- Consider custom CDS view with built-in explosion logic for better performance
This solution ensures your SBOM extraction captures all components from variant BOMs by properly configuring the OData service, implementing correct explosion logic, and handling configurable material scenarios for compliance reporting.