Use CLEAR to reset any variable data object to the initial value appropriate to its type .In a structure, each component is reset individually.In an internal table without a header line, all of the lines are deleted.Use MOVE to copy the contents of one data object to another variable data object.With complex objects, you can either address the components individually or use a "deep copy". If the source and target objects are compatible , the system copies the objects component by component or line by line.If they are not compatible, the system converts the objects as long as there is an appropriate conversion rule.
If you are copying between two structures, and only want to copy values between identically-named fields, you can use the MOVE-CORRESPONDING statement.The conversion mechanisms explained on the following pages apply not only to the MOVE and MOVE CORRESPONDING statements, but also to calculations and value comparisons.Unlike the MOVE statement, when you use WRITE... TO... to assign values, the target field is always regarded as a character field, irrespective of its actual type. WRITE...TO behaves in the same way as when you write output to a list. This allows you to use formatting options when you copy data objects (for example, country-specific date formatting).
If two data types are not compatible but there is a converion rule, the system converts the source object into the type of the target object when you assign values, perform calculations, or compare values.The following pages contain the basic forms of the conversion rules, and examples for the most frequent cases.
If there is no conversion rule defined for a particular assignment, the way in which the system reacts depends on the context in which you programmed the assignment.If the types of the objects involved are defined statically, a syntax error occurs.
DATA: date TYPE d VALUE '19991231', time TYPE t.
SAP web application and business server pages