SAP Certification
SAP Download
SAP Companies India
SAP Books
SAP JOBS
SAP jobs in India
SAP ABAP jobs in India
SAP BASIS jobs in India
SAP BI jobs in India
SAP CRM jobs in India
SAP FICO jobs in India
SAP Fresher jobs in India
SAP HR jobs in India
SAP MM jobs in India
SAP PM jobs in India
SAP PP jobs in India
SAP SD jobs in India
SAP XI jobs in India
|
CLEAR (ABAP Keyword) introduction & details
Show Full Details
CLEAR
Basic
form CLEAR f.
Additions
1. ... WITH g 2. ... WITH
NULL
Effect Resets the contents of f to its initial value.
For
predefined types (see DATA ), the following initial values are used: Type C :
' ... ' (blank character) Type N : '00...0' Type D : '00000000' Type T :
'000000' Type I : 0 Type P : 0 Type F : 0.0E+00 Type X : 0 If f is a field
string, each component field is reset to its initial value. If it is an internal
table without a header line, the entire table is deleted together with all its
entries. If, however, f is an internal table with a header line, only the
sub-fields in the table header entry are reset to their initial
values.
Example
DATA: TEXT(10) VALUE 'Hello', NUMBER TYPE I
VALUE 12345, ROW(10) TYPE N VALUE '1234567890', BEGIN OF
PLAYER, NAME(10) VALUE 'John', TEL(8) TYPE N VALUE '08154711', MONEY
TYPE P VALUE 30000, END OF PLAYER. ... CLEAR: TEXT, NUMBER,
PLAYER.
The field contents are now as follows:
ROW =
'1234567890' TEXT = ' ' NUMBER = 0 PLAYER-NAME = ' ' PLAYER-TEL =
'00000000' PLAYER-MONEY = 0
Notes When CLEAR references an internal
table itab with a header line, it only resets the sub-fields in the header entry
to their initial values (as mentioned above). The individual table entries
remain unchanged. To delete the entire internal table together with all its
entries, you can use CLEAR itab[] or REFRESH itab . Here, a Note is still
required to explain how to manipulate tables with/without header
lines. Within a logical expression , you can use f IS INITIAL to check that
the field f contains the initial value appropriate for its type. Variables
are normally initialized according to their type, even if the specification of
an explicit initial value (addition " ... VALUE lit " of the DATA statement) is
missing. For this reason, it is not necessary to initialize variables again with
CLEAR after defining them.
Addition 1 ... WITH g
Effect The
field f is filled with the value of the first byte of the field g
.
Addition 2 ... WITH NULL
Effect Fills the field with
hexadecimal zeros.
Note You should use this addition with particular
care because the fields of most data types thus receive values which are really
invalid.
Note Performance CLEAR requires about 3 msn (standardized
microseconds) of runtime to process a field of type C with a length of 10 and
about 2 msn to process a field of the type I. To delete an internal table with
15 fields, it needs about 5 msn.
Show Most Readed SAP Tutorials
Most readed SAP Tutorials
Show Latest Added SAP Tutorials
Latest Added SAP documents
|
"Site covers most of the SAP technical and functional tutorials, articles, interview questions and PDF study materials . List and details of SAP transaction codes ( tcodes ), Tables, report names, Bapi, ABAP programming syntax and keywords are also available in the site.
Information on SAP Certification and training, latest SAP jobs in India, ABAP interview questions are useful for SAP professionals seeking for a career in SAP as a fresher or experienced.ABAP tutorial downloads on BDC, LSMW, BAPI, ALE, IDOC, Smartforms, Sapscripts etc etc are also added.Now you can read from this page about CLEAR (ABAP Keyword)" |