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

Null Values to internal tables

prasad_reddy9
Explorer
2,287

I need to pass Null Value to couple of fields in Internal table and one of them is type i.

Any way to do it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,419

Here is the sample code of it

data :  begin of itab  occurs  0,
          field1(10)  type   c ,
          field2(10) type  i ,
          end of itab.

itab-field1  =  ' '.
itab-field2 = 0.0 .

Append  itab .

reward points if it is usefull...

Girish

Here is the sample code of it

data :  begin of itab  occurs  0,
          field1(10)  type   c ,
          field2(10) type  i ,
          end of itab.

itab-field1  =  ' '.
itab-field2 = 0.0 .

Append  itab .

reward points if it is usefull...

Girish

7 REPLIES 7
Read only

amit_khare
Active Contributor
0 Likes
1,419

For Type CHAR or STRING pass SPACE.

For TYPE I it will be 0.00.

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
1,419

Prasad,

Null value for Char is space and for interger 0.

Read only

Former Member
0 Likes
1,419

HI,

if u r passing null velues to intrnal table type c will be # and type i will be zero's

Regards

Suresh.d

Read only

Former Member
0 Likes
1,420

Here is the sample code of it

data :  begin of itab  occurs  0,
          field1(10)  type   c ,
          field2(10) type  i ,
          end of itab.

itab-field1  =  ' '.
itab-field2 = 0.0 .

Append  itab .

reward points if it is usefull...

Girish

Read only

Former Member
0 Likes
1,419

Hi

Null value for char type is ' ' i.e space

Null value for integer type is 0.

Thanks

Read only

prasad_reddy9
Explorer
0 Likes
1,419

It gives 0 as value for type i.

Using itab-field = 0.0. results in value being shown as 0 rather than Null. Any other suggestion?

Read only

0 Likes
1,419

Hi,

value '0' itself denotes null for integers because if you don't assign anything to it , it will be set to '0'. So, if you want to store null , you will have to change its data type!

Regards,

Sooness