‎2007 Aug 05 1:28 PM
Hi All,
Can any one please help me explain how this statement works and what is the function of { literal | INITIAL } .
<b>CONSTANTS myconst TYPE string VALUE { literal | INITIAL }</b> .
‎2007 Aug 05 1:36 PM
Hi,
The statemetn declares a constant whose value cannot be changed in the program. while declaring a constant u have to give a value to it.
For example:
constants c_con type string value 'ABCD'. "here 'ABCD' is a literal
This declares a constant c_con with value 'ABCD'. the value of this variable caanot be changed in the program. It is mandatory to give a value to constant during declaration.
regards,
Navneeth K.
‎2007 Aug 05 1:36 PM
Hi,
The statemetn declares a constant whose value cannot be changed in the program. while declaring a constant u have to give a value to it.
For example:
constants c_con type string value 'ABCD'. "here 'ABCD' is a literal
This declares a constant c_con with value 'ABCD'. the value of this variable caanot be changed in the program. It is mandatory to give a value to constant during declaration.
regards,
Navneeth K.
‎2007 Aug 05 1:40 PM
Hi Navneeth,
Thanks for the explaination, can you tell what will be the value in case when we write INITIAL.
‎2007 Aug 05 2:06 PM
by using initial we can check whether an internal table contains any value or not
see in this example
data: itab like lfa1 occurs 0 with header line.
if not itab[] is initial.
message I000(0) with ' itab contains some values'.
else.
message W000(0) with 'itab is empty'.
endif.
here we are checking the internal table body is empty or not.
i.e., body contains any initial values or not
if it contains intial values means alpha numeric fields are filled by spaces and numeric fields are filled by zeros.
we can achieve this by the statement 'clear itab[].'
if it contains any values other than these that is not intial.
if it is useful for you reward points otherwise leave it
ok bye