{"record":{"id":"b2d35186cde4bc43","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-field-sapinput","errorCode":null,"errorMessage":"Unable to find field '","messagePattern":"Unable to find field '","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/sap/core/src/main/java/org/pentaho/di/trans/steps/sapinput/SapInput.java","lineNumber":77,"sourceCode":"      return false;\n    }\n\n    if ( first ) {\n      first = false;\n\n      // Determine the output row metadata of this step\n      //\n      data.outputRowMeta = new RowMeta();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n                      metaStore );\n\n      // Pre-calculate the indexes of the parameters for performance reasons...\n      //\n      data.parameterIndexes = new ArrayList<Integer>();\n      for ( SapParameter parameter : meta.getParameters() ) {\n        int index = getInputRowMeta().indexOfValue( parameter.getFieldName() );\n        if ( index < 0 ) {\n          throw new KettleException( \"Unable to find field '\" + parameter.getFieldName() + \"'\" );\n        }\n        data.parameterIndexes.add( index );\n      }\n\n      // Pre-calculate the output fields\n      //\n      data.output = new ArrayList<SAPField>();\n      for ( SapOutputField outputField : meta.getOutputFields() ) {\n        SAPField field =\n          new SAPField( outputField.getSapFieldName(), outputField.getTableName(), \"output_\"\n            + outputField.getSapType().getDescription() );\n        data.output.add( field );\n      }\n    }\n\n    // Assemble the list of input fields for the SAP function execution...\n    //\n    ArrayList<SAPField> input = new ArrayList<SAPField>();","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/sap/core/src/main/java/org/pentaho/di/trans/steps/sapinput/SapInput.java#L59-L95","documentation":"Thrown in SapInput.processRow() while pre-computing parameter indexes: a SapParameter references a fieldName that does not exist in the incoming row stream (indexOfValue returned -1). The transformation aborts because the SAP call cannot map its inputs.","triggerScenarios":"getInputRowMeta().indexOfValue(parameter.getFieldName()) returns -1, i.e. a field configured as a SAP parameter was renamed upstream, removed, or the field name in the SAP step config has wrong case/whitespace.","commonSituations":"Upstream step (e.g. Text File Input, Table Input) changed column names; transformation edited after the SAP parameter list was configured; trailing spaces in the configured field name.","solutions":["Open the SAP Input step and re-select the parameter fields from the current input row structure.","Fix the upstream step so it emits the field name the SAP step expects.","Verify exact spelling/case/trim of field names between the producer step and the SAP parameter list.","Run 'Get Fields' in the SAP Input dialog after changing upstream metadata.","Add a Select Values step to rename/reorder fields before the SAP Input step if needed."],"exampleFix":"// before\nint index = getInputRowMeta().indexOfValue( parameter.getFieldName() );\nif ( index < 0 ) { throw new KettleException(...); }\n// after — trim/case-insensitive lookup\nint index = getInputRowMeta().indexOfValue( parameter.getFieldName().trim() );\nif ( index < 0 ) {\n  for ( int i = 0; i < getInputRowMeta().size(); i++ ) {\n    if ( getInputRowMeta().getValueMeta(i).getName().equalsIgnoreCase(parameter.getFieldName()) ) { index = i; break; }\n  }\n}","handlingStrategy":"validation","validationCode":"// before the SAP Input step, verify all parameter fields exist in the input row\nRowMetaInterface in = transMeta.getPrevStepFields(stepMeta);\nfor ( SapParameter p : meta.getParameters() ) {\n  if ( in.indexOfValue(p.getFieldName()) < 0 ) {\n    throw new KettleException(\"Configured SAP parameter field '\" + p.getFieldName() + \"' missing from input stream\");\n  }\n}","typeGuard":"boolean fieldExists(RowMetaInterface row, String name) {\n  return name != null && row != null && row.indexOfValue(name.trim()) >= 0;\n}","tryCatchPattern":null,"preventionTips":["After changing upstream steps, always re-run 'Get Fields' in the SAP Input dialog.","Avoid manual renaming of fields feeding the SAP step; use Select Values explicitly.","Trim configured field names to prevent whitespace mismatches.","Include the SAP step in metadata-check jobs to catch missing fields early."],"tags":["kettle","sap","row-metadata","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}