title: Table of all combinations possible with combination id
body: <p>Here come a little ABAP challenge:</p>
  
  <p>For an ABAP projet, i must build from an internal table with 2 columns (example1) another table containing all combinations possibles (example2).
  "X" columns represent the parameter. "Y" represent the parameter value.</p>
  
  <p>example1:</p>
  
  <p>X(param)
      Y(value)</p>
  
  <p>A   a1</p>
  
  <p>A   a2</p>
  
  <p>A   a3</p>
  
  <p>B   b1</p>
  
  <p>B   b2</p>
  
  <p>C   c1</p>
  
  <p>C   c2</p>
  
  <p>In the result table (example2):
  We must get all combinations with a numeric id (on 3 columns).
  The new "z" column represent the combination id. For each combination there is a number of lines equal to the number of dictinct parameters(in our case 3 line for A,B and C).
  "x" column still represent the parameter and "y" column the associated value.</p>
  
  <p>example2:</p>
  
  <p>z(combi num)
      x(param)
      y(value)</p>
  
  <p>1   A   a1</p>
  
  <p>1   B   b1</p>
  
  <p>1   C   c1</p>
  
  <p>2   A   a1</p>
  
  <p>2   B   b1</p>
  
  <p>2   C   c2</p>
  
  <p>3   A   a1</p>
  
  <p>3   B   b2</p>
  
  <p>3   C   c1</p>
  
  <p>4   A   a1</p>
  
  <p>4   B   b2</p>
  
  <p>4   C   c2</p>
  
  <p>etc...
      etc...
      etc...</p>
  
  <p>12  A   a3</p>
  
  <p>12  B   b2</p>
  
  <p>12  C   c2</p>
  
  <p>Another remark is that the number of parameters and the number of values per parameters is not fixed (the initial internal table can evolve a lot and so the combinations possibles).</p>
  
  <p>We maybe need recursion but i'm not sure of it.</p>