Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Plz explain

Former Member
0 Likes
514

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> .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
485

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.

3 REPLIES 3
Read only

Former Member
0 Likes
486

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.

Read only

0 Likes
485

Hi Navneeth,

Thanks for the explaination, can you tell what will be the value in case when we write INITIAL.

Read only

Former Member
0 Likes
485

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