cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic generation of HTML code

sanju_joseph
Participant
0 Kudos

Hello Experts,

I have a HTML code for displaying and choosing 4 check box in BSP page , there is a separate page where user can decide which check boxes he/she can display out of 4 check boxes , I can write a simple code of if and else to achieve the same , But I am not willing to do that , what exactly I want is to generate a dynamic html code that get generated based on user selection, Well not getting the exact picture of doing that, Any valuable suggestion in this will be highly appreciated .

Thanks

Sanju

Accepted Solutions (0)

Answers (2)

Answers (2)

athavanraja
Active Contributor
0 Kudos

you can generated the html dynamically and store it in a ABAP variable and use it in your layout

but in your case one of the best ways you could handle is store the user selections in an internal table. (which can hold the check box number and an indicator whether that should be rendred or not)

then in the layout write


<% loop at itab into wa where render = 'X'. %>
htmlb:checkbox  id= ....
<% endloop. %>

GrahamRobbo
Active Contributor
0 Kudos

Hi San,

dynamic HTML generation is exactly what the BSP programming model (server-side scripting) is all about.

I don't really understand your specific problem, but you can certainly render HTML based upon the user's input.

Cheers

Graham Robbo