Scripts:totaling of all items

hi
i am facing a small problem
actually i used the below code  for summing of all items coming into g_dmshb  and g_mhngf.
but am not able to get get  overall total   am able to get only for last two items
can u suggest me whether the above code is correct or not
thank u
LOOP AT INTAB WHERE NAME = 'F150D-MHNGF' .
    IF SY-SUBRC = 0.
MOVE INTAB-VALUE TO G_MHNGF1.
  G_MHNGF1 = INTAB-VALUE .
  ENDIF.
ENDLOOP.
  G_TOT2 = G_DMSHB + G_MHNGF1.
  DATA G_TOT3(15).
  CLEAR OUTTAB.
READ TABLE OUTTAB WITH KEY NAME = 'G_TOT2'.
  IF SY-SUBRC = 0.
  WRITE G_TOT2 TO G_TOT3 CURRENCY 'GBP'.
    OUTTAB-VALUE = G_TOT3.
    CONDENSE OUTTAB-VALUE NO-GAPS.
    MODIFY OUTTAB INDEX 1 TRANSPORTING VALUE.
  ENDIF.

Hi,
There is an error in your logic see my comments at the side of your code.
LOOP AT INTAB WHERE NAME = 'MHND-DMSHB' .
if sy-subrc = 0.
replace ',' in intab-value with '' .
condense intab-value no-gaps.
Here the value of intab-value is moved to g_dmshb
move intab-value to g_dmshb.         
endif.
*g_tot1 = g_dmshb + intab-value.
g_tot2 = g_tot1 + intab-value.
reAD TABLE INTAB WITH KEY NAME = 'F150D-MHNGF'.
IF SY-SUBRC = 0.
MOVE INTAB-VALUE TO G_MHNGF1.
*G_MHNGF1 = INTAB-VALUE .
ENDIF.
Now here you add it to g_tot2
g_tot2 = g_dmshb + g_mhngf1.
endloop.
In accumulating a value the logic shoud be like
Loop
   a = a + b.
endloop.
So your code should look something like this
LOOP AT INTAB WHERE NAME = 'MHND-DMSHB' .
if sy-subrc = 0.
replace ',' in intab-value with '' .
condense intab-value no-gaps.
move intab-value to g_dmshb.
Here you add g_dmshb to g_tot2
add g_dmshb to g_tot2.
endif.
reAD TABLE INTAB WITH KEY NAME = 'F150D-MHNGF'.
IF SY-SUBRC = 0.
MOVE INTAB-VALUE TO G_MHNGF1.
ENDIF.
Here you add g_mhngf1 to g_tot2 so you have the sum of
both for entries with name = MHND-DMSHB and F150D-MHNGF
g_tot2 = g_tot2 + g_mhngf1. "<- should be like this
endloop.
If you want an optimized code try this one below.
LOOP AT INTAB WHERE NAME = 'MHND-DMSHB' .
IF sy-subrc = 0.
  REPLACE ',' IN intab-value WITH '' .
  CONDENSE intab-value no-gaps.
  MOVE intab-value TO g_dmshb.
ENDIF.
READ TABLE INTAB WITH KEY NAME = 'F150D-MHNGF'.
IF SY-SUBRC = 0.
  MOVE intab-value TO g_mhngf1.
ENDIF.
Here you add g_mhngf1 to g_tot2 so you have the sum of
both for entries with name = MHND-DMSHB and F150D-MHNGF
code should be like this:
g_tot2 = g_tot2 + g_dmshb + g_mhngf1.
ENDLOOP.

Similar Messages

  • Printing only one line record with total of all items through alv

    hi experts,
    i am facing a problem while printing a list through alv.
    requirement is, suppose i have 3 line items under one document no.
    i have to print only one record with total amount of all items.more clearly...
    1001  10  1000/-
    1001  20    234/-
    1001  30   540/- these records in internal table then i am passing it to reuse_alv_grid_display.
    i need to display only 1001  1774/-(means sum of all the items)
    please tell me how to do this.
    thanks in advance,
    manasi

    hi ansari,
    contains in itab
         3000000004     02.11.2000     5550     27.95     27.95     0
         3000000004     02.11.2000     5550     10.95     10.95     0
         3000000005     02.11.2000     5550     27.95     27.95     0
         3000000005     02.11.2000     5550     10.95     10.95     0
         3000000006     02.11.2000     3020     52.99     52.99     0
         3000000006     02.11.2000     3020     64.99     64.99     0
         3000000006     02.11.2000     3020     49.5     49.5     0
         3000000007     02.11.2000     3730     2,228.00     2,228.00     0
         3000000007     02.11.2000     3730     1,698.00     1,698.00     0
         3000000007     02.11.2000     3730     532     532     0
    now please tell me how to print the data
    output will be
    3000000004     02.11.2000     5550     38.90     38.90       0
    3000000005     02.11.2000     5550     38.90     38.90       0
    3000000006     02.11.2000     3020     117.19     117.19     0
    like that
    please help me out
    manasi

  • CRYSTAL 8.5.. NOT PULLING ALL ITEMS INTO TOTAL

    HELLO, WE ARE USING 8.5 AND NOW IT ISN'T PULLING ALL OF THE DATA NEEDED FOR A LINE TOTAL.  WHILE TRYING TO FIGURE OUT WHAT HAPPENED, WE FOUND THE SPECIFIC ITEMS "SUPPRESED", AND CORRECTED THAT, HOWEVER ALL ITEMS ARE NOW LISTED AS THEY SHOULD BE, BUT NOT BEING INCLUDED IN THE TOTAL... ANY ASSISTANCE WOULD BE APPRECIATED IF YOU KNOW HOW TO CORRECT THIS,

    Hi, 
    Are you using a running total to or are you summarzing the numbers?  If you are using a running total, where on the report is the formula totalling, is it in the Detail section, Footer? 
    When you show the running total formula, can you actually see which records are not totalling? 
    It's always possible the formula is missing something.  If you created a simple running total like: 
    WhilePrintingRecords;
    NumberVar MyTotal;
    MyTotal := MyTotal + {table.FIELD};
    Do the same records total or are they also being skipped? 
    Are you initializing or reinitializing the running totals somewhere in the report?  Possiblly in a Group or Page header? 
    Crystal 8.5 didn't have any problems that I could remember with running totals, I made literally hundreds of reports with running totals in that version so I'm more inclined to look at the formula and how the running total is setup. 
    Good luck,
    Brian

  • Use Windows PowerShell to count and list total number of items in Folders E-Mail in Office Outlook?

    I have the need to generate a list of all outlook folders and the total number of items listed beside each folder name. I thought I could simply modify the script from " http://blogs.technet.com/b/heyscriptingguy/archive/2009/01/26/how-do-i-use-windows-powershell-to-work-with-junk-e-mail-in-office-outlook.aspx
    " regarding the total number of items in the junk folder but no luck.
    I thought I could just simply duplicate line 6 of the aforementioned script
    "$folder = $namespace.getDefaultFolder($olFolders::olFolderJunk) " and change the folder name but getting the "Method invocation failed because [Microsoft.Office.Interop.Outlook.OlDefaultFolders] does not contain a method
    named 'olFolder'.
    At line:7 char:1
    + $folder = $namespace.getCurrentFolder($olFolders::olFolder("Design Engineering S ...
    I've found a way to export a list of all these folders using exportoutlookfolders.vbs to a txt file but doesn't include total number of items.
    Looking for any pointers on how to make this work. Don't expect anyone to write it for me but I am still learning PS. Would be great to find a way to import all of these folder and subfolder names into the script. Will be appreciative of any advice though.
    There's an enormous amount of Outlook folders.
    Outlook 2013
    Windows 8
    Thanks,
    Barry

    Since I am not and administrator, but an end user, I do not have access to the Get-Mailxxxx commandlets to make this really easy and had to do this long hand.
      The following will pull folder.name, folder.items.count, and sum the total size of each folder's items for all folders and their subs. 
    Just one warning, the summation can take some time with a large PST file since it needs to read every email in the PST. 
    There is also some minor formatting added to make the results a little more readable.
    $o
    = new-object
    -comobject outlook.application 
    $n
    = $o.GetNamespace("MAPI") 
    $f
    = $n.GetDefaultFolder(6).Parent 
    $i
    = 0
    $folder
    = $f
    # Create a function that can be used and then re used to find your folders
    Function
    Get-Folders()
    {Param($folder)
     foreach($folder
    in $folder.Folders)   
    {$Size =
    0
    $Itemcount
    = 0
    $foldername
    = $folder.name
    #Pull the number of items in the folder
    $folderItemCount
    = $folder.items.count
    #Sum the item (email) sizes up to give the total size of the folder
    foreach ($item
    in $folder.Items)
    {$Itemcount
    = $Itemcount
    + 1
    $Size =
    $Size +
    $item.size
    Write-Progress -Activity ("Toting size of "
    + $foldername
    + " folder.")
    -Status ("Totaling size of "
    + $Itemcount
    + " of "
    + $folderItemCount
    + " emails.")
    -PercentComplete ($itemcount/$folderItemCount*100)
    # just a little formating of the folder name for ease of display
    While($foldername.length
    -le 19){$foldername
    = $foldername
    + " "}
    #Write the results to the window
    Write-Host ("-folder "
    + $foldername
    + "  
    -itemcount " +
    "{0,7:N0}" -f
    $folderItemCount +
    "   -size " +
    "{0,8:N0}" -f ($size/1024)
    + " KB")
    #If the folder has a sub folder then loop threw the Get-Folders function.
    #This two lines of code is what allows you to find all sub folders, and
    #sub sub folders, and sub sub sub for as many times as is needed.
    If($folder.folders.count
    -gt 0)
    {Get-Folders($folder)}
    get-folders($folder)

  • Total of particular items of various open sales orders for particular cust

    HI.. following are my Items code  :
    2009,  8010, 8016, 9831, 27363, 27361, 27360, 27181, 16095.
    i want the report that consists of all items to be delivered to the customer. I  have created the following query :
    SELECT T0.CardName AS 'Dept_Name',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') '2009',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') '8010',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') '8016',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') '9831',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') '27363',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') '27361',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') '27360',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') '27181',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') '16095'
    FROM ORDR T0
    but i want the total of particular items of various open sales orders for particular customer.
    pls improve the above query.
    thanks
    reema

    Hi,
    Try this
    SELECT T0.CardName AS 'Dept_Name',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') '2009',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') 'All 2009',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') '8010',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') 'All 8010',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') '8016',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') 'All 8016',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') '9831',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') 'All 9831',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') '27363',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') 'All 27363',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') '27361',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') 'All 27361',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') '27360',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') 'All 27360',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') '27181',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') 'All 27181',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') '16095'
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') 'All 16095'
    FROM ORDR T0
    Regards,
    Bala

  • Image instead of List Name, and hyperlink the image to view 'All Items.aspx' page

    Hi,
    I would like remove the Page title for list (i.e., name of the list in view all items.aspx page) , and instead use image and hyperlink the image
    to 'All items.aspx" page.
    Using developer tool found the element (#PageTitle) and added 'Script Editor' webpart and below css script to it. I am successful in replace the
    title to image, however, I am unable to add the HTML tag for hyperlink. Where do I need to add or how do I add? Could anyone help me please??
    <style type="text/css">
    #pageTitle
    background-image: url('http://w2k81368:2116/SiteAssets/Test.jpg');
    background-repeat:no-repeat;
    text-indent: 100%;
    white-space: nowrap;
    </style>
    Regards,
    Sunitha

    Hi Sunitha,
    According to your description, my understanding is that you want to change the list title to an image.
    I recommend to add the code below to the list page:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function (){
    var s = "<img alt='SP' src='http://w2k81368:2116/SiteAssets/Test.jpg'>";
    var $t = $("#DeltaPlaceHolderPageTitleInTitleArea span span a");
    $t.html(s);
    </script>
    After that, the list title will change to the image and it will show allitems.aspx page when clicking the image.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • All items are not visible even with no filter

    I have a custom list and am not able to run a search the list, through the "all items" view, even with no filter set.  The list is also set to only view 50 items at a time, but I am not able to view the next batch of items.  The search
    will give no results even when the list contains the item with that specific information.

    Hi,
    1) I understand you are not able to view the 'All Items' in the list.
    Can you check the total number of items that list contains.
    Go to Site Actions-->View All site content see the number of items beside the list name( right side)
    I suspect the list might be reached the threshold value.
    2) If the number of Items are less than the threshold value then I would suggest you do a  test by creating another view by providing only the view name (Don't use any sort, Filter, Groupby ...etc) and just keep the default settings and let me
    know if you are able to see the items using the newly created view.
    ****************************************************************************************** Please remember to mark your question as answered &Vote helpful, if this solves/helps your problem.
    s p kumar

  • I want to check/see the total quantity of items from fixed asset module

    Dear All,
    When I create purchase requisitions or purchase order, at the time of selection of items (Printer etc)…
    I want to check/see the total quantity of items from fixed asset module.
    Please guide, me how can I see the total items are available in fixed assets, on purchase order
    Product Detail
    Database Server
    RDBMS : 10.2.0.5.0
    Oracle Applications : 11.5.10.2
    Machine : ofadb.thecityschool.edu.pk
    User : APPS
    Oracle SID : PROD
    System Date : 16-APR-2012 13:27:37
    Database Server PID : 13485
    Session SID : 1437
    SERIAL# : 12175
    AUDSID : 32767692
    Database CPU Usage (in secs) : 0.69
    Regards

    Oracle does not offer this functionality.
    You will have to write a personalization that will query FA based on the item and display the message to the user.
    To invoke this personalization, the user may have to go to tools > show FA. This Show FA is a new option you create by personalization.
    Sandeep Gandhi

  • F-48 -  Withholding tax amount exceeds total bank line item amounts.

    Dear all
    In F-48 i am getting following error msg,
    Withholding tax amount exceeds total bank line item amounts.
    Message no. 7Q320
    All Config settings or ok.
    Kindly suggest with suitable solution.
    With thanks
    Jai

    Dear,
    Select Relevant to cash flow field for Bank GL you are using for making down payment.
    Regards,
    Chintan Joshi
    Edited by: Chintan  Joshi on Jan 21, 2010 10:21 AM

  • Price condition - all items

    Hi gurus,
    I have a little problem from a client.
    For example :
    i have 3 items
      item A     gross weight 2kgrs
      item B     gross weight 1,5kgrs
      item C     gross weight 3kgrs
    there is SD order with above items as follows:
      item A  2 pcs  (gross weight : 4kgrs)
      item B  2 pcs  (gross weight : 3kgrs)
      item C  4 pcs  (gross weight : 12kgrs)
    Total gross weight (all items) : 19 kgrs 
    Always the user appends one more item (let say D)
    (that is a specific one).
         Item D  1(always)  pc.
    For this item the pricing comes from a pricelist  like :
           Item D   10Euros  per Kgr
    The problem is that the client wishes  to calculate 
    total gross weight by price(from pricelistlist) and considers
    the outcome as the price per 1pc for item D. That is
             19 kgrs *  10 Euros --> 190Euros (outcome)
    I think, i have to create a condition type  for item D. Is that correct??  What kind of cond.type??(group??)
    Also, is it possible a condition type to be included only for a specific item in a SD order and simultaneously to be excluded for other line items??

    Hi banuman
    As you want to go for another condition type , then you copy the standard PR00 condition type to ZR00 condition type  and then make changes in the ZR00 condition type.
    Assign the new  access sequence in ZR00 condition type which has the key combination of customer / material .
    So as the key combination is different ensure that you are maintaining condition record for ZR00  for the material D and not for PR00.Now when you create the sales order for A,B,C materials you will get PR00 condition type but for D you will get ZR00 condition type.
    Hope this input will help you
    Regards
    Srinath

  • Automatically debugging when calling a script from a menu item

    Hi All,
    I'm coming accross an issue that I was wondering if anyone can help me with or point me in the correct direction.
    I have two start up scripts.
    One runs in the "session" target engine and setups ups some custom menu items and actions which call some other custom scripts.
    The other runs in my own custom session and is used to initialize and share common constants and functions between my custom scripts.
    This all appears to run as expected and clicking on the new menu item calls the correct script however even without the ExtendedScript Toolkit running as soon as i click on the menu item it will load up the ESTK and break on the first line of the script. If I press F5 to continue processing it will finish and runs fine.
    I am currently using the excellent extendables package (http://extendables.org/) to do some HTTP and simplify UI creation which does not specify a session.
    Does anyone know what is causing the scripts to be automatically debugged or is there a setting that might be set to cause this?
    Is this being caused by "session" calling "customSession" using code that will run in the default "main" session?
    this really is irritating me at the moment so if anyone can help it would be much appreciated.
    This is all done using JavaScript in InDesign CS 5.5
    Thanks in advance

    just a quick update.
    After stripping back and stubbing out some code I have been able to trigger a "session" going to my "customSession" then to a non-session (the default) so this is not causing my issue.
    As I mentioned above i am using the extendables package and this appears to be where my issue is arrising. as soon as i include the package:
    #include "extendables/extendables.jsx"
    i get the strange behaviour of it going into debugging mode on the first line of the script being run by my menuItem eventHandler.
    This is without actually using any of the modules available in the extendables package just including it.
    I will try to post a message on the website for this package but if anybody has any ideas about what might be in there that is causing this I would appreciate any ideas/suggestions/theories.
    Cheers

  • Ungroup All Items with JavaScript, Illustrator CS6

    I'm working on pretty complicated Illstrator files. Each file has 20 or so layers, and many of those layers have multiple sublayers. Each of those sublayers contain many grouped items, and those grouped items contain additional grouped items. And so on. There's literally hundreds of groups in each file, and I don't want to manually ungroup them.
    So I'm I writing attempting to write a Javascript to ungroup all grouped items and keep them inside the correct layer. I'm new to Javascript and new-ish to the concept of recursion. My idea is to loop recursively through all the layers, then loop recursively through all the grouped items, then move all items above the grouped items. That seems to be what other people have demonstrated on this forum (or at least how I understood it). I'm posting a screenshot of what I've written so far. What I have ungroups many groups, but errors out eventually. Any replies, ideas, or references would be greatly appreciated. Thanks.

    I think you will find some resources in the Illustrator Scripting forum.
    http://forums.adobe.com/community/illustrator/illustrator_scripting
    Do a search for "ungroup" or something similar.
    http://forums.adobe.com/message/2077311#2077311

  • Table difference Totals vs Line Item

    Dear SDN,
    As do not have access to BW / R/3, I would like your help to know what is the difference between total level record vs a line item level record for FI-SL.
    I would think most of the characteristics and keyfigures are the same for totals and line items table. But what is the difference then? I know line item has more details and totals should be somehow aggregated data. but what is the aggregation factor or field? How is aggregation realised?
    Thanks
    Adette

    I would first tell that normal table connect to fact table will have DIMID( SID will be connected to DIM table), where with the help of line item we will connect the SID (master data) to fact table in cube with out DIMID…
    In a short DIMID will be bypassed with line item so u will see the all table fields in it .
    When the SID table size reach at least 30% of the fact table size then we will go for line item dimension
    think it will help u

  • Header tax conditions....sum of all item level condition

    Dear Gurus,
    I do get item level conditions using KONV.
    Now as per my requirement, I need all these item wise taxes summed up at header level.
    i.e total tax per condition per item.
    Please help me.
    Regards,
    Roshan Lilaram.

    Dear Anil,
    I will get these details item wise.
    I need all these together.
    If i have three items then at the header level i get the total of all these three items.
    I hope i am making my issue clear.
    Regards,
    Roshan Lilaram.

  • Programmatically select all items in a list

    Hi, I've been looking through the online docs trying to find
    a way to programmatically select all items in a list. I have a
    checkbox that when checked should select all items in a list. I
    found a method to clear all selections but not one to select all.
    Did I just miss it? Thanks!

    I don't know of any built-in functions to select all list
    items, but here is an example function to select all items in a
    list:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns="*" layout="absolute">
    <mx:Script>
    <![CDATA[
    [Bindable] private var people_xml:XML =
    <people>
    <person>Jen</person>
    <person>Brian</person>
    <person>Scot</person>
    </people>;
    private function select_all():void {
    var indices:Array = new Array();
    for (var i:uint = 0; i<people_xml.children().length();
    i++) {
    indices.push(i);
    peopleList.selectedIndices = indices;
    ]]>
    </mx:Script>
    <mx:Button x="125" y="10" label="Select All"
    click="select_all()"/>
    <mx:List x="10" y="10" allowMultipleSelection="true"
    dataProvider="{people_xml.person}" id="peopleList"
    labelField="person" width="107"></mx:List>
    </mx:Application>
    Vygo

Maybe you are looking for