cancel
Showing results for 
Search instead for 
Did you mean: 

CAN A DATAGRID BE CREATED IN JSP FILE - (java web application)

Former Member
0 Kudos

i have used a JCO in netbeans-JSP to create a connection with sap and have retrieved data in a table in the .jsp file.

i want to know whether we can create a grid and bring the data into it, in a jsp as well.

If possible to create a data grid, please give me an example.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Study below given link....

http://www.roseindia.net/jsp/data-grid.shtml

once you manage to create a data grid in JSP....then populating it with rfc data will be a cakewalk for you.....

Former Member
0 Kudos

The process seems to be confusing me.

actually i have established a connection and retrieved data and displayed it in a table.

the code for data display in table is as fillows.

repository = JCO.createRepository("MYRepository", SID);
                        try {
                           // Get a function template from the repository
                           IFunctionTemplate ftemplate = repository.getFunctionTemplate("YABAP_FM4");
                            // Create a function from the template
                            JCO.Function function = new JCO.Function(ftemplate);
                            // Get a client from the pool
                            JCO.Client client = JCO.getClient(SID);
                            JCO.Field fld = function.getImportParameterList().getField("I_KUNNR");
                            fld.setValue(user.getdealer());

                            // We can call 'RFC_SYSTEM_INFO' directly since it does not need any input parameters
                            client.execute(function);
                            // The export parameter 'RFCSI_EXPORT' contains a structure of type 'RFCSI'
                            //  JCO.Structure s = function.getExportParameterList().getStructure("S_VBAK");%>
                    <%
                   JCO.Table tableList = function.getTableParameterList().getTable("T_VBAK");
                    %>
              <TABLE width="auto">  
                <thead >
                 <tr>
 <% for (JCO.FieldIterator fI = tableList.fields();
   fI.hasMoreElements();) {
   JCO.Field tabField = fI.nextField();%>
   <th BGCOLOR ='#154c71' style="color:blanchedalmond" align='center'><font style="font-family: Broadway" size="2">
  <%=(tabField.getName())%></font></th>
  <% }%></tr>
</thead>
</table >
<div style="height: 400px;overflow:auto;overflow-x:hidden;width:auto    ">
<TABLE width="auto">
     <tbody>
     <%if (tableList.getNumRows() > 0) {
  do {%>
<tr>
<% for (JCO.FieldIterator fI = tableList.fields();
   fI.hasMoreElements();) {
JCO.Field tabField = fI.nextField();%>
<td BGCOLOR ="blanchedalmond" style="color:black" align='center'><font style="font-family: Arial Rounded MTarial" size='2' >
<%=(tabField.getString())%>
   <BR></font></td><%}%></tr>
  <%} while (tableList.nextRow() == true);
  }%>
  </tbody>    
</TABLE>
</div>

________________________________

please help me replace the table with datagrid.

Edited by: crimsonnoel on Jul 6, 2011 9:22 AM

Former Member
0 Kudos

I'm trying on various ways in creating a data grid.

please give me a solution.

Will the [data tables|http://www.datatables.net/] work?

Answers (0)