Show TOC

Background documentationInterface JCoField Locate this document in the navigation structure

 

Fields can occur in different contexts: Structures and table rows contain fields, and scalar parameters are fields. The previous sections describe how each interface supports methods for accessing or changing the content of a field. Because fields in different contexts have some common features, SAP JCo provides the JCoField interface, which enables generic editing of fields.

The interfaces JCoStructure, JCoTable, and JCoParameterList all contain a getField() method for accessing a field. The JCoField interface itself contains all the getter and setter methods described earlier. This level of abstraction can be very useful if you want to create generic methods for editing fields, irrespective of the origin of the fields. A field of the JCoField interface has metadata such as:

  • Name (method getName())

  • Description (method getDescription())

  • Data type (method getType())

  • Length (method getLength()), and

  • Number of decimal places (method getDecimals())

A field can also contain extended metadata that you can access using method getExtendedFieldMetaData().