I have one internal table as below. I would like to store new record in to this table if sapce is available in this. For checking the space availability I was doing the below steps.
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
You need to add a flag variable to your table to denote whether or not that set of elements has been used. Set it when loading a row into the array, and then test it to determine how many active elements the table has.
Another method is to set a variable with the element count of elements that have a value.
This method is only applicable if you populate the elements in sequence from the start or end of the array.
The loop testing for values should not go beyond that number. If you are inserting new elements, you should use this value to determine the next empty element, and update the count accordingly.
The count value field should be communicated with the array to all programs accessing the array.