Ascending order values??

Hi,
I need some small help regarding writing an algorithm. I want to find out maximum array values for given random array.
sample data:
Input :
A[5] = { 3,2,7,4,1}
//here i'm giving random values in an array
output :
1,2,3,4,7
// here i need output like ascending order
if anybody knows ,please help me.
Thank you,
-balaji

>
I need some small help regarding writing an
n algorithm. I want to find out maximum array values
for given random array.
If you just want the greatest value in an array, the simplest thing is to loop through it like this (assuming at least one element in the array):
int greatest = a[0];
for (int n = 1; n < a.length; n++) {
    if (a[n] > greatest)
        greatest = a[n];
sample data:
Input :
A[5] = { 3,2,7,4,1}
//here i'm giving random values in an array
output :
1,2,3,4,7
// here i need output like ascending order
But if you need to output the array in ascending order you will have to sort the array first. You can use the java.util.Arrays.sort() methods for that purpose:
int[] a = {3,2,7,4,1};
java.util.Arrays.sort(a);
for (int n = 0; n < a.length; n++) {
    if (n > 0) System.out.print(",");
    System.out.print(a[n]);
}S&oslash;ren

Similar Messages

  • How to sort  the arry value in ascending order

    I have a string array where i need to sort the below values in ascending order in the same format...can anyone give me clue on this?
    9.3
    3.1
    9.1
    19.1
    19
    9.4
    9.1.1
    the sorted order should be
    3.1
    9.1
    9.1.1
    9.3
    9.4
    19
    19.1

    You may have easier luck writing your own comparator for this. These are headings in a table of contents, right?
    Write a comparator that tokenizes a string on the '.' character, or use a StringBuffer to remove them, and then order the elements according to the combined numbers. Since alphanumeric would order this list as you want it anyway you could just order that way once the '.' are removed.
    In other words your comparator would do this in the "compare" method:
    public class MyComparator implements Comparator, java.io.Serializable {
    private static Comparator stringComparator = java.text.Collator.getInstance();
    ...constructor(s), your own private "instance" variable of type MyComparator, a getInstance() method of your own, yadda yadda...
    public int compare(Object item1, Object item2) {
    try {
    value1 = removePeriods((String)item1);
    value2 = removePeriods((String)item2);
    if (value1 == null) {
    return (value2 == null) ? 0 : (-1);
    return compare(value1, value2);
    } catch (ClassCastException cce) {
    System.err.println("Wrong Object Type, JackAss!");
    protected int compare(String str1, String str2) {
    return MyComparator.stringComparator.compare(str1, str2);
    private String removePeriods(String value) {
    StringBuffer sb = new StringBuffer(value);
    int decimalIndex = value.indexOf('.');
    while (decimalIndex != -1) {
    sb.delete(decimalIndex, (decimalIndex + 1));
    }

  • How To: Sort Numbers in Ascending Order in a Generated List

    Greetings! How do I set up a Generated List of Paragraphs so that it sorts in true ascending order? What I want is:
    1.1
    1.2
    1.3
    1.4
    1.5
    1.6
    1.7
    1.8
    1.9
    1.10
    I have tried every trick I can think of with the sort order listed on the reference page. But all I can get is something that sorts by individual number (ignoring the numeric value) like:
    1.1
    1.10
    1.11
    1.2
    1.20
    1.21
    1.3
    Any help is much appreciated!

    Hello there, Michael! Thanks so much for looking at my post! Alas, the LOP will not work. I should have explained more, but it was so complicated I thought folks would give up reading.
    Here's the best I can render it without getting permission to share a good example document. I do not blame anyone if it's too cumbersome or convoluted to wade through...
    This is a requirements document which has sort of a "legal" tinge to it--as the document evolves we must maintain traceability for individual requirements. This means, for example:
    Version 1 - I have requirements 1 and 2.
    Version 2 - I need to add a new requirement, which should appear before requirement 1 in the document. Even though it comes before requirement 1 in the document, numerically it will be requirement 3 and requirement 1 will remain requirement 1.
    Version 3 - I need to remove requirement 2. Even though I now have only 2 requirements, their numbers will not change (they remain requirements 1 and 3, appearing in reverse order).
    Version 4 - I need to move requirement 3 to be after requirement 1. Again, the requirements keep their original number, even though their position has changed and there is no longer a "requirement 2" number in use.
    Originally, I told the team (I'm doing this for a different dept), that they would have to hand-number requirements, which they did for a while. But that was getting very cumbersome, and the scenarios above are limited to one or two occurrences per document. So I created an auto-number sequence for them to use in the initial version and added a little smoke-and-mirrors work process to take care of changes in later versions. The last bit of chicanery I cannot get to work is the index...
    Even if there are no changes to the requirements after the initial version, the index still does not sort in ascending numeric order. It was working with the hand-numbered requirements because they were using leading zeros. But without being able to include leading zeros in the auto-numbering formats (I tried the "use a zero as a tab leader" solution and like to have thrown my new monitor out of the window), I cannot find a solution.
    Or rather, I think the solution is "you have to hand-number requirements".
    For anyone who has made it this far, I truly appreciate your time and patience!
    SFT

  • Doesn't Sort data in Ascending order in Hash Table?

    Hello
    I am using JSP, Servlets. After quering in servlets, putting data in HashTable then set attribute in servlets, get attribute in JSP & retrieving data from HashTable in JSP & putting in select html element, data is not coming in ascending order in select drop down box. I need A,B,C,D but it is coming b,d,c,a. When I run query in DB, it shows in sequence but after putting in HashTable, it is not coming in sequence.
    How to make it ascending?
    Looking forward for an early reply.
    Thanks.

    Hi
    Something to do with TreeMap(TreeSet). I tried with TreeSet but it didn't work. Here is the code :
    In servlet :
    Connection lConnection = getConnection(pRequest);
    String lSQL = "";
    Statement lStatement;
    ResultSet lResultSet;
    Hashtable lLtypeHashtable = new Hashtable();
    lStatement = lConnection.createStatement();
    lSQL = "SELECT RCID,RCMEANING FROM REFERENCECODES WHERE RCDOMAIN = 'LOCATIONTYPE' AND RCROWSTATE > 0 order by RCMEANING";
    lResultSet = lStatement.executeQuery(lSQL);
    while(lResultSet.next())
    String lRcid = lResultSet.getString(1);
    String lRcmeaning = lResultSet.getString(2);
    lLtypeHashtable.put(lRcid.trim(),lRcmeaning.trim());
    if(lResultSet != null) lResultSet.close();
    if(lStatement != null) lStatement.close();
    pRequest.setAttribute("LtypeHashtable",lLtypeHashtable);
    //Below Query is executed when one data from select element is selected
    String lLType = DisplayUtilities.getString(pRequest.getParameter("LType"),true);
    //LType is name of select element in JSP.
    if (lLType != null)
    lSQL = lSQL + " AND " + lUpperCaseFunction + "(LOCATIONTYPE)" +
    " = " + DBUtilities.formatString(lLType.toUpperCase());
    pRequest.setAttribute("rLType",lLType+"");
    In JSp :
    <%
    Hashtable lLtypeHashtable = (Hashtable)request.getAttribute("LtypeHashtable");
    %>
    <TR>
    <TD width="15%"> <div align="left">
    <select name="LType" size="1" >
    <option Value="">< Select ></option>
    <%
    if(lLtypeHashtable != null)
    Enumeration enum = lLtypeHashtable.keys();
    while(enum.hasMoreElements())
    String key = (String)enum.nextElement();
    String value = (String)lLtypeHashtable.get(key);
    String flagBack = "";
    if(key.equals((String)request.getAttribute("rLType")))
    flagBack = "selected";
    %>
    <option Value="<%=key%>" <%=flagBack%>><%=value%></option>
    <%
    %>
    </select></div>
    </TD>
    </TR>
    How should I implement TreeSet?
    Looking forward for an early reply.
    Thanks.

  • PO date and Omaterial should display in the ascending order

    Hi experts,
    When i excute the rep0rt the POdate and Material is not displaying in asending order, based on this order am caluculating some other key feild.
    Back ground  this was a Function Module datasource whichwas extraced into BI , Until PSA am getting the values correct. But from Cube the materilal and Podate are not in sequence. How to make these 2 in order. In reporting is there any setting, i tried to display in ascending order  in query properties this not makign any change.
              POdate            Material
    Ex: - 01-0102010   4010100010
            02-01-2010    40101000020
    Regards,
    singam.v

    Hi,
    Please check "Sorting" options in Query Designer.  They are defined for each characteristic placed at rows or columns.
    You can sort according to keys (InfoObject Primary Keys) or Name/Description (InfoObject Texts).  Perhaps the query is sorting but according to a criterion which is different from what it is expected.
    Another thing to take into account is the order in which columns are placed.  Sorting order is defined from left to right.
    For example, if the first column is 0CALDAY and the second is 0MATERIAL, the query first sorts by date and if there are records with the same date, it sorts according to material, and so forth.
    I hope this helps you.
    Regards,
    Maximiliano

  • SSRS Chart to format the date in ascending order

    Hi All;
    I need to sort the dates on Horizontal axis in ascending order
    hence in category group - sorting - i had used teh below formula
    =format(CDate(Fields!goalstartdateValue.Value),"MMM yyyy")
    but it still displays the date as below
    Any help much appreciated
    Thanks
    Pradnya07

    Does it work if you use
    CDate(Fields!goalstartdateValue.Value)
    instead.

  • Ascending Order in Data Level

    Hi Friends,
    I have a table xxx and it has two columns col1 and col2 and below is the data for these columns.
    Col1 Col2
    111 5,6,9,2,1
    211 10,12,8,9
    311 6,7,8,1,2,3,4
    Below is the required output;
    Col1 Col2
    111 1,2,5,6,9
    211 8,9,10,12
    311 1,2,3,4,6,7,8
    I want the column level data in the ascending order. Please help me on this.
    Regards,
    Williams
    Edited by: Williams on Sep 24, 2012 7:11 PM

    Hi, Sankar,
    Here's one way:
    (1) Split each string into multiple rows, one row for each item in the delimited list. (This is how the data should be stored in the frist place.) See {message:id=10095021}
    (2) Use the analytic ROW_NUMEBR (or DENSE_RANK, depending on your requirements) to number the rows 1, 2, 3, ..., using "PARTITION BY col1" to get a separate set of numbers for each value of col1.
    (3) Use String Aggregation to combine the rows into one row per col1. See
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    If you get stuck, post your best attempt, along with a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Simplify the problem as much as possible. Remove all tables and columns that play no role in this problem.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Sorting an array of integers into ascending order

    Today I decided to blow the cobwebs off my old laptop and see what I could remember from my Java days.
    As a task for myself to see what I could remember, I decided to try and write a program that does the following:
    - Declares an array of 4 integers
    - Sorts the array into ascending order, from lowest to highest.
    - Prints on screen the sorted array.
    After an hour or so I finally cracked it, and ended up with a working program. Here she is:
    public class Sorting_arrays_1
        public static void main()
           int [] array = {4,3,7,1};
           //A variable used to help with swopping values
           int temporary;
              //finds the smallest number out of elements 0, 1, 2, and 3 of the array, then moves it to position 0
              for (int count = 0; count<array.length;count++)
                int smallestNumber = array[0];
                if (array[count] < smallestNumber)
                    smallestNumber = array[count];
                    temporary = array[0];
                    array[0]=array[count];
                    array[count]=temporary;
             //finds the smallest number out of elements 1, 2, and 3 of the array, then moves it to position 1
             for (int count = 1; count<array.length;count++)
                int smallestNumber = array[1];
                if (array[count] < smallestNumber)
                    smallestNumber = array[count];
                    temporary = array[1];
                    array[1]=array[count];
                    array[count]=temporary;        
              //finds the smallest number out of elements 2 and 3 of the array, then moves it to position 2
              for (int count = 2; count<array.length;count++)
                int smallestNumber=array[2];
                if (array[count] < smallestNumber)
                    smallestNumber = array[count];
                    temporary = array[2];
                    array[2]=array[count];
                    array[count]=temporary;     
             //prints the array in ascending order
             for (int count=0; count<array.length;count++)
                 System.out.print(array[count] + " ");
    }Could this code be simplified though? Maybe with a for loop?
    I mean, it does the job, but it looks so clumbsy and inefficient... Imagine how much code I would need if I wanted to sort 1000 numbers..

    Use bubble sort if u want a quick fix
    public static void bubbleSort(int [] a)
    for(int i=0; i<a.length-1; i++)
         for(int j=0; j<a.length-1-i; j++)
              if(a[j]>a[j+1])
                   int temp = a[j];
                   a[j]=a[j+1];
                   a[j+1]=temp;
    Or use Merge sort if u want better run time... ie.(N log N)

  • Display ascending order

    i have retrived database data using below statement in jsp page, now i want to retrieve values in which it display ascending order of vou_no....
    the vou_no is as follow:
    BP0101001
    BP0101002
    BP0101003
    BP0101004
    ("select * from pay_header, pay_detail where pay_header.vou_no = pay_detail.vou_no and pay_header.vou_no like 'BP%' ");

    thanx for u r help
    is there possible that i got a record from database, which is greater than all the voucher no.
    it should fetch a full record for that particular record.
    i have used following..but its coming error...
    sql = conn.prepareStatement("select max(pay_header.vou_no) from pay_header,pay_detail where pay_header.vou_no=pay_detail.vou_no and pay_header.vou_no like 'BP%' ");

  • Open Sale Order Value (FD33) not getting diminished even after closing SO?

    Hi,
    Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
    What could be the reason ?
    Pls help.
    Regrds,
    Binayak

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • Rajesh/Sadhu/RobertoUrgent :- Open Sale Order Value not getting Reduced?

    Hi,
       Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
       What could be the reason ?
       Pls help.
    Regrds,
    Binayak
    Message was edited by:
            Binayak Ghosh
    Message was edited by:
            Binayak Ghosh

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • Not Updating Open Sales Orders Value for CreditManagement

    Hi Frendz,
    This is the first time am implementing creditmanagement in my system tested simple credit limit check working fine.
    Now testing Static and Dynamic(Automatic) it also working fine but Its not caliculating open sales orders value either static or dynamic while Creating s.o, settings made clicked on open s.o, i have already created sales orders value of 10th.
    EX:- customer balance is 2lacs, credit limit is 1lac while creating s.o it always showing balance 1lac only(Instead of 1lac10th) with open sales order value  is 10th.
    Let me know Where i have missd settings.
    Hari Prasad

    hello,
    it is maintained against the cr control area in ent structure.
    one needs to change there.
    r u in prd system or development?
    becoz if prd, then this change will effect a lot of ongoing docs.
    rgs,
    AK

  • SQL Open Sales Orders Value using today's currency rates

    Hi experts,
    I am creating a report for displaying the open sales order values (and other fields) using current currency rate (where applicable). I developed the below query. The only problem with this query is that it ignores the order rows in which the currency field is blank (Don't understand why this happens in SAP). Do you have other ideas?
    Thanks & Regards,
    IC
    SELECT 
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name",  T1.ItemCode, 
    T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM',  T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)", T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod, ORTT T4 WHERE T0.DocCur <> 'GBP' AND T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T1.OpenQty > 0
    UNION ALL
    SELECT
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date", T0.CardCode as "Cust Code", T0.CardName as "Customer Name", T1.ItemCode, T1.Dscription, T3.ItmsGrpNam, T1.U_SU, T1.U_SULEN, T1.U_SUQTY, T2.InvntryUom as 'Stock UOM', T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.LineTotal AS "Ord Value (GBP)", T1.LineTotal/T1.Quantity*T1.OpenQty AS "Open Qty Val (GBP)", T1.LineTotal/T1.Quantity AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)",T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T1.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date", T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T0.DocCur = 'GBP'  AND T1.OpenQty > 0 ORDER BY 2,1

    Hi,
    Try:
    SELECT 
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name", 
    T1.ItemCode,  T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM', 
    T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered",
    T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)",
    T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)",
    T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)',
    T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    LEFT JOIN ORTT T4 ON T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T4.Rate != 0
    WHERE T0.DocCur != 'GBP' AND AND T1.OpenQty > 0
    Thanks,
    Gordon

  • Open sales orders value not updating currectly in sales value of CM

    Hi SAP experts,
    I have an issue some of customers credit exposure value showing worng value.We are using static credit limit check.
    customers credit limit RM20000,
    open sales order valueRM6,073.77
    open delivery=0
    open billing =0
    open items(recievables)=3,464.39
    Credit exposure =9,538.16.
    But i have checked in VA05 its showing 13,001.10 value, i have checked all areas didnt get any solution.
    I have run the reports RVKRED09 and RVKRED77 , RVKRED88 also no updates in the credit management.
    is there any other areas i need to check, advise me.
    Regards,
    Nooka

    The only thing you really need to check is RVKRED88.
    It is not the correct procedure to compare the open sales order value with the sum net value of VA05.
    In VA05 open documents are displayed indifferent whether they are already part-delivered or not. That's why the open values from the VA05 are not directly comparable with the values in RVKRED77.
    As described in OSS note 716141; reports RVKRED88/77 shows the correct value which should be in your system.
    If you need to know more let me know.
    Thanks,
    Gerard

  • KEY FIGURE: Effective purchase order value & K.F "No. of Purch.Orders"

    Yo my fellow Gurus,
    Got a problem, when executing listcube on the Info-Cube 0PUR_C01 - I see the data/amounts in the column for "Effective purchase order value" / 0ORDER_VAL. But when running the query with the Key Figure I just get "0"
    I tried the option of adding the Process Keys not allocated in the Routine list of keys, yet still nothing has popped in the query, and heres the routine after  additonal keys added:
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    INCLUDE RS_BCT_MM_UPDATE_RULES.
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS2LIS_02_SCL
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BI0/V0PUR_C04T-ORDER_VAL
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    IF ( COMM_STRUCTURE-PROCESSKEY = '001' or     "Bestellung
        COMM_STRUCTURE-PROCESSKEY = '011' or
    *change of keys
        COMM_STRUCTURE-PROCESSKEY = '015' or
        COMM_STRUCTURE-PROCESSKEY = '005' or
        COMM_STRUCTURE-PROCESSKEY = '025' or
        COMM_STRUCTURE-PROCESSKEY = '041' or
        COMM_STRUCTURE-PROCESSKEY = '051' or
        COMM_STRUCTURE-PROCESSKEY = '061' or
    *change of keys
        COMM_STRUCTURE-PROCESSKEY = '021' or
        COMM_STRUCTURE-PROCESSKEY = '004' or       "LP
        COMM_STRUCTURE-PROCESSKEY = '014' or
        COMM_STRUCTURE-PROCESSKEY = '024' )
        AND COMM_STRUCTURE-BWAPPLNM EQ 'MM'
        AND COMM_STRUCTURE-ORDER_VAL <> 0.
        perFORM LOC_CURR_CONVERT
               USING    COMM_STRUCTURE-ORDER_VAL
                        COMM_STRUCTURE-DOC_DATE
                        COMM_STRUCTURE-ORDER_CURR
                        COMM_STRUCTURE-LOC_CURRCY
                        COMM_STRUCTURE-EXCHG_RATE
               CHANGING RESULT.
    if the returncode is not equal zero, the result will not be updated
        RETURNCODE = 0.
    else.
        RETURNCODE = 4.
    endif.
    if abort is not equal zero, the update process will be canceled
    This seems to be also the issue with my other Key Figure "No. of Purch. Orders" except here it the just comes up blank / 0 . This is to some the number of pos per plant for the month. So it's not storing anything but running via an interface and then with the aid of the routine loading the count into the cube:
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS2LIS_02_HDR
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BI0/V0PUR_C04T-NO_PUR_ORD
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
      if COMM_STRUCTURE-HDRPROCESS = '01'         "Bestellung
         AND COMM_STRUCTURE-no_hdr <> 0.
    result value of the routine
        RESULT = COMM_STRUCTURE-no_hdr.
    if the returncode is not equal zero, the result will not be updated
        RETURNCODE = 0.
      else.
        RETURNCODE = 4.
      endif.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Please advise the way forward.
    Thanks,
    Ishaam

    what do u want?

Maybe you are looking for

  • How to print a something in oracle sql developer

    Hello all Do you know How to print a something in oracle sql developer? i mean for example in the query we write something, (offcourse i dont mean comments) thank u in advance. best

  • Bus error - Help!

    Hi, I've been asked to see if I can fix a C program so that it will run on a mac. It currently compiles and runs perfectly on a linux machine, but as soon as you run it on a mac, it will compile, but quit with a bus error very early on. The full code

  • Computer won't boot, all I get is a black screen

    I'm using Vista home premium and everything was working fine up until the other day. My computer froze up and I shut it down to restart. Upon restarting, I was given the option to start windows normally or in safe mode. I selected to start up windows

  • Help with AW CD

    Hi All, thanx for all efforts being made by the mates here i'm distributing a CD rom with an AW exe file in it. The exe file contains several shockwave files(dcr). when i run the project file(exe file), shockwave files don't work. i guess this happen

  • User tables SU01

    Hi, I'm looking for the user master tables where the "Last name" and "First name" are. Field NAME_LAST and NAME_FIRST are in a structure named ADDR3_DATA. Where the above fileds are ?