cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a dynamic table as variable

Former Member
0 Kudos

Hello,

i have an html page with a table created dynamically and containing some input fields. I would like to use it, after pushin a submit button, to fill an internal table that i'll use to call a function module.

My code looks like this :

Layout


</table><p>
<table id = "visu-table">
    <tr>
        <th>X</th>
        <th>Y</th>
    </tr>
<%
  sort palettes.
  Describe table palettes lines sizePalettes.
  loop at palettes into wa_pal.
  SHIFT wa_pal-matnr LEFT DELETING LEADING '0'.
  cpt = cpt + 1.
%>
<tr>
        <td> <%= wa_pal-matnr%></td>
<%
  Concatenate 'QtePal' cpt into qtePalNb.
%>
        <td> <input type="text" name=<%= qtePalNb.%> size=8 MAXLENGTH=8 value=""></td>
</tr>
<%
  endloop.
%>
</table>
<input TYPE="SUBMIT" VALUE="Enregistrer" NAME="onInputProcessing(go)">
</form>

Eventhandler

OnInputProcessing


CASE event_id.
  WHEN 'go'.
...
CALL Function 'zpall'
  TABLES
    zpal       = zpal
    return         = return.

  WHEN OTHERS.
ENDCASE.

My problem is that i don't really know how to process that table that has an undefined number of lines. (i began by creating the names of the input texts dynamically to differentiate them)

May be is there a better way to do it ?

Anyway, thank you for your time.

Tom

Accepted Solutions (0)

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

in the layout while looping itab and creating the <input fields set a unique Id for each input field and in oninput processing, you can use request->get_form_fields to get all the form field values and then filter them based on the id and fill the itab required to be passed to the FM

Raja