How to find out top 10 records from the R/3 using Java code (WD Program)

Hi Experts,
I have used Java Web Dynpro program to fetch records from the backend. Following code helps me and fetches record. As per the customer reqirement, we have to fetch only top 10 records (Actual Cost) from the backend. So I have to modify the Java code. How I can do so? Please help.
          wdContext.nodeGraphData().invalidate();
          IPublicCostcnt.IGraphDataElement categoryElement;
               for (int i = 0; i < wdContext.nodeItab_Final1().size(); i++) {
               categoryElement = wdContext.createGraphDataElement();
               categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
               categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
               categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
               wdContext.nodeGraphData().addElement(categoryElement);
Regards,
Gary

Dear SDN Users,
This is how I resolved the issue.
1) Requested ABAPer to provide me sorted data. The data has been sorted in descending order of actual_cost.
2) After that I used following code. This resolved the issue.
     if (wdContext.nodeItab_Final1().size()>10){
     IPublicCostcnt.IGraphDataElement categoryElement;
          for (int i = 0; i < 10; i++) {
          categoryElement = wdContext.createGraphDataElement();
          categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
          categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
          categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
          wdContext.nodeGraphData().addElement(categoryElement);
     if (wdContext.nodeItab_Final1().size()<=10){
     if (wdContext.nodeItab_Final1().size()>0){
     IPublicCostcnt.IGraphDataElement categoryElement;
          for (int i = 0; i < wdContext.nodeItab_Final1().size(); i++) {
          categoryElement = wdContext.createGraphDataElement();
          categoryElement.setCostElement(""+ wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getDescription());
          categoryElement.setActualCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getActual_Cost().toString());
          categoryElement.setPlannedCost(wdContext.nodeItab_Final1().getItab_Final1ElementAt(i).getPlan_Cost().toString());
          wdContext.nodeGraphData().addElement(categoryElement);
Regards,
Gary

Similar Messages

  • How to find out which type of the driver is used in our application?

    Hi all,
    can anyone tell me how to find out which type of the driver is used in our application?
    Thanks in advance,
    Phoeniox

    Hi,
    Check out this...
    Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
    List drivers = Collections.list(DriverManager.getDrivers());
                   for(int i=0;i<drivers.size();i++)
                        Driver driver = (Driver)drivers.get(i);
                        String driverName = driver.getClass().getName();
                        System.out.println("Driver "+i+":::"+driverName);
    you need to load the driver and display in the same program.
    Then only you'l get the required result.
    prakhyath

  • How to print out multilingual reports from the main report using Xliff temp

    Hi all,
    How to print out multilingual reports from the main report using Xliff temp?
    When I want main report call subtemplate and finish xliff tranlation
    <?for-each@section:INVOICE?><?end for-each?>
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    <?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
    Prints out fine with Finnish translation
    But if I want in main program to check what language is used e.g.
    if trx_number = 142 call Finnish translation and if trx_number =144,
    call English translation.
    <?for-each@section:INVOICE?><?end for-each?>
    <?if:TRX_NUMBER=’142’?>
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    <?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
    <?end if?>
    <?if: TRX_NUMBER=’144’?>
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.US/?>
    <?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
    <?end if?>
    Prints out always in English and never the Finnish translation.
    Program goes fine to if branch but does not print out Finnish
    Does anybody know what could be wrong?
    BR
    Kari

    Thanks Amit,
    I have two layout, main-layout and sub-layout
    Main layout call subtemplate
    I have registered layout and xliff-file
    Main template
    Localized Templates
    File Name           Language Territory
    XXNS_INVOICE_MAIN.rtf      English
    SUB template
    Localized Templates
    File Name           Language Territory
    XXNS_INVOICE_SUB.rtf      English
    Translatable Template
    File Name           Language      Territory
    XXNS_INVOICE_SUB.rtf      English      United States
    Available Translations
    Language Territory Progress
    English Finland Complete
    If main report call subtemplate and finish xliff tranlation
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    Prints out fine with Finnish translation
    But if I want in main program to check what language is used e.g.
    if....
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    .....end if;
    if....
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.US/?>
    .....end if;
    Prints out always in English and never the Finnish translation.
    Program goes fine to if branch but does not print out Finnish
    Do you it's set up problem or program problem
    BR
    Kari

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • How to move to next record of the databank file using custom code

    hi,
    can someone please tell me how to move to next or the previous record the Databank file. i found a funtion setcurrentdatabankrecord(), but i am not able to use it.
    thanks in advance...

    Hi,
    I recently had the same problem, here's my solution:
    "setCurrentDataBankRecord" is available only to External Program Control.
    I used the VB of an empty Word2002 Document.
    1. you have to reference the webAnlyst.exe in the object-catalogue
    2. create a module via the menue
    3. type in the code
    This is the code I used - some of the code is just for control
    Private Sub TestSetDBRec()
    Dim pdtest As webanlst.ProgT
    Set pdtest = New webanlst.ProgT
    Dim currDBI, numRecsCurrDB As String
    ' Workspace öffnen
    pdtest.play.OpenWorkspace "VBTest"
    ' Script öffnen
    pdtest.play.openScript "BM2B_VK_Änderung"
    ' DB-Abfragen
    numRecsCurrDB = CStr(pdtest.play.getDataBankSize)
    currDBI = pdtest.play.currentDatabankIndex
    pdtest.play.setCurrentDataBankRecord (2)
    currDBI = pdtest.play.currentDatabankIndex
    ' jetzt das Script abspielen
    pdtest.play.doScript "BM2B_VK_Änderung"
    End Sub
    This works! You can also looping through the database by getting the current value and set the value back increased by e.g. one
    Hope it is helpful!

  • HOW TO  FIND OUT TABLE DESCRIPTION FROM JDBC?

    HOW WILL FIND OUT TABLE DESCRIPTION FROM JDBC?

    Have a look at ResultSetMetaData
    getColumnCount()
    getColumnName(int)
    getColumnTypeName(int)
    getColumnDisplaySize(int)
    ***Annie***

  • How to find out who has deleted the production Query

    Hi All,
    I have searche SD , i can find it for infoobject deletion but i couldn't find it for Query.
    Please let me know is there any possiblity to kow
        How to find out who has deleted the production Query
    Awaiting for your replies.
    cheers

    Hi Mahesh and all,
    Thanks for all your  inputs.
    I have tried with RSRREPDIR tabel , I am unable to see that query at all.
    If I use theT-code SLG1,
      please guide me on the steps with paramets to be given in the respective ..object, subobject etc..
    OR
    could you please suggest any other way.
    cheers
    leena

  • How to find out who had deleted the function moldule? S O S

    how to find out who had deleted the function moldule Thank you very much.

    if this fm was assigned to device class (package) you'll find it in
    tables tadir, e070, e071
    try with name of function module or function group
    hope that helps
    Andreas

  • How to find out what are all the change pointers assoicated for an idoc ??

    Hi ,
    How to find out what are all the change pointers activated for an idoc ??
    Thanks,
    Varma

    Verma,
    You can check what are the active Change Pointers for the message type in tcode <b>BD50</b>
    Use tcode <b>BD61</b> to check whether change pointers are active or not??
    Hope this helps..

  • How to find last inserted record in the table.

    Version: Oracle 10g
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".
    As i come to know that Rowid is not result perfect results. Please provide your inputs.

    user13416294 wrote:
    Version: Oracle 10gThat is not a version. That is a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".Not possible as your data model does not cater for it. That simple.
    If there is a need to determine some order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or more attributes are needed to represent that information. Thus your data model in this case is unable to meet your requirements.
    If the requirements are valid, fix the data model. In other words - your question has nothing to do with Oracle and nothing to do with rowid, rowscn or other pseudo columns in Oracle. It is a pure data modeling issue. Nothing more.

  • How to get the values from struct data type using java code..?

    Hi ,
    I am newer to java.
    we are using oracle database.
    How to get the data from struct data type using java code.
    Thanks in Advance.
    Regards,
    kumar

    Hi Rajeev,
    To retrieve a FilterContainer you will need to traverse the report structure:
    ReportStructure boReportStructure = boDocumentInstance.getStructure();
    ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
    FilterContainer boFilterContainer = null;
    if (boReportContainer.hasFilter()) {
         boFilterContainer = boReportContainer.getFilter();
    } else {
         boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
    Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
    Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
    Hope this helps.
    Regards,
    Dan

  • System log - how to find out who has deleted the req from cube.

    ^hello friends
    how can i find out who has deleted the request from cube ?
    i wanted to check the system log , that who has deleted the request from cube .
    could you please let me know how to check the same ?
    regards
    manoj

    Hi,
    Did you try the method I had suggested. It will work.
    Also its better to try the path I had suggested as it will display the logs for that particular Cube only.
    But if go through SM37 > B_DEL* it will display all the logs for all the deletion jobs not just this cube and it will be difficult to find out.
    Try that and you should get the log.
    Thanks,
    JituK

  • How to find out which user has the permission to execute startsap ?

    Hi All
    How do I find out which user has the permission to execute the startsap and stopsap? Do I control the permission on those script using windows standard authorization? For example: only allow certain user have the read and write permission?
    Thank you.!
    Vincent Lo

    Well to me this is really weird question..
    <b>noone un-authorized should have access to OS on your system</b>
    If this is valid you do not need to solve problems who can and who cannot start/stop SAP, because if you want to prevent some users from shutting down the SAP you have really hard job to do - there are many ways how to kill the SAP (for example killing relevant process from task manager, killing of database, messing with services etc.) - yes, this is harmful way of stopping SAP, but we are talking about attack, right? I would contact some Windows specialist to help you disable all the ways how to harm the running SAP. But still after that - there are many files that can be modified/deleted so SAP will crash after restart - you need to protect them too, etc.
    In case you take the first assumption as granted (and you really limit access to this server) you do not need to worry who can stop or start SAP - at the other hand it may be handy to be able to start/stop SAP from other users - for this you can run the stop/start script "under different user".
    But to answer the question - to me this is question just of access control (but really never tried that myself):
    <a href="http://technet2.microsoft.com/WindowsServer/en/library/c6413717-511e-42bd-bd81-82431afe4b2a1033.mspx">Permit or restrict access to a snap-in for a domain</a> (or see other related links down there on this page)
    Please award points for useful answers.
    Thanks

  • How to find out histotry command from other session

    Hi gurus,
    I use RHEL 5.4
    Some user log onto server with root and make change at some files. How can I find out history command from other session with the same user.
    history command is just give me history commands of my own session.
    Thanks
    Ch

    The file which holds the commandline history is .bash_history in the home directory of the user.
    So in the case of root, /root/.bash_history
    Please mind that if you log in as root, or become root your session will add to that file as well.
    Another issue with the history file is that when multiple sessions are logged in, every session writes in its own version of the same file. So the last one "wins", which means that version is the one which is truly stored.
    If files are changed, a find command with the 'mtime' parameter should be helpful.

  • How to find out table name for the field in the webUI

    Hi.
    I am in CRM2007.
    So i go to the transaction code    BSP_WD_CMPWB
    In that i provide the component name as CRM_UI_FRAME.
    I press the Test button.
    So, it opend the WebUI.
    I want how to find out table of the particular input field?
    I mean from which table the data is retrived how to find out?
    When i enter some thing in the input field how to find out in which table that data is stored?
    By pressing F2 on the input field it opend View and Component Name.
    I want find out table of that particular field. How to find it?
    If anybody know about this explain it with Screen shorts if possible.
    Thank You.
    Krishna. B.

    hi
    goto tx genil_model_browser. Suppose you want to find fields reated to your order header eg sold to name. In component set write all and press F8. Then goto access object and in access object click on node BTAdminH. Click on attribute structure. Here you will find structure and attributes. If you click relationship then you will see all the relationship wrt btadminh. open any r/s that you require. and click on other object and attribute. You will get to know the structure.
    Best regards
    Pankaj kumar

Maybe you are looking for

  • Where can I find a replacement for this?

    This adapter (I guess) broke/got bent so now I'm using the extension cord to charge my MacBook Pro. Where can I buy a replacement for this?: http://i41.tinypic.com/kced7k.jpg http://i41.tinypic.com/2u90jsg.jpg Also, what's it called?

  • I just reinstalled iTunes and can't get it to open; error mesage says it can't find the files so without a program it won't even sync my phone.

    I'm getting this error message "the iTunes library itl cannot be read because it was created by a newer version of iTunes.  When I've tried to redownload it, nothing happens.

  • Java Programming Help

    I'm new to Java programming, and I have a pretty basic question. I'm writing a simple loan calculator, and I need to know how to format the output of my variables to two decimal places. I've been doing this for about a week, so be nice, please. Thank

  • Time series chart in null date

    Hi, everyone Currently using Crystal Reports 2008 Product: 12.7.0.1983 I make time series chart using a line graph. №      X-axis          Y-axis 1        2014/1/1          100 2        2014/1/2            20 3        2014/1/3          null 4       

  • EEWB - How to adjust generation? remove generated field or adjust size

    Hi I have used EEWB(Easy Enhancement Workbench) to add new fields to ORDERADM_H. After EEWB generation I would like to change the length of some fields, remove other fields, and retain some fields exactly as they are. I don't see any way to do this i