Dynamic section in a fixed Bex structure

Hi experts,
I have such a report requirement from the client, which is similar to a monthly income statement of an insurance agent:
+Opening Balance: xxx EUR
+Total Commission Type 1: xxx EUR
+Total Commission Type 2: xxx EUR
+....
+Total Commission Type N: xxx EUR
+Miscellaneous Income: xxx EUR
- Payment:
-- Payment 1
-- Payment 2
-- Payment n
+New Balance: xxx EUR
I have modeled this report with a Bex structure in Query Designer. But I have a big problem dealing with the line "Payment", because it is not a fixed structure. One agent can receive up to n payments in a month and I have to list out every payment.
So I would like to ask if there is a workaround for designing such a requirement?
Thanks in advance!
Regards,
Meng

How do you differentiate between different payments?
based on a char I guess.
Why do not go for a hierarchy in R/3 side and can hav the expansion there?
In a fixed structure I guess only option is to create max and hide supress zero and yes it is a horrible design if u do this.
Thanks
Navneet

Similar Messages

  • Max number of rows in a BEX structure

    Hi gurus,
    we need to create a structure with 164 key figures, and before starting doing it, does anybody knows which is the max number of rows that can be created on a BEX structure?
    I'm not asking about max number of rows on a query, i'm asking about the number of entries that you can manually create on a structure. Is there a maximum?
    Thanks in advance,
    regards,
    Miguel

    Hi Migual,
    You can add as per your requirement. Please refer the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm
    Assign Points if helpful.
    Regards,
    Amit

  • BEx Structures - Which table has these definitions?

    When user creates a BEx Reusable Structure (Query Level Object), it is just the container for the selections and formulas.  Does anyone know the system table which contains a list of each selection and formula in a structure? 
    For Example:
    Structure Name: "Financial Statement XYZ"
    Line 1:  "Revenue Accounts"
    Line 2:  "Expense Accounts"
    Line 3:  "Net Revenue"
    I want to know the system table in BW which tells me the lines of the BEx Structure.

    hi Mike,
    try table RSZELTDIR, DEFTP = STR; MAPNAME is structure technical name if you have. TXTSH and TXTLG  are the description. copy ELTUID
    go to table RSZELTXREF, SELTUID = ELTUID (use yellow arrow since the id maybe truncated), copy all TELTUID
    then table RSZELTTXT, ELTUID = TELTUID, get description TXTSH / TXTLG
    ( if you back to table RSZELTDIR ELTUID = TELTUID; get some rows where DEFTP = FML, SEL; formula, selection )
    check also if you can use metadata repository (rsa1 - metadata repository)
    hope this helps.

  • Creating a condition on a SAP BW BEx structure

    Hi,
    I'm trying to create a condition / filter in a universe that is built over a SAP BW BEx query that is using a structure and I can't work out how to do this properly.
    I see in the XI 3.0 OLAP universe documentation a reference to structures as follows:
    "Stuctures defined in the BW Query that are based on characteristics are
    included in the universe as single-dimension objects with the elements of
    the structure as dimension members."
    A sample of my BEx structure which is named "P&L Lines" is as follows:
    Gross Sales Value
    Discounts
    Invoiced Sales
    Std Material Cost
    In the universe the Class is "P&L Lines" and there is an object also named "P&L Lines". The properites of this object in the "Select" area shows [D431JNHSA9FQ901I1YLHH9WBR]
    A simple example of what I have been testing is to include only "Gross Sales Value".
    In the universe I have set a condition as follows:
    <FILTER KEY
    "[D431JNHSA9FQ901I1YLHH9WBR]">
    <CONDITION
    OPERATORCONDITION="InList">
    <CONSTANT CAPTION="Gross Sales Value">
    </CONDITION>
    </FILTER>
    This parses ok but it has no affect when I run the webi report.
    Any help would be appreciated.
    Mark P

    Hi Prado,
    Please refer the link for detailed steps:
    http://scn.sap.com/docs/DOC-53352#__RefHeading__742_705700879
    Thanks Much,
    Abhishek

  • BEx Structures in WEBI

    Hello Guys,
    I am new to BO with BI as data source.
    In BEx query disigner, we have one Char and KF structure (with two calculated KFs) in rows section. And Char structure with 2 chars (restrcted) in columns section. We are using cell difinition as mentioned below:
              OQT     DQT
    Mat          c1     c2
    CKF1          c3     c4
    CKF2          c5     c6
    c3 and c6 are cell references and using these reference cells in formula cells c1 and c2. CKF1 and CKF2 are hidden. When we execute this query using BEx analyzer it is displaying correct values as mentioned in below format.
         OQT     DQT
    M1     20     10
    We created OLAP universe on top of this BEx query. Hidden CKFs are displaying in universe level and it is displaying Structure class with one structure dimension only.
    When we use that structure dimension in webi it is displaying OQT and DQT not values of it.
    My question is how to create webi report to achieve above mentioned Bex report?
    Is WEBI supports the cell definition/reference ?
    We are using BI 7 with BO XI R3.1
    Thanks in advance for your help,
    Regards,
    Reddy.
    Edited by: pyreddy9 on Feb 17, 2012 12:11 AM

    Hi,
    It's difficult to tell exactly how you will workaround that ...
    but, with MDX you have to include a Measure/KF in the webi query results
    in the webi query panel, you MUST include (at minimum) the exact same objects Structure(s)/CKF combination as a baseline for your query to work reliably. ( Check this Bex layout in RSTT and see how the initial query view is designed )
    generally speaking, use of multiple Characteristic Structures (like the accounting model) and Measure Hierarchies really confuses webi.  and also, can hammer the OLAP engine in BW too. (i.e. massive performance issues)
    some aspects of the hardcoded layout delivered by structures (i.e. subtotals and totals, formatting indents etc)  are not understood or respected by webi.
    Check out this Note here 1387793 - BEx functionality features that are not supported or integrated in WebIntelligence  
    for an idea of the Bex features which are not exposed by the BW OLAP API to BObj .
    as for cell references .. this is a fringe use-case for BW-BO developments, and should probably be avoided.
    Ultiamtely, you should be using BEx as a simple data-delivery container, particularly for filtering,  but definitely not for presentation layout.
    Regards,
    H
    p.s. a couple of reference notes for BW corrections in teh MDX interface:
    Note 1446246 - MDX: Composite SAP Note for flattening API based on basXML
    Note 1156101 - MDX: Composite SAP note for incorrect data
    Note 1142664 - MDX: Composite SAP note about performance improvements

  • How to get dynamic query results from an array/structure

    I have an edit page that is set up to display phone number fields from the user stored in our database. The properties for the phone number fields are set by a structure of arrays. My problem is that when a user has more than 1 phone number in my database, my structures correctly show this on the form by displaying 2 phone numbers. The problem I am having is that when it shows multiple phone numebrs, it always shows the first result and just repeats it as opposed to dropping the 2nd or 3rd phone number in their respective fields.
    array and structure code below:
          <!--- Mobile --->
          <cfset mobile = StructNew()>
          <cfset mobile.dynamic = false>
          <cfset mobile.dynamicLabel = '+ Add'>
          <cfset mobile.fields = ArrayNew(1)>
    <cfif #checkuserv.recordcount# GT '0'>   
          <cfset mobile.fields[1] = StructNew()>
          <cfset mobile.fields[1].required = false>
          <cfset mobile.fields[1].label = 'Phone Number 1'>
          <cfset mobile.fields[1].displayIcon = false>
          <cfset mobile.fields[1].voice = true>
          <cfset mobile.fields[1].voiceChecked = true>
          <cfset mobile.fields[1].toolTip = "Please choose if you would like to receive a text or voice call on this number">
    </cfif>
    <cfif #checkuserv.recordcount# IS '2'>    
          <cfset mobile.fields[2] = StructNew()>
          <cfset mobile.fields[2].required = false>
          <cfset mobile.fields[2].label = 'Phone Number 2'>
          <cfset mobile.fields[2].displayIcon = false>
          <cfset mobile.fields[2].toolTip = "Please choose if you would like to receive a text or voice call on this number">
          <cfset mobile.fields[2].voice = true>
          <cfset mobile.fields[2].voiceChecked = true>
    </cfif>
    <cfif #checkuserv.recordcount# IS '3'>     
          <cfset mobile.fields[3] = StructNew()>
          <cfset mobile.fields[3].required = false>
          <cfset mobile.fields[3].label = 'Phone Number 3'>
          <cfset mobile.fields[3].displayIcon = false>
          <cfset mobile.fields[3].toolTip = "Please choose if you would like to receive a text or voice call on this number">
          <cfset mobile.fields[3].voice = true>
          <cfset mobile.fields[3].voiceChecked = true>
    </cfif>
    Here is the code for my fields that call the array info:
    <!--- Voice 1 --->      
            <cfloop index="i" from="1" to="#ArrayLen(mobile.fields)#">
                <cfif i EQ 1 OR NOT mobile.dynamic OR form.mobileDisplayed GTE i>
                    <cfparam name="form.areacode_#i#" default="">
                    <cfparam name="form.prefix_#i#" default="">
                    <cfparam name="form.suffix_#i#" default="">
                <div class="fieldBlock phoneBlock" id="phoneBlock#i#">
                    <label for="areacode_#i#">
                        <cfif mobile.fields[i].required><span>*</span></cfif>
                        <cfif mobile.fields[i].displayIcon><img src="/images/sm_phone.jpg" /></cfif>
                        #mobile.fields[i].label#:
                    </label>
                    <div class="inputBlock">
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'prefix_#i#', 3, event)" name="areacode_#i#" id="areacode_#i#" class="areacode" value="#trim(left(checkuserv.sub_user_number, '3'))#" />
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'suffix_#i#', 3, event)" name="prefix_#i#" id="prefix_#i#" class="prefix" value="#trim(mid(checkuserv.sub_user_number, "4", '3'))#" />
                        <input type="text" maxlength="4" name="suffix_#i#" id="suffix_#i#" class="suffix"  value="#trim(mid(checkuserv.sub_user_number, "7", '4'))#" />
                        <cfif StructKeyExists(mobile.fields[i], "voice") and mobile.fields[i].voice>
                            <div class="voice" id="voice#i#">
                                <input type="radio" value="0" name="voice_#i#"<cfif Not StructKeyExists(mobile.fields[i], "voiceChecked") or Not mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Text</label>
                                <input type="radio" value="1" name="voice_#i#"<cfif StructKeyExists(mobile.fields[i], "voiceChecked") and mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Voice</label>
                            </div>
                        </cfif>
                        <cfif StructKeyExists(mobile.fields[i], "toolTip") and mobile.fields[i].toolTip neq "">
                            <div class="toolTip" id="toolTip_#i#" title="#mobile.fields[i].toolTip#" onClick="alert('#mobile.fields[i].toolTip#')">?</div>
                        </cfif>
                    </div>
    <!--- This number was invalid or if geocoding failed, and they've picked a carrier to override, display the carrier override dropdown--->
                    <cfif ListFindNoCase(invalidMobileIndexList, i) or ( showMap and IsDefined("form.carrierOverride" & i) )>
                        <div id="carrierOverrideBox#i#" class="carrierOverrideBlock">
                            <label>Carrier:</label>
                            <div class="inputBlock">
                                <select name="carrierOverride#i#" id="carrierOverride#i#">
                                    <option value="-1">-- Pick your carrier --</option>
                                    <cfloop query="carriers">
                                        <!--- 1111 is voice, 0 is NONE, don't display  --->
                                        <cfif Not ListFindNoCase("0,1111", carriers.carrier_id)>
                                            <option value="#Trim(carriers.carrier_id)#"<cfif IsDefined("form.carrierOverride" & i) and form["carrierOverride" & i] eq Trim(carriers.carrier_id)> selected="selected"</cfif>>#Trim(carriers.carrier_title)#</option>
                                        </cfif>
                                    </cfloop>
                                </select>
                                <a href="http://www.inspironlogisticscontact.cfm?account_id=#account_id#&carrierOverride=1"
                                       title="Carrier help"
                                       onClick="window.open('http://www.inspironlogisticscontact.cfm?account_id=#account_id#&carrierOverride=1','#accou nt_id#','width=500,height=800,scrollbars=no,screenX=100,screenY=100,top=100,left=100,resiz able=1'); return false;"
                                      >?</a>
                            </div>
                        </div>
                    </cfif>
                    <cfif mobile.dynamic AND i EQ form.mobileDisplayed AND i LT ArrayLen(mobile.fields)>
                    <div class="dynamicAddBlock dynamicAddMobileBlock" id="dynamicAddmobile_#i#">
                          <a href="javascript: submitAddField('mobile')">#mobile.dynamicLabel#</a>
                    </div>
                    </cfif>
                </div>
                </cfif>
            </cfloop>
            <cfif mobile.dynamic>
                <input name="mobileDisplayed" id="mobileDisplayed" value="#form.mobileDisplayed#" type="hidden" />
            </cfif>
            <input name="carrierOverrideActive" id="carrierOverrideActive" value="<cfif carrierOverrideActive>1<cfelse>0</cfif>" type="hidden" />
    I have been stuck on this for days, finally turning to the forum today with a few different issues. I hate trying to work within the framwork of other peoples code.
    I use coldfusion 8

    I broke the chunk of code away from the page and am now getting teh phone numbers in the right spots, but I am still getting a coldfusion error.
    Element 2 is undefined in a Java object of type class coldfusion.runtime.Array.
    Here is my code...
    <cfset invalidMobileIndexList = "">
    <cfset showMap = false>
    <cfset carrierOverrideActive = false>
    <!--- Voice 1 --->       
            <cfloop index="i" from="1" to="#ArrayLen(mobile.fields)#">
    <!------>            <cfif i EQ 1 OR NOT mobile.dynamic OR form.mobileDisplayed GTE i>
                    <cfparam name="form.areacode_#i#" default="">
                    <cfparam name="form.prefix_#i#" default="">
                    <cfparam name="form.suffix_#i#" default="">
                <div class="fieldBlock phoneBlock" id="phoneBlock#i#">
                <label for="areacode_#i#">
                        <cfif mobile.fields[i].required><span>*</span></cfif>
                        <cfif mobile.fields[i].displayIcon><img src="/images/sm_phone.jpg" /></cfif>
                        #mobile.fields[i].label#:
                    </label>
                    <cfoutput query="checkuserv" ><div class="inputBlock">
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'prefix_#i#', 3, event)" name="areacode_#i#" id="areacode_#i#" class="areacode" value="#trim(left(checkuserv.sub_user_number, '3'))#" />
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'suffix_#i#', 3, event)" name="prefix_#i#" id="prefix_#i#" class="prefix" value="#trim(mid(checkuserv.sub_user_number, "4", '3'))#" />
                        <input type="text" maxlength="4" name="suffix_#i#" id="suffix_#i#" class="suffix"  value="#trim(mid(checkuserv.sub_user_number, "7", '4'))#" />
                        <cfif StructKeyExists(mobile.fields[i], "voice") and mobile.fields[i].voice>
                            <div class="voice" id="voice#i#">
                                <input type="radio" value="0" name="voice_#i#"<cfif Not StructKeyExists(mobile.fields[i], "voiceChecked") or Not mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Text</label>
                                <input type="radio" value="1" name="voice_#i#"<cfif StructKeyExists(mobile.fields[i], "voiceChecked") and mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Voice</label>
                        </cfif></div></cfoutput>
                        <cfif StructKeyExists(mobile.fields[i], "toolTip") and mobile.fields[i].toolTip neq "">
                            <div class="toolTip" id="toolTip_#i#" title="#mobile.fields[i].toolTip#" onClick="alert('#mobile.fields[i].toolTip#')">?</div>
                        </cfif>
                    </div>
                    <!--- This number was invalid or if geocoding failed, and they've picked a carrier to override, display the carrier override dropdown--->
                    <cfif ListFindNoCase(invalidMobileIndexList, i) or ( showMap and IsDefined("form.carrierOverride" & i) )>
                        <div id="carrierOverrideBox#i#" class="carrierOverrideBlock">
                            <label>Carrier:</label>
                            <div class="inputBlock">
                                <select name="carrierOverride#i#" id="carrierOverride#i#">
                                    <option value="-1">-- Pick your carrier --</option>
                                    <cfloop query="carriers">
                                        <!--- 1111 is voice, 0 is NONE, don't display  --->
                                        <cfif Not ListFindNoCase("0,1111", carriers.carrier_id)>
                                            <option value="#Trim(carriers.carrier_id)#"<cfif IsDefined("form.carrierOverride" & i) and form["carrierOverride" & i] eq Trim(carriers.carrier_id)> selected="selected"</cfif>>#Trim(carriers.carrier_title)#</option>
                                        </cfif>
                                    </cfloop>
                                </select>
                                <a href="http://www.inspironlogistics.com/wens/contact.cfm?account_id=#account_id#&carrierOverride= 1"
                                       title="Carrier help"
                                       onClick="window.open('http://www.inspironlogistics.com/wens/contact.cfm?account_id=#account_id#&carrierOverride= 1','#account_id#','width=500,height=800,scrollbars=no,screenX=100,screenY=100,top=100,left =100,resizable=1'); return false;"
                                      >?</a>
                            </div>
                        </div>
                    </cfif>
                    <cfif mobile.dynamic AND i EQ form.mobileDisplayed AND i LT ArrayLen(mobile.fields)>
                    <div class="dynamicAddBlock dynamicAddMobileBlock" id="dynamicAddmobile_#i#">
                          <a href="javascript: submitAddField('mobile')">#mobile.dynamicLabel#</a>
                    </div>
                    </cfif>
                </div>
                </cfif>
            <cfif mobile.dynamic>
                <input name="mobileDisplayed" id="mobileDisplayed" value="#form.mobileDisplayed#" type="hidden" />
            </cfif>
            <input name="carrierOverrideActive" id="carrierOverrideActive" value="<cfif carrierOverrideActive>1<cfelse>0</cfif>" type="hidden" /><!------>
           </cfloop>

  • FileAdapter write mode - Dynamic filename, write down simple text structure

    Hi,
    I tried to use the FileAdapter in a BPEL Process to write down and existing structure as String, comming from Database (CLOB), which has a defined structure.
    My first problem is, that I assign an output filename through the output message header variable, but it does not work. Instead always the name from the Filename convention is taken (wizard like po_%SEQ%.txt).
    My second problem is, that the FileAdapater destroyes the format during the write procedure. E.g.: The String structure is as follows:
    MKKOPF EF585773 07.05.2009 1 XXX Spielapparate u. Restaurant- betriebsgmbH 40031356 Brehmstraße 21 1110 Wien 900000585773 EUR ML
    MKMAIL [email protected]
    MKEINZ EF4428643 28.06.2009 Test Card Casino XXX Gesamtausgabe Textteil Allgemein Großanzeige 4C 1 ST 1 489,00 489,00 GES
    MKPOS. EF4428644 26.07.2009PRVB 948,66 / 10 / +5% WA
    a.s.o, . So you can see, its quite a simple format, which has to stay like that!
    First I tried to use the opaque mode for the fileoutput format, but I was stopped, because of the '/' characters in the source data. So I used the native builder to create a xml schema (I used deliminated file, multiple records, deliminated by white spaces, tabs and spaces). To identify the multiple records, I have chosen the end of line (eol). Except EOF and EOL there is no other choice, like CRLF,\r,\n!
    However, testing my native format, result in writting a file with containing a single line with the original data. So the original line breaks are gone, and therefore the system who should process it further gets an parsing error!
    The simple question is, how can I simple write down string data (containing German special chars, like Öäü --> ISO8859-1 and also XML reserved values like /) through the file adapter without destroying its structure?
    Second, how can I pass dynamically the filename, as using the output header values does not work?
    I hope some specialists are out there.
    Thanks & BR,
    Peter

    Hi James,
    here what I am doing.
    I read some records from the database throught the database adapter. The returned records representing strings, which should be written, line by line separated by 0xA (\n) to a single file.
    Also for the file write we use a Oracle SOA Adapter --> the FileAdapter.
    We discussed quiet some time about opaque schema and native builder. So on my understanding only the native builder version works. Otherwise I get an error, because of the contained slashes in the string record.
    What I am searching for is an easy way for aggregating this database row strings and append it with 0xA (\n).
    With XPath functions, like create-deliminated-string(node, '#xA') I had no success. Adhering to XML the signs #xA should represent 0xA, but it does not work.
    Also in using the encodeLineTerminators &#10; is not working.
    So I had really write a long bpel construct, combined with a Java Code Emeeding to do such a simple thing:
    Here is the interessting part (hiden the while loop, index handling and final fileadapter write call details):
    <while name="While_1"
    condition="($VariableSapBillingJobs > 0) and ($VariableIndex &lt;= $VariableSapBillingJobs)">
    <sequence name="Sequence_4">
    <sequence name="Sequence_4">
    <assign name="Assign">
    <copy>
    <from expression="concat(bpws:getVariableData('VariableBuffer'), bpws:getVariableData('InvokeSapDataSelection_eBillingSapDB4Select_OutputVariable','eBillingSapDB4SelectOutputCollection','/ns8:eBillingSapDB4SelectOutputCollection/ns8:eBillingSapDB4SelectOutput[$VariableIndex]/ns8:LINE'))"/>
    <to variable="VariableBuffer"/>
    </copy>
    </assign>
    *<bpelx:exec name="JavaAppendCRLF" language="java"*
    version="1.5">
    <![CDATA[String buffer = (String)getVariableData("VariableBuffer");    
    buffer += "\n";     
    setVariableData("VariableBuffer", buffer);]]>
    </bpelx:exec>
    <assign name="AggregateStructure">
    <copy>
    <from expression="$VariableIndex + 1"/>
    <to variable="VariableIndex"/>
    </copy>
    </assign>
    </sequence>
    </sequence>
    </while>
    There must be a simpler way like that!
    Do you or somebody else a simpler way? Doing it with the FileAdapter native builder, or at least with a XPath function?
    Furthermore my next homework is, the inverse operation. I will read a file, this time terminated with 0xD 0xA, and must translate it to XML to use it further in my bpel process.
    Also here I have not the idea, where the fileadapter supports me.
    Thanks & BR,
    Peter

  • Dynamic page based on directory content/structure

    I'm trying to build a web page based the content of a directory. I'm going to try and explain this as briefly as possible, yet still make sense.
    There are many more file than this, but an example of the directory of the index.html's looks like this:
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\Content\Install\Templates\en\index.html
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\Content\player\index.html
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\Content\scp\index.html
    e:\Inetpub\wwwroot\Courses\Dev\Environmental Management Systems\index.html
    With this structure, the root path is: e:\Inetpub\wwwroot\Courses.
    Dev would become a main section.
    Environmental Management Systems would become a Course title, because it has an index.html.
    I want to ignore the rest of the index.html's underneath.
    A caveat to this, is I need it to possibly go one level deeper.
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\Content\Install\Templates\en\index.html
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\Content\player\index.html
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\Content\scp\index.html
    e:\Inetpub\wwwroot\Courses\Dev2\Manufacturing\Environmental Management Systems\index.html
    Here, Dev2 becomes main section
    Manufacturing becomes sub section
    Environmental Management Systems would become a Course title, because it has an index.html.
    Of course there are a lot more files, which is part of the problem I'm having. Right now it takes about 8 seconds to read all the files, which is too long for building a page. Once I get all the main, subs, and Courses determined, I would then build the page, using some kind of menu.
    Below is the code I have that searches all files under a parent folder, I'm just not sure how to make it stop once it finds the correct index.html. I started to put in a recursive stop, but haven't quite figured out how to implement that either.
    Any help is greatly appreciated. I'm open to any and all suggestions. Btw, the intention here, is that the person that manages these courses can just ftp a new course directory to the server, and it's then available.
    Thanks,
    James
    <%@ page import="java.util.*,java.io.*,java.text.*,java.io.File,java.net.*" %>
    <HTML>
    <HEAD><TITLE>Skillsoft Courses</TITLE></HEAD>
    <BODY BGCOLOR="white">
    <H1><B><img src="logo.gif" width="120" height="49"><FONT COLOR=#004685>Courses</FONT></B></H1>
    <HR>
    <BR>
    <%!
         public ArrayList listFiles(ArrayList files, String currentFile, int recurse)
                   File fd = new File(currentFile);
                   if ( fd.exists() && fd.isFile())
                        //grab filename - not quite working right as it still prints out the ones that should be excluded
                        if ((currentFile.endsWith("index.html")) && (!(currentFile.endsWith("Content\\scp\\index.html")) || !(currentFile.endsWith("Content\\player\\index.html"))))
                             files.add(currentFile);
                   else if ( fd.exists() && fd.isDirectory())
                        File [] fileList = fd.listFiles();
                        // Loop through File array and display.
                        for (int i = 0; i < fileList.length; i++)
                             listFiles(files, fileList.getPath(), recurse);
                        } // for loop
              return files;
    %>
    <%
         ArrayList files = new ArrayList();
         String rootPath = "e:\\Inetpub\\wwwroot\\Courses\\";           
         //get file list of root path
         File dir = new File(rootPath);
         File[] children = dir.listFiles();
         //stick into array
         for (int i = 0; i < children.length; i++)
              int recurse = 0;
              String tmp = children[i].getPath();
              listFiles(files, tmp, recurse);
         for (int j = 0; j < files.size(); j++)
    %>
              <%=(String)files.get(j)%><BR>
              <%;
    %>
    </BODY>
    </HTML>

    Architecturally, I would not put this code in a JSP, put it in a Plain Old Java Object that gets called by a Servlet, builds the tree, then passes the tree to the JSP for display. It will make things easier in the long run.
    I would also look into caching the results. When you traverse the directory structure, hold the results in memory. Use a timestamp that records the last time the \Courses\ directory was traversed, and compare it to the \Courses\ last modified time. If \Courses\ was modified after the timestanp then re-load the content. This would reduce that 8 second load time to only occur when changes were made.
    Similarly, you could further reduce loading time by
    1) Compare a section with those sections already loaded. If it doesn't exist, then traverse it and add the directory structure
    2) If the section does exist, use a timestamp and modified time to see if it the section has changed. If it has changed, traverse it and update the directory structure
    3) If the section does exist and hasn't been modified, leave it alone.
    You would then want to make classes to represent the entire tree of files - which would contain a timestamp and a list of sections (main sections). Each section would have a timestamp, a list of sub-sections, and a list of courses. A course would have a timestamp and a list of files for the course. And as was mentioned this tree structure would be held in memory and returned as needed.
    For viewing files that are too deep in the structure, that will take more looking into than I have time for now. Sorry.

  • Bex Structure Headings

    Hi
    Is it possible to add headings to the structure in Bex query, I tried using selection but it is showing the values...I just want to add descriptions with no values as below in bold:
    Example
    Plan
    ---Values
    Actual
    ---Values
    Please advice

    Thanks for inpurt, I tried both ways hiding from cell definiation which is hiding the heading too even if I didnt hide it as I put the 0 value elimination in the report.
    Second one is I tried with different char selections but when I drill down by any char, it is giving me values ...Is it possible to achieve this in any other way ...Also I forgot to mention, I need to show the total (result) values for the heading as well...It is highly complex...Please advice if possible
    Thanks

  • Relationship between Dynamic Memory Heap and Heap Data Structure

    This question is not strictly related to Java, but rather to programming in general, and I tend to get better answers from this community than any where else.
    Somehow, my school and industry experience have somehow not given me the opportunity to explore and understand heaps (the data structure), so I'm investigating them now, and in particular, I've been looking at applications. I know they can be used for priority queues, heap sorts, and shortest path searches. However, I would have thought that, obviously, there must be some sort of relationship between the heap data structure, and the dynamic memory heap. Otherwise, I can think of no good reason why the dynamic memory heap would be named "heap". Surprisingly, after searching the web for 90 minutes or so, I've seen vague references, but nothing conclusive (trouble seems to be that it's hard to get Google to understand that I'm using the word "heap" in two different contexts, and similarly, it would not likely understand that web authors would use the word in two different contexts).
    The Java Virtual Machine Spec is silent on the subject, as "The Java virtual machine assumes no particular type of automatic storage management system, and the storage management technique may be chosen according to the implementor's system requirements."
    I've seen things like:
    [of dynamic memory] "All the blocks of a particular size are kept in a sorted linked list or tree (I extrapolate that sorted tree could imply heap)"
    [of dynamic memory] "The free and reserved areas of memory are maintained in a data structure similar to binary trees called a heap"
    [of dynamic memory] "This is not related to the heap data structure"
    [of dynamic memory] "Not to be confused with the data structure known as a "heap"
    [of data structure] "Not to be confused with the dynamic memory pool, often known as TheHeap"
    At this point, I've come to surmise that some (but not all) memory management algorithms use heaps to track which (pages? blocks? bytes?) of memory are used, and which are not. However, the point of a heap is to store data so that the max (or min) key is at the root of the heap. But we might want to allocate memory of different sizes at different times, so it wouldn't make sense to key on the amount of available memory in a particular region of the free store.
    I must assume then that there would be a different heap maintained for each size of memory block that can be allocated, and the key must have something to do with the attractiveness of the particular memory block in the heap (perhaps the lowest address, resulting, hopefully, in growing the free store space less often, leaving more space for the stack to grow, or perhaps keyed based on the fragmentation, to hopefully result in less fragmentation, and therefore more efficient use of the memory space, or perhaps based on page boundaries, keeping as much data in the same page as possible, etc).
    So at this point, I have a few questions I've been unable to resolve completely:
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?
    2. If so, would it be correct that there would be a heap per standard block size?
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?
    Any insight would be awesome!
    Thanks,
    A.

    jschell wrote:
    I think you are not only mixing terms but domains.
    For starters the OS allocs memory. Applications, regardless of language, request memory from the OS and use it in various ways.
    There are many variations of the term "heap" like the following.
    [http://en.wikipedia.org/wiki/Heap_(data_structure)]
    [http://en.wikipedia.org/wiki/Dynamic_memory_allocation]
    A java VM will request memory from the OS (from a 'heap') and use it in its application 'heap' (C/C++) and then create the Java 'heap'. There can be variations of that along the way that can and likely will include variations of how each heap is used, potentially code that creates its own heap, and potentially other allocators which use something which is not a heap.This last part, I find a bit confusing. By "use something which is not a heap", do you mean the heap data structure, or the dynamic memory pool meaning of heap? If the former, then you would be implying that it would be common for a heap data structure to be used to manage the heap dynamic memory pool. If the latter, what would this "something which is not a heap" be? The best definition of "heap" I've found simply states that it is a pool of memory that can be dynamically allocated. If there is some other way of allocating dynamic memory, then it would suggest that the previous definition of "heap" is incomplete.
    >
    So to terms.
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?Which 'heap'? The VM one? It is probably named that because the implementors of the Sun VM were familar with how C++ and Smalltalk allocated memory.Okay, but that begs the question, was the heap in C++ and/or Smalltalk so named for the above queried reason?
    >
    2. If so, would it be correct that there would be a heap per standard block size?Not sure what you are referring to but probably a detail of the implementation. And since there are different levels the question doesn't mean much.
    However OS allocations are always by block if that helps. After that it requires making the question much, much more specific.
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?Again not specific enough. A typical standard implementation of heap could not be at the word level. And it is unlikely, but not impossible, that variations would support word size allocations.
    The VM heap might use word boundaries (but not size), where the application heap certainly does (word boundary.)My understanding of it is that the application would request blocks from the OS, and then something like malloc would manage the memory within the allocated blocks. malloc (or whatever equivalent Java uses) would have to keep track of the memory it has allocated somehow, and I would think it would have to do this at the word level, since it's most commonly going to allocate memory at the word level to be references to other objects, etc.
    So I guess my question here would really be, if the dynamic memory heap is so named because there has been a memory management strategy that relied upon a heap data structure (which I've found no proof, but have found some suggestive literature), then would that probably have applied at the OS Page Fault level, tracking allocated blocks, or would that have applied at the malloc level, allocating individual words as necessary?
    >
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?"Key" is not a term that will apply in this discussion.
    You appear to be referring to strategies for effective allocation of memory such as allocations from different regions by size comparison.
    It is possible that all levels might use such an allocator. General purpose applications do not sort allocations though (as per your one reference that mentions 'key'.) Sorry, I got the term "key" from an article I read regarding heaps, that indicates that a "key" is used to sort the elements, which I guess would be a more generalized way to make a heap than assuming a natural ordering on the elements in the heap. I'm not sure if the terminology is standard.
    >
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?Again too indefinite. The Sun VM uses a rather complicated allocator, the model for which originated after years of proceeding research certainly in Smalltalk and in Lisp as well, both commercially and academically.
    I am sure the default is rules driven either explicitly or implicitly as well. So it is self tuning.
    There are command line options that allow you to change how it works as well.I guess perhaps I could attempt to clarify my initial question a bit.
    There is a 1:1 correspondence between the runtime stack, and a stack data structure. That is, when you call a function, it pushes a stack frame onto the runtime stack. When you return from a function, it pops a stack frame from the runtime stack. This is almost certainly the reasons the runtime stack is named as it is.
    The question is, is there or has there ever been a 1:1 correspondence between some aspect of the dynamic memory heap or how it is managed, and a heap data structure? If so, it would explain the name, but I'm a bit puzzled as to how a heap data structure would be of assistance in creating or managing the dynamic memory heap. If not, on the other hand, then does anybody know where the name "heap" came from, as it applies to the dynamic memory pool?
    A.

  • Dynamic assignment of field in a Structure

    Hello there,
    i'm looking for a solution of the following Problem:
    I have a structure STRUC with several fields e.g. Name, Street, City
    In my program i get dynamically the fieldname and the corresponding value.
    With these information i like to do the following assignment:
    STRUC-<fieldname> = 'Hello world'. (which is not working in ABAP)
    How can i do an assignment like this? I only found a way to read colums dynamically from a structure but not the oppside way.
    ASSIGN COMPONENT <fieldname> of structure <STRUC> to <fieldvalue>.
    I need something like this
    ASSIGN <fieldvalue> to COMPONENT <comp> of structure <STRUC>.
    Does anybody has an idea?
    Many thanks in advance!
    Josef

    Hello together,
    the problem is solved here is the example coding:
    data: lv_value(80) type c,
            fieldname(20) type c.
    field-symbols: <value> type any.
    fieldname = 'TEXT'.
    concatenate 'STRUC-' fieldname into lv_value.
    assign (lv_value) to <value>
    if sy-subrc = 0.
      <value> = 'Hello world'.
    endif.
    unassign <value>
    result: struc-text = 'Hello World'.

  • Dynamic Field type declaration in a structure

    Hi All,
       How to declare the data element of a field dynamically in the structure i.e, how to define a field type dynamically in the structure?
       Please find below example for better understanding of my query and share your ideas if we have a solution for such requirement.
    TYPES: BEGIN OF ts_struc,
            fld1 TYPE matnr,
            fld2 TYPE maktx,
            fld3 TYPE mtart,
            fld4,
            fld5,
            fld6,       
           END OF ts_struc.
    DATA: it_struc TYPE STANDARD TABLE OF ts_struc.
    PARAMETERS: p_cc RADIOBUTTON GROUP rg1,
                p_us RADIOBUTTON GROUP rg1.
    if p_cc eq 'X'.
    fld4, fld5, fld6 should be of type WOG0XXX.
    elseif p_us eq 'X'.
    fld4, fld5, fld6 should be of type WKG0XXX.
    endif.
    Regards,
    Shano

    data: dref type ref data.
    field-symbols: <fs_str> type WOG0XXX.
      CREATE DATA dref TYPE WOG0XXX.
      ASSIGN dref->* TO <fs_str>.
    now <fs_str> can be used as WOG0XXX.
    Edited by: ssm on Jul 28, 2011 4:58 PM
    For ex:
    DATA: lv_kunnr TYPE kunnr.
    DATA: kunnr TYPE REF TO data.
    field-symbols: <fs_kunnr> TYPE ANY.
    CREATE DATA kunnr TYPE kunnr.
    lv_kunnr = '123'.
    ASSIGN kunnr->* TO <fs_kunnr>.
    move lv_kunnr to <fs_kunnr>.
    write: <fs_kunnr>.
    Edited by: ssm on Jul 28, 2011 5:00 PM

  • Tech Tool Deluxe DVD won't boot with 10.5.6. How to fix volume structure?

    Is it just my newbieness, or is the Tech Tool Deluxe 3.1.2 DVD image not bootable with late 2008 MBP with OS X 10.5.6?
    I installed Tech Tool Deluxe 3.1.2 to Leopard 10.5.6. - ran it and it said I have problems with my volume structures. I followed the download button, gave my serial and downloaded the TTD.dmg image, burned it to DVD with Disk Utility (seems OK, as I can read the disk in OS).
    When I try to boot from the DVD, it just reboots in a while to my OS X (tried with c and opt buttons during start-up. I can choose to boot from DVD with opt, but again it just reboots in a while).
    Apple mentions that this version of TTD is not compatible with Late 2008 models - is booting one of the incompatibilities? If so, fine, but how can I fix my volume structure problems now, that tend to hang my Mac every once in while with big disk operations?
    Thanks for any possible help.

    I had the same problem myself. The TechTool bootable products on DVD won't startup an October 2008 release MacBook or MacBook Pro.
    From the Micromat website:
    Our current bootable products support all PowerPC and Intel Macintosh computers capable
    of running Mac OS X 10.5 or greater, except for:
    • MacBook (October 2008 Release)
    • MacBook Pro (October 2008 Release)
    http://www.micromat.com/index.php?option=content&task=view&id=168

  • How can we change the name of dynamic events selector label in Event Structure

    When retriving references to Control that are contained in a cluster. The default name that
    appear in the Event Structure is: : Mouse down.
    I have found a workaround to correct the problem. But I would apreciate a more convinient way to do this.
    This is the workaround I found to change the names in the Event Structure
    I cast the References using a Reference constant and I change the label of
    that constant.
    See the VI for more detail. It is well commented.
    Is there any way to change the name of a dynamic event without doing the
    cast trick?
    Attachments:
    DynEventStructureName.vi ‏44 KB

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Assigning part of a string dynamically to a component of a structure

    Hello,
    I want to take part of a string
    example: value = string+10(7)
    and assign this value to a structure. But I only have the fieldnames of the structure. I need something like the following
    Assign value TO COMPONENT (fieldname) of structure
    Thanks.
    Regards, Lars.

    do you have a set structure name you're dealing with or is that dynamic?
    If it's the first scenario and, say, you were dealing with mara and field matnr you could do this:
    data l_string.
    field-symbols <field> type any.
    l_string = in_string+10(18).
    assign l_string to <field> casting type matnr.
    (or assign l_string to <field> casting like mara-matnr).
    now <field> is a 'matnr' type field.
    If it's more complex please give some more info as I'm sure what you want can be done.

Maybe you are looking for

  • Portege P4000: Cant recognize the external USB CD-ROM

    Hi, I have a big problem. I have a Portege P4000 the DVD is broke but I have an external CD-Rom with USB. I want to replace windows 2000 on the notebook but it didn't read the USB port. I update the BIOS but I can use USB ports only with floppy disk.

  • Traffic light in RF monitor screen (LRF1) - how it is derive from?

    Hi, This is a question about WM-RF. My question is how does the system determine the traffic light color in the RF monitor screen (LRF1). I read the SAP help portal and compare it to the screen and it still doesn't make any sense out of it.. On the S

  • I cant get my mac to recognise the internal dvd drive on my imac

    my mac is running hot to the touch and i cant get the imac to recognise any dvd i put in

  • Danish letters () in email adress

    i am trying to send a mail with the letter in the email-adress. It is groupwise that Blocks for sending the mail. Does anyone know have i fix it. kindly regards Henrik

  • Vpn from 40 Server to Main One

    I need to build this scenarios: 40 slave servers with win2003 need to connect to main one(is a dc) with data encryption, the main one using the ipsec vpn to start query to the 40 servers(only when it needs outside data). Actualy i have in production