length_fieldset_map

The length_fieldset_map function yields the number of elements contained in FIELDSET MAP.

 length_fieldset_map ( MAP_to_be_counted)

The function returns NUMBER that is the number of elements stored in the map.

This function has one parameter:

  • MAP_to_be_counted, MAP of type FIELDSET. A MAP with number of elements to be counted.

An example is provided here.

DATASTRUCTURE DS
  BEGIN
    MAP FIELDSET Test_map
  END

DECLARE struct DEFINED_AS DS

ASSIGN struct.Test_map ["first"].Field := "TRUE"
ASSIGN struct.Test_map ["second"].Field := "FALSE"
ASSIGN struct.Test_map ["third"].Field := "TRUE"
ASSIGN struct.Test_map ["fourth"].Field := "TRUE"
ASSIGN struct.Test_map ["fifth"].Field := "FALSE"
NUMBER length_function_result 

ASSIGN length_function_result := length_fieldset_map (struct.Test_map) 

#
@(length_function_result)
#

When you refer to a MAP element, it results in the creation of that element. The element is created empty.