A data structure is made up of individual fields and each field is assigned to a particular data type. Because ABAP uses different data types to Java, it is necessary to create a link between these data types (mapping). The table displayed below shows the different data types in ABAP and Java and their mapping.
In most cases, handling of data types does not represent a problem. However, the ABAP data types for date and time have some special features. ABAP has two different data types for processing date and time information:
· ABAP data type T is a 6-byte string with the format HHMMSS.
· ABAP data type D is an 8-byte string with the format YYYYMMDD.
Both data types are used in RFMs (including BAPIs). When a BAPI uses a time stamp two fields are used, one of type D and one of type T.
Java, however, only uses one class (Date) to represent both date and time information. In Java, a time stamp can therefore be displayed in one variable.
SAP JCo automatically performs the conversion between ABAP and Java data types. Fields of the ABAP data types D and T are represented as Java Date objects, whereby the part of the Date object that is not used retains its default value. Java developers need to distinguish between whether a particular field contains an ABAP date or an ABAP time.