Skip to Content
Former Member
Jul 21, 2005 at 12:36 AM

Dynamic Table Creation in BSP for phtmlb dropdown list boxes


Hi All,

I am developing a survey BSP application that pulls in question data from Z tables R/3. One type of question is a dropdown list. For this you must populate a table with the possible answers (below it is t_dd_answers). This is all fine if the dropdown boxes are static as you just define you static number of tables required for the possible and the application will hold all of the values for you when you want to retreive them for further processing.

My issue is that depending on how the questions are configured in R/3 my BSP app does not know how many dropdown boxes there will be on the .htm

Is there a way to dynamically create n different internal tables to hold the possible answers, show them when the .htm is loaded and also be able to retreive the data when the user has made a choice and hit 'save' (or similar).

Code outline is:


loop at t_dropdown into ....

wa_dd_answers-name = wa_dropdown-zansnum.

wa_dd_answers-value = wa_dropdown-zanswer.

append wa_dd_answers to t_dd_answers.


<phtmlb:formLayoutDropDownListBox id = "<%=w_dd_name%>"

label = "<%=wa_questions-zquestxt%>"

table = "<%=t_dd_answers%>"

nameOfKeyColumn = "NAME"

nameOfValueColumn = "VALUE"/>


Ideally I would like to dynamically create t_dd_answers, t_dd_answers1, t_dd_answers2, t_dd_answers3 etc as needed.

Many thanks!