com.sap.conn.jco

## Interface JCoStructure

- All Superinterfaces:
    Cloneable, Iterable<JCoField>, JCoRecord, Serializable

      public interface JCoStructure
      extends JCoRecord

  JCoStructure is for data containers that need a certain layout in memory. Those structures are often defined as parameters in function module parameter lists. Its underlying metadata can also be used for a JCoTable.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JCoRecordFieldIterator` | `getRecordFieldIterator()` Returns an iterator over JCoRecordField.
    `JCoRecordMetaData` | `getRecordMetaData()` Returns the appropriated metadata object, that was used for creation of this record.
    `String` | `getString()` Returns a String containing all fields concatenated to one single String.
    `void` | `setString(String fieldsAsString)` Allows to set all fields of a Structure handed by one single String containing all fields values.

    - ### Methods inherited from interface com.sap.conn.jco.JCoRecord

      `clear, clone, copyFrom, fromJSON, fromJSON, getAbapObject, getAbapObject, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBinaryStream, getBinaryStream, getByte, getByte, getByteArray, getByteArray, getChar, getChar, getCharacterStream, getCharacterStream, getCharArray, getCharArray, getClassNameOfValue, getDate, getDate, getDouble, getDouble, getField, getField, getFieldCount, getFieldIterator, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getShort, getShort, getString, getString, getStructure, getStructure, getTable, getTable, getTime, getTime, getValue, getValue, isInitialized, isInitialized, iterator, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toJSON, toJSON, toXML, toXML, toXML, write, write`

- - ### Method Detail

    - #### getRecordMetaData

          JCoRecordMetaData getRecordMetaData()

      Returns the appropriated metadata object, that was used for creation of this record.
      Returns:
        JCoRecordMetaData instance of the appropriated metadata object

    - #### getRecordFieldIterator

          JCoRecordFieldIterator getRecordFieldIterator()

      Returns an iterator over JCoRecordField.
      Returns:
        JCoRecordFieldIterator instance
      See Also:
        `JCoRecord.iterator()`

    - #### getString

          String getString()

      Returns a String containing all fields concatenated to one single String.

      Note: The JCoStructure must be a flat Structure with only simple char-like fields, such as CHAR, NUM, DATE, TIME. The function mimics a 'c-style memcpy'. If the last field is `TYPE_CHAR`, this method trims all trailing blanks from the returned string. In addition to programming convenience, it should also improve runtime performance compared to fetching each single field one-by-one.

      Returns:
        the value of all fields concatenated as String
      Throws:
        `ConversionException` - thrown if the values could not be converted to a String or the JCoStructure does contain fields any other than CHAR, NUM, DATE, TIME
      Since:
        JCo 3.1.0

    - #### setString

          void setString(String fieldsAsString)

      Allows to set all fields of a Structure handed by one single String containing all fields values.

      Note: The JCoStructure must be a flat Structure with only simple char-like fields, such as CHAR, NUM, DATE, TIME. The function mimics a 'c-style memcpy'. In addition to programming convenience, it should also improve runtime performance compared to setting each single field one-by-one. The function will set all fields 'up to', meaning you can provide a much shorter String to set the first fields. If the String is longer than the internal buffer of all fields, the remaining Substring will be ignored. DATE and TIME values inside the String can contain '-' or ':' as formatter.

      Parameters:
        `fieldsAsString` - the string to set
      Throws:
        `ConversionException` - thrown if the value could not be converted to its internal representation or the JCoStructure does contain fields any other than CHAR, NUM, DATE, TIME
      Since:
        JCo 3.1.0

Copyright © 2020 SAP. All Rights Reserved.