Creating a selectable HTML table with Sahrepoint list data dind

Hi All,
I m creating an app for sharepoint2013 , on my app I want to read data from SP list and display on something like HTML table/ grid view.
What I have done is as follows.
<table cellpadding="0" cellspacing="0" border="0" class="display" id="TermList">
                    <thead>
                        <tr>
                                    <th>Start Date</th>
                            <th>End Date</th>
                            <th>Term Type(s)</th>
                            <th>Specialty</th>
                            <th width="12%">Sub Specialty</th>
                        </tr>
                    </thead>
                                        <tbody>
                        </tbody>
</table>
var context = SP.ClientContext.get_current();
var user = context.get_web().get_currentUser();
var Termsitems, web, hostcontext, currentusertitle;
var hosturl;
(function () {
$(document).ready(function () {
    gethostdata();
    getUserName();
    $('#TermList').dataTable(
                    "sScrollY": 200,
                        This will enable jQuery UI theme
                    "bJQueryUI": true,
                        will add the pagination links
                    "sPaginationType": "full_numbers"
    getTermdetails();
function gethostdata() {
    hosturl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    context = new SP.ClientContext.get_current();
    hostcontext = new SP.AppContextSite(context, hosturl);
    web = hostcontext.get_web();
    context.load(web, 'Title');
    context.executeQueryAsync(onSiteLoadSuccess, onQueryFailed);
function onSiteLoadSuccess(sender, args) {
    //   alert("site title : " + web.get_title());
function onQueryFailed(sender, args) {
    alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
function getQueryStringParameter(urlParameterKey) {
    var params = document.URL.split('?')[1].split('&');
    var strParams = '';
    for (var i = 0; i < params.length; i = i + 1) {
        var singleParam = params[i].split('=');
        if (singleParam[0] == urlParameterKey)
            return decodeURIComponent(singleParam[1]);
// This function prepares, loads, and then executes a SharePoint query to get the current users information
function getUserName() {
    context.load(user);
    context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);
// This function is executed if the above call is successful
// It replaces the contents of the 'message' element with the user name
function onGetUserNameSuccess() {
currentusertitle= user.get_title();
  $('#message').text('Hello ' + user.get_title());
// This function is executed if the above call fails
function onGetUserNameFail(sender, args) {
    alert('Failed to get user name. Error:' + args.get_message());
function getTermdetails() {
    var Termlist = web.get_lists().getByTitle("TraineeTermsSPlist");
    context.load(Termlist)
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Title" />' +
                             '<Value Type="Text"> + currentusertitle + </Value></Eq></Where></Query></View>');
    Termsitems = Termlist.getItems(camlQuery);
    context.load(Termsitems);
    context.executeQueryAsync(getTermdetailsQuerySuccsess, getTermdetailsQueryFails)
function getTermdetailsQuerySuccsess(sender, args) {
    var listEnumerator = Termsitems.getEnumerator();
    var datatable = document.getElementById("TermList");
    while (listEnumerator.moveNext()) {
        var oListItem = listEnumerator.get_current();
        var startdate = listEnumerator.get_current().get_item('startdate');
        var enddate = listEnumerator.get_current().get_item('Enddate');
        var termtype = listEnumerator.get_current().get_item('TermType');       
        var Specialty = listEnumerator.get_current().get_item('Specialty');
        var Specialty = listEnumerator.get_current().get_item('Subspecialty');
        $("#TermList").append("<tr align='middle'  class='gradeA'>" +
                                  "<td align='left'>" + startdate +
"</td>" +
                                  "<td align='left'>" + enddate + "</td>"
+
                                  "<td align='left'>" + termtype + "</td>"
+
                                  "<td align='left'>" + Specialty +
"</td>" +
                                  "<td align='left'>" + Specialty +
"</td>" + "</tr>");
function getTermdetailsQueryFails(sender, args) {
    alert(' Error:' + args.get_message());
Now what I want to do is allow user to select rows on the table. Once they select a row I want to get that selected row and search SP list based on the selected value.  Also I would like to make this table with search area to search records.
Can someone please help me to do this, or are there any easy way to do this. Sample code or useful link much appreciate.
Thank you very much.
d.n weerasinghe

Instead of writing in dive each and every time directly,
just have a div in html, and inside the while loop
write and store in the variable like
  output += "<li><a href='#' style='display:none'>" + usernames[i] + " </a> "
                     + "<table id='results' width='100%'>"
                     + "
<tr style='border-bottom:1px silver solid;'>"
                     + "
<td style='width:60px;height:70px;' >"
                     + "
<img alt=\"profile pic\" src= '" + pictureuri[i] + "'  style='width:60px;height:60px;'/>"
                     + "
</td>"
                     + "
<td >"
                     + "
<table style='height:100%'>"
                     + "
<tr>"
                     + "
<td style='padding-padding-vertical-align:top;height:10px' >"
                     + "
<a href='" + personaluri[i] + "' classq='ms-bold ms-subtleLink' style='color: gray; font-size: 12px; font-weight: bold;'>" + tempnames[i] + "</a>"
                     + "
</td>"
                     + "
</tr>"
                     + "
<tr>"
                     + "
<td  style='padding-vertical-align:top;height:50px;color:#ADAEAD;font-size:14px;' >" + deptNames[i]
                     + "
</td>"
                     + "
</tr>"
                     + "
</table>"
                     + "
</td>"
                     + "
</tr>"
                     + "</table>"
                     + "</li>"
and finaly oyutside the loop 
$(#div).html(output);

Similar Messages

  • Find hidden column value in a dynamacally bind html table with Sharepoint list - Javascript

    I have following code. Now I want to get the hidden column value based on user selected row. I also want to highlight the entire row, not only the e.target.
    Can someone please help me.
    function getTermdetailsQuerySuccsess(sender, args) {
    var listEnumerator = Termsitems.getEnumerator();
    var datatable = document.getElementById("TermList");
    while (listEnumerator.moveNext()) {
    var oListItem = listEnumerator.get_current();
    //var firstName = listEnumerator.get_current().get_item('Title');
    //var secondName = listEnumerator.get_current().get_item('LastName');
    var termID = listEnumerator.get_current().get_item('ID');
    var startdate = listEnumerator.get_current().get_item('startdate');
    var enddate = listEnumerator.get_current().get_item('Enddate');
    var termtype = listEnumerator.get_current().get_item('TermType');
    var Hours = listEnumerator.get_current().get_item('Hours');
    var EdNone = listEnumerator.get_current().get_item('EdNoned');
    var Specialty = listEnumerator.get_current().get_item('Specialty');
    var Subspecialty = listEnumerator.get_current().get_item('Subspecialty');
    var Hospital = listEnumerator.get_current().get_item('Hospital');
    var DEMT = listEnumerator.get_current().get_item('DEMT');
    var Supervisor = listEnumerator.get_current().get_item('Supervisor');
    rowcount = rowcount + 1;
    $("#TermList").append("<tr style='border-bottom:1px silver solid' align='middle' class='gradeA'>" +
    "<td align='left' style='display:none'>" + termID + "</td>" +
    "<td align='left'>" + startdate + "</td>" +
    "<td align='left'>" + enddate + "</td>" +
    "<td align='left'>" + termtype + "</td>" +
    "<td align='left'>" + Hours + "</td>" +
    "<td align='left'>" + EdNone + "</td>" +
    "<td align='left'>" + Specialty + "</td>" +
    "<td align='left'>" + Subspecialty + "</td>" +
    "<td align='left'>" + Hospital + "</td>" +
    "<td align='left'>" + DEMT + "</td>" +
    "<td align='left'>" + Supervisor + "</td>" +
    "</tr>");
    $('#TermList').click(function (e) {
    var tr = $(e.target).parent().index() ;
    alert(tr);
    alert($(e.target).text()); // using jQuery
    // var Cells = tr.e.getElementsByTagName("td");
    $(e.target).addClass('row-highlight');
    var confirmationM = confirm("Do you want to edit this term deatils ?");
    if (confirmationM == true) {
    confirmation = "You pressed OK!";
    else {
    confirmation = "You pressed Cancel!";
    $(e.target).removeClass('row-highlight');
    $('#TermList').click(function (e) {
    var tr = $(e.target).parent().index() ;
    alert(tr);
    alert($(e.target).text()); // using jQuery
    // var Cells = tr.e.getElementsByTagName("td");
    $(e.target).addClass('row-highlight');
    var table = $("#TermList")[0];
    var cell = table.rows[tr].cells[1];
    alert(cell);
    var confirmationM = confirm("Do you want to edit this term deatils ?");
    if (confirmationM == true) {
    confirmation = "You pressed OK!";
    else {
    confirmation = "You pressed Cancel!";
    $(e.target).removeClass('row-highlight');
    d.n weerasinghe

    Hi,
    According to your post, my understanding is that you want to customize a table to display the list items.
    We can write CSS to customize the table style(background color, highlight, hover).
    The following is an example for your reference:
    Code:
    <style>
    #TermList table {
    border-collapse: collapse;
    margin-bottom: 2em;
    width: 100%;
    background: #fff;
    #TermList td, th {
    padding: 0.75em 1.5em;
    text-align: left;
    #TermList th {
    background-color: #31bc86;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    #TermList tbody tr:nth-child(2n-1) {
    background-color: #f5f5f5;
    transition: all .125s ease-in-out;
    #TermList tbody tr:hover {
    background-color: rgba(129,208,177,.3);
    #TermList .HiddenColumn {
    display:none;
    </style>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(getAllListItems, "sp.js");
    $("#TermList tbody").click(function(e){
    //get hidden column value
    var hiddenColumn=$(e.target).parent().find(".HiddenColumn").text();
    alert(hiddenColumn);
    function getAllListItems(){
    var listName="CustomList01";
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getByTitle(listName);
    var query = SP.CamlQuery.createAllItemsQuery();
    allItems = list.getItems(query);
    context.load(allItems);
    context.executeQueryAsync(Function.createDelegate(this, this.getSuccess), Function.createDelegate(this, this.failed));
    function getSuccess() {
    var ListEnumerator = this.allItems.getEnumerator();
    while (ListEnumerator.moveNext()) {
    var currentItem = ListEnumerator.get_current();
    var itemID=currentItem.get_item("ID");
    var name=currentItem.get_item("Title");
    var email=currentItem.get_item("Email");
    $("#TermList tbody").append('<tr><td class="HiddenColumn">'+itemID+'</td><td>'+name+'</td><td>'+email+'</td></tr>');
    function failed(sender, args) {
    alert("failed. Message:" + args.get_message());
    </script>
    <table id="TermList">
    <thead>
    <tr>
    <th>Name</th>
    <th>Email</th>
    </tr>
    </thead>
    <tbody>
    </tbody>
    </table>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Ora-20001 when creating a form on table with report (bug?)

    Having some trouble creating a "Form on table with report".
    1) I pick my table
    2) take most of the defaults on the page where you pick the report type (interactive) and the page number (I changed it to 950). next->
    3) Do not use tabs. Next->
    4) Select all columns for the report. THEN (here's the problem) set an optional where clause of system_role_name like 'ODPSPOPUP%'. Next->
    5) choose standard edit link. next->
    6) Specify a page of 951 for the form (leave others defaults). next->
    7) Set the form primary key (defined in table). next->
    8) use existing trigger. next->
    9) choose all columns for the form. next->
    10) Leave actions to insert, update, delete. next->
    11) Get to the summary page and click Finish
    Then I get an error page saying:
    ORA-20001: Unable to create query and update page. ORA-20001: Unable to create query and update page. ORA-00933: SQL command not properly ended
    If I go back to step 4 and erase my where clause the wizard completes successfully.
    Also if I change the report type in step 2 from the default of "Interactive" to "Classic" the wizard completes successfully. However upon running the report I get a query parse error. Looks like the where clause in the report sql is: system_role_name like ''ODPSPOPUP%'' (two single quotes on each side).
    It looks as if you cannot specify a where clause with a quoted string. The wizard is expecting a bind variable.
    Workaround(s):
    1) Don't specify a where clause when report type = Interactive in "create form on table with report" wizard.
    or
    2) Specify a bogus where clause using bind variable syntax such as "system_role_name like :BOGUSVARIABLE". Then edit the report query once the wizard finishes and change the where clause to the constant string you wanted to use in the wizard (e.g. "system_role_name like 'MYSYSTEM%'")
    Apex: 3.2.0.00.27
    Database: Oracle Database 11g Enterprise Edition 11.1.0.7.0 64bit Production (Oracle EL5)

    Andy,
    It's a bug, all right. Thanks for the detailed problem description. We'll fix it when we can.
    Scott

  • Webdynpro table with dropdow list

    hi experts,
    i wanna webdynpro table rows have their dropdow list,and each row have it's own list values
    how can i do
    best regards
    zlf

    Hi,
    I hope you already have a Solution, if not try the following:
    1-Create a node"table"(0-n) in the context_View
    2-Create 2 attribute in this node.
      - The first"List_atr" to show the list
      - The second "save_atr" to save the value selected from the list
    3- Create a Table in the Layout_View, bind it dateSource to the node"table" in context_view
    3.1- Add a Column in the Table (Layout_View),
         + add a TableCelEditor "DropDownByKey" elt to this Column,
         + bind the "selectedKey" of this Elt to  the first"List_atr" in the node"table" in the context Node
         + Add a eventhandler(method)"onvalSelected" to the Events "onSelect" of this elt
    3.1-implement the method "onvalSelected"
        here tel ur view ctrl to save the value selected in the second "save_atr" in the context_View
    example code:
               wdContext.currentTableElement().setsave_atr( wdContext.currentTableElement().getshow_atr());
    So if you know how to populate the first "show_atr" with some list, coo. So if the user selected one value in the dropdown list, the method will save it in the cell of the table row and so on for each rows.
    If you have another questions just asked.
    Best Regards
    Glap

  • Selection in table with Master Column

    Hi,
    can anybody explain me how selection works in table with MasterColumn (TreeByNestingTableColumn)?
    I've created a table with several columns and the "master" one behaves differently from others.
    First of all, leaf elements of master column are not clickable (i.e. I don't receive notification "onLeadSelect" from the table, when user clicks in the cell of leaf element of the column). With expandable elements I receive loadchildren event and can react on selection.
    I'm using TextView as cell editor, will try LinkToAction, may be it will resolve situation, but it's rather workaround as solution
    Second, getLeadSelection doesn't work anymore for the table - it works with indexes of top level elements only.
    However onLeadSelect action brings me selected row number, which I somehow should map to the tree.
    I.e. when I get "25" as selected element, I recursively traverse context node to find 25th element. Which is rather slow operation as for any selection I have to reiterate whole structure and I hope that visual appearance is similar to context element order.
    May be there is simplier ways to get selected element by its index in "flat" list?
    And one another strange thing: first click on the table sends me onLeadSelect "0", but highlight points to the element user clicked - not necessary first one.
    Context node is "single" selection, initLeadSelect=true,
    selection = 0..1 (with 1..1 setTreeSelection doesn't work - method I want to use to be able to select a node in hierarchy on my own)
    all quite similar to other tables I have, which works well. Just the problems with the table, where Master Column is used.
    Thank you!
    Best regards,
    Nick

    >Valery's proposal was to perform reverse traverse from current element to root and summarize parent element indexes.
    It seems to work:
    in method, which sets selection I applied
    // we need to know index of the element not in whole context, but in scope of table-relevant node
    int index = getIndexInContext(selElement, wdContext.currentXXXElement());
    IContextElement curContext = wdContext.currentContextElement();
    int firstVisibleRow = curContext.getTableFirstVisibleRow();
    int visibleRows = curContext.getTableVisibleRows();
    if (index < firstVisibleRow || index > firstVisibleRow + visibleRows) {
    curContext.setTableFirstVisibleRow(index);
    and method getIndexInContext looks as:
        private int getIndexInContext (IWDNodeElement element, IWDNodeElement root) {
              int index = element.index();
              if (element == root) {
                   return index;
              IWDNodeElement parent = element.node().getParentElement();
              if (parent == null) {
    // do whatever you like here for error diagnostic
                   myMsgMgr.reportException("Internal Error: getIndexInContext - element is not under passed root", false);
                   return 0;
              // +1 - every level adds 1 (otherwise indexes of first children of hierarchy will be 0)
              return  index + getIndexInContext(parent, root) + 1;
    Best regards,
    Nick

  • HTML Table with alternative row color, Using SQL XML

    Hi,
    I want to send out an email and the email body contains a table with data. I am using SQL to create the HTML table and to populate values inside the table. Below is the code I have so far
    DECLARE
    @HTML NVARCHAR(MAX)
    IF (SELECT
    COUNT(*)
    from Employee])
    != 0
    Begin
    SET
    @HTML =
    '<html><style>
          tr:nth-of-type(even) {
          background-color:#ccc;
    </style><body><h1 style="font-family:Tahoma; font-size:12px;">Hi,</h1>'
    +
    'Below is the report'+
    '<br></br>'+
    '<table border="1" width="100%" style="border:1px solid #77bfe4;font-family:Tahoma; font-weight:normal; font-size:12px;" cellpadding="4" cellspacing="0">'
    +
    '<tr bgcolor="yellow" style="font-family:Tahoma; font-weight:bold; font-size:12px;"><td colspan="2"><center>Report</center></td></tr>'+
    '<tr bgcolor="Blue" style="font-family:Tahoma; font-weight:bold; font-size:12px;"><td><center>Col1</center></td><td><center>col2</center></td></tr>'
    +
    CAST((
    Select
    td =
    col1, '',
    td
    = col2
    , '' from
    (Select ID as col1, Emp as Col2
    from
    Employee) E
    FOR XML
    PATH('tr'),
    TYPE
    AS NVARCHAR(MAX))
    + '</table><br>Thank you</br></body></html>'
    END
    select
    ISNULL(@HTML,'NoEmail')
    But I am having trouble generating alternative colors for each row (tr:nth-of-type(odd) is not working for me)
    Below is what the table should look like 
    Please help.
    Thank you for your help in advance. 

    Thank you for the response, I got the code to work.
    DECLARE @HTML NVARCHAR(MAX) ;
    IF (SELECT COUNT(*) from Employee]) != 0
    Begin
    SET @HTML = '<h1 style="font-family:Tahoma; font-size:12px;">Hi,</h1>' +
    'Below is the report'+
    '<br></br>'+
    '<table border="1" width="100%" style="border:1px solid #77bfe4;font-family:Tahoma; font-weight:normal; font-size:12px;" cellpadding="4" cellspacing="0">' +
    '<tr bgcolor="yellow" style="font-family:Tahoma; font-weight:bold; font-size:12px;"><td colspan="2"><center>Report</center></td></tr>'+
    '<tr bgcolor="Blue" style="font-family:Tahoma; font-weight:bold; font-size:12px;"><td><center>Col1</center></td><td><center>col2</center></td></tr>' +
    CAST(( SELECT CASE when (ROW_NUMBER() over (Order by Col1 DESC))%2 = 0 then '#E0E0E0' else 'white' END as "@bgcolor", '',
    td = col1, '',
    td = col2 , '' from
    (Select ID as col1, Emp as Col2
    from Employee) E
           FOR XML PATH('tr'), TYPE
    ) AS NVARCHAR(MAX)) + '</table><br>Thank you</br></body></html>'
    END
    select ISNULL(@HTML,'NoEmail')

  • How to select column dynamically with sharepoint list as data source in ssrs report

    Hi all,
    I am creating reports from SharePoint list but i have requirements to select the column name dynamically with SharePoint list as data source. I didn't find any way of doing this.. 
    Can anyone help me to resolve this issue..
    There is no way of specifying column name dynamically here in data set query
    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>test list</ListName>
      <ViewFields>
        <FieldRef Name="ID" />
        <FieldRef Name="ContentType" />
        <FieldRef Name="Title" />
        <FieldRef Name="Modified" />
        <FieldRef Name="Created" />
        <FieldRef Name="Author" />
        <FieldRef Name="Editor" />
        <FieldRef Name="_UIVersionString" />
        <FieldRef Name="Attachments" />
        <FieldRef Name="Edit" />
        <FieldRef Name="LinkTitleNoMenu" />
        <FieldRef Name="LinkTitle" />
        <FieldRef Name="DocIcon" />
        <FieldRef Name="ItemChildCount" />
        <FieldRef Name="FolderChildCount" />
        <FieldRef Name="test_x0020_date" />
        <FieldRef Name="title2" />
      </ViewFields>
    </RSSharePointList>

    Hi MNRSPDev,
    Sorry for the delay.
    According to the current description, I understand that you want to specify column name in dataset query designer dynamically when using SharePoint list data source.
    Based on my research, this is not supported by default. As a workaround, you can use XML data source. The XML content can be embedded directly within the query. This lets you use the expression capabilities within the processing engine to build queries and
    data dynamically within the report. And it can be used for retrieving XML data directly from an external data source, passing it using parameters, and embedding it within the query.
    Reference:
    http://www.codeproject.com/Articles/56817/Dynamic-Reports-with-Reporting-Services
    Hope this helps.
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

  • How  to Implement a Chained Hash Table with Linked Lists

    I'm making a migration from C/C++ to Java, and my task is to implement a Chained Hash Table with a Linked List. My problem is to put the strings(in this case names) hashed by the table using de Division Metod (H(k)= k mod N) in to a Linked list that is handling the colisions. My table has an interface implemented(public boolean insert(), public boolean findItem(), public void remove()). Any Help is needed. Thanks for everyone in advance.

    OK. you have your hash table. What you want it to do is keep key/value pairs in linked lists, so that when there is a collision, you add the key/value pair to the linked list rather than searching for free space on the table.
    This means that whenever you add an item, you hash it out, check to see if there is already a linked list and if not, create one and put it in that slot. Then in either case you add the key/value pair to the linked list if the key is not already on the linked list. If it is there you have to decide whether your requirements are to give an error or allow duplicate keys or just keep or modify one or the other (old/new).
    When you are searching for a key, you hash it out once again and check to see if there is a linked list at that slot. If there is one, look for the key and if it's there, return it and if not, or if there was no linked list at that slot, return an error.
    You aren't clear on whether you can simply use the provided linked-list implementations in the Java Collections or whether you have to cobble the linked list yourself. In any case, it's up to you.
    Is this what you're asking?
    Doug

  • How to create dom treeof html page with java

    hi, all
    i met with a problem how to create dom tree of html page wih jave, that is, given a html page, how to create a dom tree of this page with java?
    thanks in advance.
    regards
    richard

    but i m using this code to create node in html file
    HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
    Text txt = appHTML.createTextNode(name);
    li.appendChild(txt);
    appHTML.getElementById("name").appendChild(li);
    this will display all name value which is coming from database,
    and i want to assign a hyperlink to it,
    I have id with name also so I thought that using id i will
    create javascript like
    function popup(id)
         if(id==1)
              var n1 = window.open("../list/name1.html");
         if(id==2)
              var n1 = window.open("../list/name2.html");
    this way i want to popup particular file if i can pass id value in this function
    so want hyperlink like
    name

  • How to create a ms-access table with java?

    hi all
    i've my application and i want to add the capability to creat an access file (.mdb) and then, via SQL , create a table, with many columns of many types, and with a primary key too.
    i know that it's also an SQL problem, but i'm searching for it everywhere
    thanx for your reply
    sandro

    Hi,
    It would have been much better if you had specified your development environment- the database driver class depends on which environment you are working with. Forexample, if you are working with vj++6 you can make use of the com.ms.jdbc.odbc.JdbcOdbcDriver class. If you are using IBM's Visual Age for Java3.5 you can find the sun.jdbc.odbc.JdbcOdbcDriver. Oneway or another you should have the .class for jdbc-odbc(usu they have the form: xxx:jdbc:odbc:JdbcOdbcDriver). Check all the packages that are available in your development environment that have the form xxx.jdbc.odbc.JdbcOdbcDriver.(And not clear what you know and what you don't - so I start from the very elementary steps)
    Anyways, What you have to know is that it is not possible to create databases (e.g. .mdb) directly from a Java application(as far as I know). What is possible is to create new tables inside an already created database and process queries based on those tables.In short what I am saying is : you need to have a DSN before writing applications that create tables.
    Follow the following steps to create DSN(for win2000):
    1)Go to the control panel and click the 'administrative tools'
    2)In the 'administrative tools' click to open ODBC(data sources)
    3)Click the 'add' button and choose 'Microsoft Access driver'
    4)In the DSN text field enter the dsn (e.g., Test)
    5)If you want to create a table in an already existing database choose select and select one. However, if you want to create a new database click 'create' and enter a name for your database(e.g. ExampleDB.mdb). If you do this successfully it will issue a successfull operation message.
    6)Click advanced and enter the login name(e.g. Albert) and password(e.g. mxvdk) for the database
    7)Click 'ok's to finish the operation.
    After the above three operations what you will have is an empty database(with no tables) named "ExampleDB.mdb" in the directory you specified.
    Now, you can write a java application that creates a table inside the database "ExampleDB.mdb".
    Check this out:
    import java.sql.*;
    public class Class1{
    public Class1(){
    String userName = "Albert";
    String password = "mxvdk";
    String dsn = "Test";
    String databaseURL = "jdbc:odbc:"+dsn;
    //This is just an sql table creating statement- have nothing to do with java
    String sqlCreateStmt = "CREATE TABLE StudentTable" +
    "(StudentID varchar(32) PRIMARY KEY," +
    "name varchar(30)," +
    "age int)";
         try{
         Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
         }catch(ClassNotFoundException eCNF){
              System.err.println("ClassNotFoundException:");
              System.err.println(eCNF.getMessage());
         try{
         con = DriverManager.getConnection(databaseURL,userName,password);
         stmt = con.createStatement();
         stmt.executeUpdate(sqlCreateStmt);
         }catch(SQLException e){
    System.err.println("SQLException:");
    e.printStackTrace();
         //insert one sample data
    insertSampleData();
    private void insertSampleData(){
         String sampleStudentID = "scr-342-tch";
         String sampleStudentName = "Tom James";
         int sampleStudentAge = 24;
    //This is just an sql table updating statement- have nothing to do with java
         String sqlUpdateStmt = "INSERT INTO StudentTable VALUES ('"+
                             sampleStudentID+"','"+
                             sampleStudentName+"',"+
                             sampleStudentAge+")";
         try{
              stmt.executeUpdate(sqlUpdateStmt);
              }catch(SQLException e){
              System.err.println("SQLException:");
              e.printStackTrace();
    public static void main(String[] args){
    new Class1();
    private Connection con;
    private Statement stmt;
    //This program runs perfectly in my VJ++6.0 (console application mode) and also in my IBM's
    //visual Age for Java3.5 (with sun.jdbc.odbc.JdbcOdbcDriver as my database driver)
    //If you are developing in another development environment, what you need to change is the
    //"com.ms.jdbc.odbc.JdbcOdbcDriver" in Class.forName("com...") stmt.
    //If you run this program more than once, it will issue 'tableAlreadyExists' message
    If you still experience the problem, pls be specific and repost!

  • Select on table with 1800 rows is slow

    I have a table with 1800 rows. Each entry has a geometry position and a geometry polygon around the position. I am using the polygon to detect which (other) entries are near the current entry.
    In the following testdata and the subsequent query, i am filtering on 625 (of 1865) rows, and then using the .STContains-method to finding other rows (the testdata is fully found by this query, in the live database the values are not so regular as in the testdata.
    The query take 6500 ms. In the live database, only 800 records are (yet) in the table, and it takes 2200 ms. 
    select SlowQueryTable.id
    from SlowQueryTable
    inner join dbo.SlowQueryTable as SlowQueryTableSeen
    on SlowQueryTable.[box].STContains(SlowQueryTableSeen.position) = 1
    where SlowQueryTable.userId = 2
    (The query in the live system is even more complex, but this is main part of it and even simplified as it is just takes too long).
    This script generates test data and runs the query:
    -- The number table is just needed to generate test data
    CREATE TABLE [dbo].[numbers](
    [number] [int] NOT NULL
    go
    declare @t table (number int)
    insert into @t select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9
    insert into numbers
    select * from
    select
    t1.number + t2.number*10 + t3.number*100 + t4.number*1000 as x
    from
    @t as t1,
    @t as t2,
    @t as t3,
    @t as t4
    ) as t1
    order by x
    go
    -- this is the table which has the slow query. The Columns [userId], [position] and [box] are the relevant ones
    CREATE TABLE [dbo].SlowQueryTable(
    [id] [int] IDENTITY(1,1) NOT NULL,
    [userId] [int] NOT NULL,
    [position] [geometry] NOT NULL,
    [box] [geometry] NULL,
    constraint SlowQueryTable_primary primary key clustered (id)
    create nonclustered index SlowQueryTable_UserIdKey on [dbo].SlowQueryTable(userId);
    --insert testdata: three users with each 625 entries. Each entry per user has its unique position, and a rectangle (box) around it.
    -- In the database in question, the positions are a bit more random, often tens of entries have the same position. The slow query is nevertheless visible with these testdata
    declare @range int;
    set @range = 5;
    INSERT INTO [dbo].SlowQueryTable (userId,position,box)
    select
    users.number,
    geometry::STGeomFromText('POINT (' + convert(varchar(15), X) + ' ' + convert(varchar(15), Y) + ')',0),
    geometry::STPolyFromText('POLYGON ((' + convert(varchar(15), X - @range) + ' ' + convert(varchar(15), Y - @range) + ', '
    + convert(varchar(15), X + @range) + ' ' + convert(varchar(15), Y - @range) + ', '
    + convert(varchar(15), X + @range) + ' ' + convert(varchar(15), Y + @range) + ', '
    + convert(varchar(15), X - @range) + ' ' + convert(varchar(15), Y + @range) + ','
    + convert(varchar(15), X - @range) + ' ' + convert(varchar(15), Y - @range) + '))', 0)
    from (
    select
    (numberX.number * 40) + 4520 as X
    ,(numberY.number * 40) + 4520 as Y
    from numbers as numberX
    cross apply numbers as numberY
    where numberX.number < (1000 / 40)
    and numberY.number < (1000 / 40)) as positions
    cross apply numbers as users
    where users.number < 3
    CREATE SPATIAL INDEX [SlowQueryTable_position]
    ON [dbo].SlowQueryTable([position])
    USING GEOMETRY_GRID
    WITH (
    BOUNDING_BOX = ( 4500, 4500, 5500, 5500 ),
    GRIDS =(LEVEL_1 = HIGH,LEVEL_2 = HIGH,LEVEL_3 = HIGH,LEVEL_4 = HIGH),
    CELLS_PER_OBJECT = 64, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    go
    ALTER INDEX [SlowQueryTable_position] ON [dbo].SlowQueryTable
    REBUILD;
    go
    CREATE SPATIAL INDEX [SlowQueryTable_box]
    ON [dbo].SlowQueryTable(box)
    USING GEOMETRY_GRID
    WITH ( BOUNDING_BOX = ( 4500, 4500, 5500, 5500 ) ,
    GRIDS =(LEVEL_1 = HIGH,LEVEL_2 = HIGH,LEVEL_3 = HIGH,LEVEL_4 = HIGH),
    CELLS_PER_OBJECT = 64, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    go
    ALTER INDEX [SlowQueryTable_box] ON [dbo].SlowQueryTable
    REBUILD;
    go
    SET STATISTICS IO ON
    SET STATSTICS TIME ON
    -- this is finally the query. it takes about 6500 ms
    select SlowQueryTable.id
    into #t1
    from SlowQueryTable
    inner join dbo.SlowQueryTable as SlowQueryTableSeen
    on SlowQueryTable.[box].STContains(SlowQueryTableSeen.position) = 1
    --on SlowQueryTable.position.STDistance(SlowQueryTableSeen.position) < 5
    where SlowQueryTable.userId = 2
    drop table #t1
    drop table SlowQueryTable
    drop table numbers
    Using an explicit index hint does do the job, but then the query gets slow if i change the where clause:
    select SlowQueryTable.id
    into #t1
    from SlowQueryTable
    with (index([SlowQueryTable_box]))
    inner join dbo.SlowQueryTable as SlowQueryTableSeen
    on SlowQueryTable.[box].STContains(SlowQueryTableSeen.position) = 1
    where SlowQueryTable.userId = 2
    leads to 600ms, and changing the where clause
    where SlowQueryTable.id = 100
    slows it again down to 1200ms.  Filtering on ID get massively slowed down when using index hint on the spatial index.
    Since the table in the live system will grow to 10000+ rows, and the query is called often by users, I badly need a more efficient query.
    Do I have to create a different queries for each use-case, some with index hints and some without?

    I've run your example and can confirm your results. There's a couple of things that I noticed though.
    After looking at query plans, it's not a matter of "with spatial index" vs. "without spatial index". You have two spatial indexes, one on each column (position and box). When you don't hint the "box" spatial index, the query
    uses the "position" spatial index. Because of what they are indexing (points vs. polygons), the "box" spatial index requires a lot more IO. With some (non-spatial) predicates, the "box" spatial index gives better performance,
    with others the "position" one does. I've yet to figure out exactly why (short on time, I might get back to it in future), but you can examine query plans and use the spatial index diagnostic procs (e.g. sp_help_spatial_geometry_index_xml ) in
    addition to the diagnostics you're running to see why and if you can find a better performing plan/index.
    Bear this in mind. Given a choice of multiple spatial indexes, the SQL Server query optimizer is not able to choose (for the most part, IO etc. aside), which one is best. Also, there is usually only one choice of spatial query plan shape, in general. If
    your query is more complex than the one in your example, you might benefit by breaking it in two: one query to filter out all the rows and predicates that don't use a spatial index and one query that uses the spatial index on the subset. I've had good
    luck with this other situations with complex queries involving spatial predicates. This method may not be applicable to a spatial query as simple as the one in your example, however.
    Hope this helps, Bob 

  • Problem with creating an dynamic internal table with only one field.

    Hi,
    i create an internal table like this:
    FIELD-SYMBOLS: <GT_ITAB>      TYPE TABLE,
                   <GS_ITAB>,
                   <FS>.
    DATA: GT_DATA TYPE REF TO DATA.
    DATA: GS_DATA TYPE REF TO DATA.
    DATA: TABNAME   LIKE DD03L-TABNAME.
    DATA: FIELDNAME LIKE DD03L-FIELDNAME.
    DATA: TBFDNAM   TYPE TBFDNAM VALUE 'LFA1-NAME1'.
    SPLIT TBFDNAM AT '-' INTO TABNAME FIELDNAME.
    CREATE DATA GT_DATA TYPE TABLE OF (TABNAME).
    ASSIGN GT_DATA->* TO <GT_ITAB>.
    CREATE DATA GS_DATA  LIKE LINE OF <GT_ITAB>.
    ASSIGN GS_DATA->* TO <GS_ITAB>.
    SELECT * FROM (TABNAME) INTO CORRESPONDING FIELDS OF TABLE <GT_ITAB>.
      BREAK-POINT.
    it works OK.
    Now i want to create an internal table not like LFA1 but with LFA1-NAME1 Field TBFDNAM.
    It's not only LFA1-NAME1 it shell be the value of TBFDNAM.
    When i change
    CREATE DATA GT_DATA TYPE TABLE OF (TABNAME).
    to
    CREATE DATA GT_DATA TYPE TABLE OF ( TBFDNAM).
    i get an shortdump.
    Any idea?
    Regards, Dieter

    Hi Dieter,
    Your approach is ok, but it will create dynamic table without a structure of NAME1. Only the line type will be suitable (but field name will not exists -> hence the error in the select statement).
    In this case you need to create a dynamic table which structure consists of one field named NAME1.
    This code is the appropriate one:
    " your definitions
    DATA: tabname LIKE dd03l-tabname.
    DATA: fieldname LIKE dd03l-fieldname.
    DATA: tbfdnam TYPE tbfdnam VALUE 'LFA1-NAME1'.
    FIELD-SYMBOLS <gt_itab> TYPE table.
    "new ones
    DATA: it_fcat TYPE lvc_t_fcat WITH HEADER LINE.
    DATA: gt_itab TYPE REF TO data.
    " get table and fieldname
    SPLIT tbfdnam AT '-' INTO tabname fieldname.
    " create dynamic table with structure NAME1 (only one field)
    it_fcat-fieldname = fieldname.
    it_fcat-tabname = tabname.
    APPEND it_fcat.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = it_fcat[]
      IMPORTING
        ep_table                  = gt_itab
      EXCEPTIONS
        generate_subpool_dir_full = 1
        OTHERS                    = 2.
    CHECK sy-subrc = 0.
    " dereference table
    ASSIGN gt_itab->* TO <gt_itab>.
    " insert data only to NAME1 field
    SELECT * FROM (tabname) INTO CORRESPONDING FIELDS OF TABLE <gt_itab>.
    I checked, this works fine:)
    Regards
    Marcin

  • Create table with overlapping parallel dates in individual columns

    I am trying to combine data from two different tables into a single table.
    The data in table 1 contains unit locations of patients within a hospital where each record represents one location. Patients can be transferred many times between different beds resulting in many records for a single visit.
    The data in table 2 contains operating room activity of the patient in the hospital where each record represents either the OR of the recovery room stay. A patient may have multiple operations in one visit.
    I would like to join/merge/mashup the data into a single table that has the data parallel to each other. That is, the dates for the unit activity on one side of the table and the OR activity on the other. The difficulty is that the two sets of in/out dates overlap. I would like the final table to split the original records into new records when the overlaps do not coincide.
    Example:
    Original Events in two records (one per table)
    > Unit Event A - from 2pm to 6pm
    > OR Event B - from 4pm to 5pm
    Results in 3 records (in final table)
    > Event 1 - Unit from 2pm to 4pm, OR dates null
    > Event 2 - Unit from 4pm to 5pm, OR from 4pm to 5pm
    > Event 3 - Unit from 5pm to 6pm, OR dates null
    Of course the overlapping may be more complex that the above example, and adding in and out code to indicate "phantom" transfers will be needed as well.
    In the code below, the first OR visit occurs during the first unit record.
    Jason
    Oracle 10g
    [code]
    create table delme_Unit_dates
    ( id            varchar2(20)
    , unit_rcd_id   varchar2(20)
    , Unit_desc     varchar2(20)
    , Unit_in_code  char(1)
    , Unit_in_dttm  date
    , Unit_out_dttm date
    , Unit_out_code char(1));
    create table delme_or_dates
    ( id            varchar2(20)
    , OR_rcd_id     varchar2(20)
    , OR_desc       varchar2(20)
    , OR_in_code    char(1)
    , OR_in_dttm    date
    , OR_out_dttm   date
    , OR_out_code   char(1));
    create table delme_all_dates
    ( id            varchar2(20)
    , Unit_OR_id    varchar2(40)
    , Unit_rcd_id   varchar2(20)
    , Unit_desc     varchar2(20)
    , Unit_in_code  char(1)
    , Unit_in_dttm  date
    , Unit_out_dttm date
    , Unit_out_code char(1)
    , OR_rcd_id     varchar2(20)
    , OR_Desc       varchar2(20)
    , OR_in_code    char(1)
    , OR_in_dttm    date
    , OR_out_dttm   date
    , OR_out_code   char(1));
    insert into delme_unit_dates values ('123456','U1111','Unit A','A',to_date('2013-04-29 5:02:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-09 1:06:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),'B');
    insert into delme_unit_dates values ('123456','U1112','Unit A','B',to_date('2013-05-09 1:06:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-09 4:53:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),'B');
    insert into delme_unit_dates values ('123456','U1113','Unit A','B',to_date('2013-05-09 4:53:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'),'T');
    insert into delme_unit_dates values ('123456','U1114','Unit D','T',to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'),'B');
    insert into delme_unit_dates values ('123456','U1115','Unit D','B',to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-12 4:00:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),'B');
    insert into delme_unit_dates values ('123456','U1116','Unit D','B',to_date('2013-05-12 4:00:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-16 2:14:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),'T');
    insert into delme_unit_dates values ('123456','U1117','Unit Z','T',to_date('2013-05-16 2:14:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-17 2:26:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),'B');
    insert into delme_unit_dates values ('123456','U1118','Unit Z','B',to_date('2013-05-17 2:26:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-20 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'),'D');
    insert into delme_or_dates values ('123456','OR2221','OR 1','O',to_date('2013-05-09 7:35:00 AM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'),'R');
    insert into delme_or_dates values ('123456','OR2222','RR 5','R',to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-09 3:20:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),'U');
    insert into delme_or_dates values ('123456','OR3331','OR 2','O',to_date('2013-05-16 7:59:00 PM' , 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'),'R');
    insert into delme_or_dates values ('123456','OR3332','RR 8','R',to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'),to_date('2013-05-17 11:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'),'U');
    commit;
    -- this is nowhere near to what is needed
    select
      U.*
    , o.*
    from  
      delme_Unit_dates U
    , delme_OR_dates   O
    where
        U.id = o.id
    and U.UNIT_IN_DTTM  <= O.OR_IN_DTTM
    and U.UNIT_OUT_DTTM >= O.OR_IN_DTTM
    order by U.UNIT_IN_DTTM, O.OR_IN_DTTM
    [/code]
    Message was edited by: Jason_S (Changed one date from '2013-05-16 3:20:00 PM' to '2013-05-09 3:20:00 PM')

    I edited one of the dates in the original post.
    Both the inpatient unit and OR events are contiguous for a given patient (no overlaps and no gaps -- after data is cleaned) .
    I have no problem with a view instead of a table, and would probably prefer a view.
    There are about 3 million records in the inpatient unit table and 0.5 million in the OR table.
    Below is how I would like the final table (assuming I correctly split the records). I've used X's to represent the phantom movements. It seems that one should never have a phantom X in both the UNIT_IN_CODE and the UNIT_OUT_CODE (same for out codes).
    FYI, The B's mean transfer within a unit (change room/ed), the T's transfer between units, O's enter OR, R's enter recovery room.
    Also, the may be a future need to add an additional set of parallel dates (attending physician service)!
    ID
    UNIT_OR_ID
    UNIT_RCD_ID
    UNIT_DESC
    UNIT_IN_CODE
    UNIT_IN_DTTM
    UNIT_OUT_DTTM
    UNIT_OUT_CODE
    OR_RCD_ID
    OR_DESC
    OR_IN_CODE
    OR_IN_DTTM
    OR_OUT_DTTM
    OR_OUT_CODE
    123456
    U1111-
    U1111
    Unit A
    A
    04/29/2013 17:02
    05/09/2013 7:35
    X
    123456
    U1111-OR2221
    U1111
    Unit A
    X
    05/09/2013 7:35
    05/09/2013 10:56
    X
    OR2221
    OR 1
    O
    05/09/2013 7:35
    05/09/2013 10:56
    R
    123456
    U1111-OR2222
    U1111
    Unit A
    X
    05/09/2013 10:56
    05/09/2013 13:06
    B
    OR2222
    RR 5
    R
    05/09/2013 10:56
    05/09/2013 13:06
    X
    123456
    U1112-OR2222
    U1112
    Unit A
    B
    05/09/2013 13:06
    05/09/2013 15:20
    X
    OR2222
    RR 5
    X
    05/09/2013 13:06
    05/09/2013 15:20
    U
    123456
    U1112-
    U1112
    Unit A
    X
    05/09/2013 15:20
    05/09/2013 16:53
    B
    123456
    U1113-
    U1113
    Unit A
    B
    05/09/2013 16:53
    05/10/2013 22:52
    T
    123456
    U1114-
    U1114
    Unit D
    T
    05/10/2013 22:52
    05/11/2013 11:30
    B
    123456
    U1115-
    U1115
    Unit D
    B
    05/11/2013 11:30
    05/12/2013 16:00
    B
    123456
    U1116-
    U1116
    Unit D
    B
    05/12/2013 16:00
    05/16/2013 14:14
    T
    123456
    U1117-
    U1117
    Unit Z
    T
    05/16/2013 14:14
    05/16/2013 19:59
    X
    123456
    U1117-OR3331
    U1117
    Unit Z
    X
    05/16/2013 19:59
    05/16/2013 22:43
    X
    OR3331
    OR 2
    O
    05/16/2013 19:59
    05/16/2013 22:43
    R
    123456
    U1117-OR3332
    U1117
    Unit Z
    X
    05/16/2013 22:43
    05/17/2013 14:26
    B
    OR3332
    RR 8
    R
    05/16/2013 22:43
    05/17/2013 14:26
    X
    123456
    U1118-OR3332
    U1118
    Unit Z
    B
    05/17/2013 14:26
    05/17/2013 23:20
    B
    OR3332
    RR 8
    X
    05/17/2013 14:26
    05/17/2013 23:20
    U
    123456
    U1118-
    U1118
    Unit Z
    B
    05/17/2013 23:20
    05/20/2013 11:30
    D
    Jason

  • Access key needed when creating a new database table with SE11

    Hi,
    I'm using SAP Testdrive (evaluation) on linux in order to learn a bit about ABAP programming. I want to create a new database table in the  dictionary to be used in my programs. I proceed in the following way:
    1) I run the SE11 transaction
    2) At the first entry I write the name of the table to be created (in the Database Table field)
    3) I click on the create button.
    But then the system asks me an Access Key to register, where can I get this?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    Ok I found the answer to my question in another thread
    Developer Key
    Make sure that your program names starts with "Z" or "Y", otherwise the system will ask you to register the object because it thinks you are creating/changing in the SAP namespace.
    In fact this was my error, my table name didn't start with neither "Z" nor "Y".
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on Nov 13, 2010 12:34 PM

  • How to create a view on tables with different keys?

    I have to create a View on:
    Z3PVR: Transparent Table
    BSEG: Cluster Table
    CKIS: Transparent Table
    BKPF: Transparent Table
    RV61A: Structure
    T001: Transparent Table
    All the tables have different "Key Fields" and the structure has no "Key Fields". When i create the view, what do I mention in the "JOIN FIELDS" tab. and how do i create the view with the structure?
    Please advise.

    How to create a view on a Non-Transparent Tables.
    how to create view?
    HELP.. How to create a view with the tables with ALV

Maybe you are looking for