Your code looks rather ununderstandable to me.
A quick attempt on what you claimed you are trying to do (no guarantee):
generic
type T is private;
type T_Array is array (Integer range <>) of T;
package Dim1_to_2 is
-- type T_Array_2Dim is array (Integer range <>, Integer range <>) of T;
procedure Set (TA: in T_Array; Row, Num_Row, Col, Num_Col: Positive; Value: T)
with Pre => Row in 1 .. Num_Row and Col in 1 .. Num_Col and
Num_Row * Num_col = TA'Length;
end Dim1_to_2;
package body Dim1_to_2 is
type T_Array_2Dim is array (Integer range <>, Integer range <>) of T;
procedure Set (TA: in T_Array; Row, Num_Row, Col, Num_Col: Positive; Value: T) is
TA2: T_Array_2Dim (1 .. Num_Row, 1 .. Num_Col);
for TA2'Address use TA'Address;
begin
if Num_Row * Num_Col /= TA'Length or
Row not in 1 .. Num_Row or Col not in 1 .. Num_Col then
raise Constraint_Error;
end if;
TA2 (Row, Col) := Value;
end Set;
end Dim1_to_2;
with Dim1_to_2;
procedure Ausprobieren is
type A is array (Integer range <>) of Integer;
X: aliased A (-10 .. 10) := (others => 0);
package To_2D is new Dim1_to_2 (Integer, A);
begin
To_2D.Set (X, Row => 2, Num_Row => 7, Col => 1, Num_Col => 3, Value => -1);
for V of X loop
Put_Line (V'Image);
end loop;