To displa ynegative value

hi every body,
when i am trying to get the negative values using DECODE in select statement,
i am unable to get .
decode(y.trx_type, 'Credit Memo', (-1*x.ordered_quantity), x.ordered_quantity)) ordered_quantity
is this statement is correct to gent nagative values??
thanks in advance,
shalus

Unsure the exact question. Display options are handled by the client that does the rendering of data. On the Oracle side, you can set NLS formats and perform data type conversions for the client.
As for using an IF-like condition in a SELECT statement to determine whether a value is positive or negative, the CASE function is ideal. The following example demonstrates:SQL> create table numtab( n number );
Table created.
SQL> insert into numtab select object_id from all_objects where rownum <= 3 union all  select object_id*-1 from all_objects where rownum <= 2;
5 rows created.
SQL> commit;
Commit complete.
SQL> select * from numtab;
         N
       258
       259
       311
      -258
      -259
SQL> select
  2     case
  3             when N < 0 then 'Value '||n||' is negative'
  4     else
  5             'Value '||n||' is positive'
  6     end     as N_RESULT
  7* from   numtab
SQL> /
N_RESULT
Value 258 is positive
Value 259 is positive
Value 311 is positive
Value -258 is negative
Value -259 is negative
SQL>

Similar Messages

  • Script: Subroutine

    tables:bseg
    belnr            bukrs  gjahr   buzei   hkont    wrbtr
    5900000010   0001  2006     001   160000   2000
    5900000010   0001  2006     001   170000   2500
    5900000010   0001  2006     001   180000   3000
    5900000010   0001  2006     001   150000   4000
    5900000010   0001  2006     001   175000   5000
    5900000010   0001  2006     001   177000   150  - tds value(tax value)
      the table having values like this.
    here i want to read the line of hkont =177000and diaplay its corresponding wrbtr value(150).
    (the hkont number b/w 177000-177999.and it is aloted
    for holding tds value).
       each belnr hold only one tds value.
    For normal program it is working fine.can anyone pl tel me how to write subroutine for this requirement.I want to displa this value in form.pl help me out.

    perform get_tds in program ztest
    using &variable for hkont&
    changing &variable for tds&
    endperform
    In ZTEST
    FORM GET_TDS TABLES ITST_INTAB STRUCTURE ITCSY ITST_OUTTAB STRUCTURE ITCSY.
      DATA :
             P_HKONT TYPE C,    
             P_TDS TYPE C.
      READ TABLE ITST_INTAB WITH KEY NAME = 'VARIABLE FOR HKONT'.
      IF SY-SUBRC EQ 0.
        P_HKONT = ITST_INTAB-VALUE.
      ENDIF.
    Write the logic to fetch the TDS value based on p_hkont.
      IF  SY-SUBRC = 0.
        ITST_OUTTAB-VALUE = P_TDS.
        MODIFY ITST_OUTTAB TRANSPORTING VALUE WHERE NAME = 'VARIABLE FOR TDS'.
      ENDIF.
    ENDFORM.                    "GET_TDS

  • How to add one column value with grand total

    hi,
    this is my perform.i am just here multipling  menge and gpres value and stores into G_total variable and displing into output.
    this is my output in main window.
    ex:mat. 1           77.00(g_total value)
        mat  2             55.00(g_total value)
    now the requirement is to add the column and display the output as grand total ex: 77.00 +55.00 = 132.00
    how to do the syntax please help me......???
    FORM get_total  TABLES   in_tab STRUCTURE itcsy
                              out_tab STRUCTURE itcsy.
      DATA: lv_menge(20),
            lv_gpreis(20),
            g_total(20),
            g_total1(20).
      DATA:lc1 TYPE string,
           lc2 TYPE string,
          ls_tab      TYPE itcsy,
         l_tabix        TYPE sy-tabix.
      READ TABLE in_tab WITH KEY name = 'RESBD-MENGE'.
      IF sy-subrc EQ 0.
        lv_menge = in_tab-value.
      ENDIF.
      READ TABLE in_tab WITH KEY name = 'RESBD-GPREIS'.
      IF sy-subrc EQ 0.
        lv_gpreis = in_tab-value.
      ENDIF.
      REPLACE  ',' INTO  lv_gpreis WITH ''.
      CONDENSE lv_gpreis NO-GAPS.
      READ TABLE out_tab WITH KEY name = 'G_TOTAL'.
      IF sy-subrc EQ 0.
        g_total = lv_menge * lv_gpreis.
        out_tab-value = g_total.
        CONDENSE g_total.
        lc1 = g_total+0(2).
        lc2 = g_total+2(3).
        CONCATENATE lc1  lc2  INTO g_total SEPARATED BY ','.
        out_tab-value = g_total.
    CLEAR ls_tab.
        LOOP AT out_tab INTO ls_tab.
          l_tabix = sy-tabix.
          CASE ls_tab-name.
            WHEN 'G_TOTAL'.
              ls_tab-value = G_TOTAL.
          MODIFY out_tab FROM ls_tab INDEX l_tabix.
    ENDCASE.
        ENDLOOP.

    >
    asissahu wrote:
    > hi.
    >
    > nobody is replying my question???
    >
    > please help me
    Hi, Asissahu
    Because may be some one have problem to read your code
    Please have a look at the following link and past code this way.
    [How to post code in SCN|How to post code in SCN, and some things NOT to do...;
    @Naga Please you too
    Regards,
    Faisal

  • How i insert the values in JTable

    Hi,
    Iam new to the swings i have a problem placing the values in JTable while retriving the values from DataBase .Anybody please suggest me..
    i can retriving the values but how i place the vlaues..
    This is My code
    package com.teamone.healthcare;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.DriverManager;
    import java.sql.Statement;
    import javax.swing.JButton;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.WindowConstants;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableModel;
    import com.mysql.jdbc.Connection;
    import com.mysql.jdbc.ResultSet;
    * This code was edited or generated using CloudGarden's Jigloo
    * SWT/Swing GUI Builder, which is free for non-commercial
    * use. If Jigloo is being used commercially (ie, by a corporation,
    * company or business for any purpose whatever) then you
    * should purchase a license for each developer using Jigloo.
    * Please visit www.cloudgarden.com for details.
    * Use of Jigloo implies acceptance of these licensing terms.
    * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
    * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
    * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
    public class ClientList extends javax.swing.JFrame {
         private static final long serialVersionUID = 1L;
         private JScrollPane list;
         private JButton view;
         private JButton close;
         private JTable jTable1;
         Connection con = null;
        Statement st = null;
        ResultSet rs = null;
         * Auto-generated main method to display this JFrame
         /*public static void main(String[] args) {
              ClientList inst = new ClientList();
              inst.setVisible(true);
         public ClientList() {
              super();
              initGUI();
              this.setVisible(true);
         private void initGUI() {
              try {
                        list.setBounds(161, 133, 371, 98);
                        list.getHorizontalScrollBar().setPreferredSize(new java.awt.Dimension(10, 59));
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                   getContentPane().setLayout(null);
              try {
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                    con = (Connection) DriverManager.getConnection("jdbc:mysql:///healthcare","yenmad","yenmad");
                    st = con.createStatement();
                    rs = (ResultSet) st.executeQuery("SELECT User_id, Username, Citizen_ID, First_Name, Phone FROM register_users");
                    while(rs.next()) {
                      int Userid = rs.getInt(1);
                      String Username = rs.getString(2);
                      String ClientId = rs.getString(3);
                      String ClientName = rs.getString(4);
                      //String Last_Name = rs.getString(5);
                      String ContactNumber = rs.getString(5);
                      System.out.println(Userid + ", " + Username + ", " +ClientId  + "," + ClientName +","+ContactNumber);
                  } catch (Exception e) {
                       System.out.println("Exception: " + e.getMessage());
                        list = new JScrollPane();
                        getContentPane().add(list);
                        list.setBounds(0, 0, 644, 217);
                             TableModel jTable1Model = new DefaultTableModel(
                                  new String[][] { { "", "", "","", "" } },
                                  new String[]{ "UserId", "UserName", "ClientId", "ClientName", "ContactNumber"});
                             jTable1 = new JTable();
                             list.setViewportView(jTable1);
                             jTable1.setModel(jTable1Model);
                        close = new JButton();
                        getContentPane().add(close);
                        close.setText("Close");
                        close.setBounds(518, 231, 63, 28);
                        view = new JButton();
                        getContentPane().add(view);
                        view.setText("View");
                        view.setBounds(441, 231, 63, 28);
                        view.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  viewActionPerformed(evt);
                   pack();
                   this.setSize(652, 300);
              } catch (Exception e) {
                   e.printStackTrace();
         private void viewActionPerformed(ActionEvent evt) {
              System.out.println("view.actionPerformed, event=" + evt);
              new ViewClient();
    }

    can i display this table values in vertical .. if yes how can i do that.. please suggest me..
    this is the code iam using but it is displa in horizontally...
    package com.teamone.healthcare;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.DriverManager;
    import java.util.Vector;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.WindowConstants;
    import com.mysql.jdbc.Connection;
    import com.mysql.jdbc.ResultSet;
    import com.mysql.jdbc.ResultSetMetaData;
    import com.mysql.jdbc.Statement;
    public class ClientList extends javax.swing.JFrame {
         private static final long serialVersionUID = 1L;
         /*public static void main(String[] args) {
              ClientList inst = new ClientList();
              inst.setVisible(true);
         public ClientList() {
              super();
              initGUI();
              this.setVisible(true);
         private void initGUI() {
              try {
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                   pack();
                   setSize(600, 500);
                   Vector columnNames = new Vector();
                Vector data = new Vector();
                try
                          this.setSize(500, 400);
                      //  Connect to the Database
                      Class.forName("com.mysql.jdbc.Driver");
                      Connection connection = (Connection) DriverManager.getConnection("jdbc:mysql:///healthcare","yenmad","yenmad" );
                      //  Read data from a table
                      String sql = "Select User_id, Username, Citizen_ID, First_Name, Last_Name, Phone from register_users";
                      Statement stmt = (Statement) connection.createStatement();
                      ResultSet rs = (ResultSet) stmt.executeQuery( sql );
                      ResultSetMetaData md = (ResultSetMetaData) rs.getMetaData();
                      int columns = md.getColumnCount();
                      //  Get column names
                      for (int i = 1; i <= columns; i++)
                       columnNames.addElement( md.getColumnName(i) );
                      //  Get row data
                      while (rs.next())
                            Vector row = new Vector(columns);
                            for (int i = 1; i <= columns; i++)
                                  row.addElement( rs.getObject(i) );
                            data.addElement( row );
                      rs.close();
                      stmt.close();
                catch(Exception e)
                      System.out.println( e );
                //  Create table with database data
                JTable table = new JTable(data, columnNames);
                JScrollPane scrollPane = new JScrollPane( table );
                getContentPane().add( scrollPane );
                JPanel buttonPanel = new JPanel();
                getContentPane().add( buttonPanel, BorderLayout.SOUTH );
                buttonPanel.setPreferredSize(new java.awt.Dimension(200, 66));
                        JButton View = new JButton();
                        buttonPanel.add(View);
                        View.setText("View");
                        View.setLayout(null);
                        View.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  ViewActionPerformed(evt);
                        JButton Close = new JButton();
                        buttonPanel.add(Close);
                        Close.setText("Close");
                        Close.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  CloseActionPerformed(evt);
                        } catch (Exception e) {
                   e.printStackTrace();
         private void CloseActionPerformed(ActionEvent evt) {
              System.out.println("Close.actionPerformed, event=" + evt);
              this.setVisible(false);
         private void ViewActionPerformed(ActionEvent evt) {
              System.out.println("View.actionPerformed, event=" + evt);
              new ViewClient();
    }

  • ECCS- CX0AA- Default Values for Characteristics

    Hello All,
    I have an issue in my project concerned with ECCS.
    We have maintained default values in CX0AA say we have maintained CCA (Sub Item Category) with a particular default value, now this default value has to be removed and even the Sub item Category CCA has to be removed from CX0AA. I tried it by the transaction code CX0A1, but I am unable to do it.
    Can any one please let me know how to remove this default value maintainance in complete from CX0AA.
    Thanks for the help in advance.
    Best Regards,
    Satish

    or in my box: CX01->Master Data->(Characteristic) Default Values
    looks like an extension to add additional fields for consolidation below the standard SAP delivered ones for master data like items and subitems. it may well be dead end for development as EC-CS is being superseded by SEM-BCS and possibly some reincarnation of Business Objects.
    other config transactions in the family are:
    CX0A1                Edit Characteristics               
    CX0A2                Edit Field Groups                  
    CX0A3                Generate Master Data Maint. Modules
    CX0A4                Reorg.View Maintenance (master data)
    CX0A5                Maintain Characteristic Values     
    CX0A6                Display Characteristic Values      
    CX0A7                Maintain Characteristic Values     
    CX0A8                Display Characteristic Values      
    CX0AA                Maintain Default Values            
    CX0AB                Display Default Values             
    CX0AC                Attrib for CU: Maint. Char. Values 
    CX0AD                Attrib for CU: Displ. Char. Values 
    CX0AE                Subassign.: Maintain Char Values   
    CX0AF                Subassign.: Display Char Values

  • How to calcualte average value

    I am using Labview 7.1 with E series card.Iam measuring voltage from a sensor the rang eof voltage is is from 0 to 5 volt. and iam using AI sample. vi to acquire data . iam not using any buffer . but my voltage values are varying very rapidly from 1.23 to 1.26 . when i tested it on MAx i found it gives me avergae value that is not changing. i want to know how can i calcualte the avergae value of my acquire voltage i know the formula of calculating avergae values but how i can apply this formla in this case.

    If you do a search on this forum for "running average" you should find some useful info as this topic has come up.
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=5008&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=140​&message.id=8505&requireLogin=False
    http://sine.ni.com/apps/we/niepd_web_display.displ​ay_epd4?p_guid=B45EACE3EA9756A4E034080020E74861
    This last one looks like one of the examples you will see in the LabVIEW "Help/Find Examples" keyword 'average'
    Good Luck
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to bring values with out loop as per selection criteria

    Hi Everyone,
    We are doing some re-design in IPAD in that i am facing an issue. There is one scenario where sub-action loop has been used(it is an existing functionality). We dynamically bring the question in this loop based on certain seller phase.
    Now they want to bring everything in one screen it self. The table they are looping is complex table.
    Any ideas how we can achieve this problem.
    The idea which i have:
    During fetch i need to loop and this complete table and get these values in to variables, so that i can hide remaining fields based. Is there any other way do it.
    Regards,
    Gupta

    It's difficult to really give steps without knowing your application better but here goes my best shot at it.
    In terms of underlying structures on the client, I am assuming you have a questionsCT, a question object (with the desired fields to displa and a tempQuestions collection on your Main Object to hold the displayed questions.
    1) Create an Edit Transaction on the main object with one property of the tempQuestions collection.  This property should be set to Auto-Initialize.  When this transaction is involved from an action and applied it will clear the tempQuestions collection.
    2) On the question object, create an Add transaction to populate the object fields from the corresponding questionCT current record.  For each of the transaction properties set the Initial Value to "From a different object property" and then browse to the Complex Tables selecting your questionsCT -> current record -> field name.
    3) Create your Add question Action to call the AddQuestion Transaction and Apply.  This will be the action called from your subaction loop.
    4) Create your refresh action with the following steps
        a) Transaction - (#1)
        b) Apply
        c) Sub-Action
            c1) Execution Type: Loop over collection
            c2) Collection: Browse and select your questionsCT
            c3) Execution Rule: Define a new rule to return true if the current record meets your selection criteria
            c4) Action: Seelct your Add question action (#3)
    On your detail screen, I am assuming you will have a dropdown or some similar way to set the selection criteria.  Create a button field that will call your refresh action (#4) and add a tile list control targeting the tempQuesitons collection as it's source.
    This should hopefully get you started in the right direction.
    --Bill

  • Get all values from request.getParameter

    In ASP, I can do something like that...
    For each item in Request.Form
    Response.write "Name is:" & item & " value is:" & Request(item)
    Next
    How about in JSP? How do i get the names and values of the form using a loop?

    You can use request.getParameterNames() which will return an enumeration, then you can iterate through the enumeration and use request.getParameterValue(String paramName) method to get the values.

  • Error while assigning a character value to a numeric variable.

    I fire a sql statement and check the number of rows returned by the sql.
    I check this result with the application logs.
    The application logs keeps the sqls fired by the application and the no of rows returned, in the example below the sql returned 8454 rows.
    My script compares the two results.
    ***********Application Log***********
    4/14/2008 11:15:01 AM: 0059 SQL SELECT "CLUSTER_CD",
    4/14/2008 11:15:01 AM: 0060 "PRODUCT_DESC",
    4/14/2008 11:15:01 AM: 0061 "TEAM_CD"
    4/14/2008 11:15:01 AM: 0062 FROM "OPS$TMS"."MAP_CLUSTER_TEAM_PROD"
    4/14/2008 11:15:01 AM:      3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, 8,454 lines fetched
    ***********Application Log***********
    My script:
    #!/bin/ksh
    typeset -i resA
    typeset -i resB
    opstms_conn_string="abc/[email protected]"
    set `sqlplus -s $opstms_conn_string << EOF
    set pages 0
    WHENEVER SQLERROR CONTINUE
    SELECT count(*)
    FROM MAP_CLUSTER_TEAM_PROD;
    exit
    EOF`
    resA=$1 ##returns 8454
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
    ##resB returns 8,454
    ## here i get syntax error
    if [ $resA -eq $resB ]; then
    echo "QA passed for sql1"
    else
    echo "QA failed for sql1"
    fi
    The problem is as resB is integer variable it does not accept character value: 8,454 so returns a syntax error:
    How do I change the value assigned to resB into a numeric variable?
    error:
    + grep 3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, BCVP_Main_Loader.qvw.log
    run.ksh[52]: 8,454: syntax error

    Change:
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
    to this:
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}' | tr -d ,`
    to drop the comma. Or you could do it in awk(1):
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{ gsub( /,/, "", $10 ); print $10}'`
    Or you could to it all in awk(1):
    resB=`awk '
    /3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD/ {
    gsub( /,/, "", $10 )
    print $10
    ' BCVP_Main_Loader.qvw.log`
    (This example was not tested, it's just for a model.)
    Someone more of an SQL guru than I can probably tell you how to change your numeric locale to avoid presenting those commas in the first place and avoid the problem.
    HTH

  • Issue in Creation of new Value Field in CO-PA

    Hi,
    I have a query in CO-PA Value Field Linking.
    In my Development Client,
    1. Created a New Value Field (No Transport Request Generated)
    2. Linked to the above to new Conditon type created in SD. (Tranport request was generated) i.e. in Flow of Actual Values->Transfer of Billing Documents->Assign Value Fields
    However then i try creating a new Value Field in my Production Client it throws a message 'You have no authorization to change Fields".
    Is this an issue with authorization or i need to transport the Value field too from Development to Production client.
    Please Advise.
    Thanks in Advance,
    Safi

    Thanks Phaneendra for the response.
    The creation of Value field did not create any tranportation request. Will this too be transported if i transport the Operating Concern.
    Please Advise.
    Thanks,
    Safi

  • Query help : Query to get values SYSDATE-1 18:00 hrs to SYSDATE 08:00 hrs

    Hi Team
    I want the SQl query to get the data for the following comparison : -
    Order Created is a Date Column , and i want to find out all the values from (SYSDATE-1) 18:00 hours to SYSDATE 08:00 hours
    i.e.
    (SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 08:00:00.
    Regards

    Hi, Rohit,
    942281 wrote:
    If i want the data in the below way i.e.
    from (SYSDATE-1) 18:00 hours to SYSDATE 17:59 hours ---> (SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 07:59:00.If you want to include rows from exactly 18:00:00 yesterday (but no earlier), and exclude rows from exatly 08:00:00 today (or later), then use:
    WHERE   ord_dtl.submit_dt  >= TRUNC (SYSDATE) - (6 / 24)
    AND     ord_dtl.submit_dt  <  TRUNC (SYSDATE) + (8 / 24)
    So can i use the below format : -
    ord_dtl.submit_dt BETWEEN trunc(sysdate)-(6/24) and trunc(sysdate)+(7.59/24) . Please suggest . .59 hours is .59 * 60 * 60 = 2124 seconds (or .59 * 60 = 35.4 minutes), so the last time included in the range above is 07:35:24, not 07:59:59.
    If you really, really want to use BETWEEN (which includes both end points), then you could do it with date arithmentic:
    WHERE   ord_dtl.submit_dt  BETWEEN  TRUNC (SYSDATE) - (6 / 24)
                      AND         TRUNC (SYSDATE) + (8 / 24)
                                               - (1 / (24 * 60 * 60))but it would be simpler and less error prone to use INTERVALs, as Karthick suggested earlier:
    WHERE   ord_dtl.submit_dt  BETWEEN  TRUNC (SYSDATE) - INTERVAL '6' HOUR
                      AND         TRUNC (SYSDATE) + INTERVAL '8' HOUR
                                               - INTERVAL '1' SECONDEdited by: Frank Kulash on Apr 17, 2013 9:36 AM
    Edited by: Frank Kulash on Apr 17, 2013 11:56 AM
    Changed "- (8 /24)" to "+ (8 /24)" in first code fragment (after Blushadown, below)

  • Unable to capture return values in web services api

    At the time of login to web services if my server is down ,
    it returns following error :
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            at java.lang.String.substring(String.java:1438)
            at java.lang.String.substring(String.java:1411)
    I want to capture this error so that i can try another server to login. how do i capture this error
    Another place where i want to capture the return Value is when i look for a report on the server
    rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
                               "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
    oInfoObjects = rh.getInfoObjects();
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    Here if the report is not there on the server , it returns a null handler exception.
    but if i try catching it by checking my responsehandler is null  like rh == null  it does not catch it.
    Any help will be appreciated
    thanks
    Rakesh Gupta

    Ted : i have two cases
    1)   server = server_st.nextToken();
        providerURL = "http://"server"/dswsbobje/services";
        sessConnURL = new URL(providerURL + "/session");
       Connection boConnection = new Connection(sessConnURL);
       Session boSession = new Session(boConnection);
      EnterpriseCredential boEnterpriseCredential = new    EnterpriseCredential();
                  boEnterpriseCredential.setLogin(userid);
      boEnterpriseCredential.setPassword(pwd);
      boEnterpriseCredential.setAuthType(auth);
    SessionInfo boSI = boSession.login(boEnterpriseCredential);
    I have got a list of servers running web servcies stored in my tokens. when i pass the first server name say " test:8080" and that server is down , i want to catch somewhere in the code above that it did not get the connection so that i can loop back and try with the second server say test1:8080
    This is for failover purposes.
    at present when i was trying to capture return value of boSI it  breaks giving the error
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1438)
    at java.lang.String.substring(String.java:1411)
    2nd case :
    I am geeting reports from the server and scheduling them:
    i run the following code which works fine if reports is there
    rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
    "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
    oInfoObjects = rh.getInfoObjects();
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    Here if  the  report  is not there on the server  then i should be able to catch from the response handle rh that it has got a null value.
    but rh does not return a null value 
    the code ultimately throws a null handle at the following line
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    i am not able to catch the null value there also.
    hope you got my issue.

  • Unable to capture the parameter values from a PL/SQL procedure

    hi.
    i'm trying to capture the parameter values of a PL/SQL procedure by calling inside a anonymous block but i'm getting a "reference to uninitialized collection error" ORA-06531.
    Please help me regarding.
    i'm using following block for calling the procedure.
    declare
    err_cd varchar2(1000);
    err_txt VARCHAR2(5000);
    no_of_recs number;
    out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
    cntr_var number:=0;
    begin
         rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
         dbms_output.put_line('The error is ' ||err_cd);
         dbms_output.put_line('The error is ' ||err_txt);
         dbms_output.put_line('The cntr is ' ||cntr_var);
         for incr in 1 .. OUT_SIGN_TAB.count
         loop
         cntr_var := cntr_var + 1 ;
    Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN_TAB(incr).txn_type||','||OUT_SIGN_TAB(incr).objid);
    end loop;
    end;
    Error is thrown on "for incr in 1 .. OUT_SIGN_TAB.count" this line
    Following is some related information.
    the 3rd parameter of the procedure is a out parameter. it is a type of a PL/SQL table (SEARCH_SIGN_TAB_TYPE) which is available in database as follows.
    TYPE "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
    TYPE "SEARCH_SIGN_TYPE" AS OBJECT
    (ref_no VARCHAR2(22),
    ciref_no VARCHAR2(352),
    ac_no VARCHAR2(22),
    txn_type VARCHAR2(301),
    objid VARCHAR2(1024))............

    We don't have your rt843pq procedure, but when commenting that line out, everything works:
    SQL> create TYPE "SEARCH_SIGN_TYPE" AS OBJECT
      2  (ref_no VARCHAR2(22),
      3  ciref_no VARCHAR2(352),
      4  ac_no VARCHAR2(22),
      5  txn_type VARCHAR2(301),
      6  objid VARCHAR2(1024))
      7  /
    Type is aangemaakt.
    SQL> create type "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
      2  /
    Type is aangemaakt.
    SQL> declare
      2    err_cd varchar2(1000);
      3    err_txt VARCHAR2(5000);
      4    no_of_recs number;
      5    out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
      6    cntr_var number:=0;
      7  begin
      8    -- rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
      9    dbms_output.put_line('The error is ' ||err_cd);
    10    dbms_output.put_line('The error is ' ||err_txt);
    11    dbms_output.put_line('The cntr is ' ||cntr_var);
    12    for incr in 1 .. OUT_SIGN_TAB.count
    13    loop
    14      cntr_var := cntr_var + 1 ;
    15      Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN
    TAB(incr).txntype||','||OUT_SIGN_TAB(incr).objid);
    16    end loop;
    17  end;
    18  /
    The error is
    The error is
    The cntr is 0
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

  • Unable to capture field values in Master agreement  Line Items

    I am trying to get the field values from master agreement line items page. I have written the following code to get the line item details which is working fine to capture part number and quantity->
    agreementBean = doc.getRootParentIBean();
    lineItemCollection = agreementBean.getLineItems();
    collectionsize = lineItemCollection.size();
    for(i=0;i<collectionsize;i++){
         collectionbean = lineItemCollection.get(i);
         partNum = ""+collectionbean.getPartNumber() ;
         Quantity = ""+collectionbean.getQuantity();     
         throw doc.createApplicationException(null,partNum + " , " + Quantity );
    Now, my problem is that I am unable to capture the following field item values in the master agreement > line items page.
    1. Price Unit
    2. Unit Price
    3. Product Category
    4. Plant
    Please help me to find the values.
    Thankx in Advance.
    Su
    Edited by: subrataindra on Aug 10, 2010 11:11 AM

    This will return the name of the plant.
    .getExtensionField("PLANT").get().getDisplayName(session);
    Check if this returns the product category
    collectionbean.getExtensionField("ITEM_CAT").get().getDisplayName();
    This will Return the Price
    collectionbean.getExtensionField("PRICE").get().getPrice();
    (return type :BigDecimal)
    This will return the currency
    collectionbean.getExtensionField("PRICE").get().getCurrency;
    (Return type:String)
    Similarly to retrieve other fields for which there are no standard functions, use .getExtensionField("Field ID")
    Hope this helps
    Regards,
    Immanuel

  • Unable to capture value inside parameter T_LFBK of FK03 in display mode

    Hi Experts,
    I have to trigger a mail whenever there is a change in fields that are captured in parameter t_ffbk.
    However i am unable to capture the the screen values for this parameter as FK03 is in display mode.Please tell me how can i capture the screen field values in parameter T_LFBK.
    <Point offer removed by moderator>
    Thanks in advance.
    Edited by: Vinod Kumar on Jul 28, 2011 5:48 PM

    Hi Experts,
    I have to trigger a mail whenever there is a change in fields that are captured in parameter t_ffbk.
    However i am unable to capture the the screen values for this parameter as FK03 is in display mode.Please tell me how can i capture the screen field values in parameter T_LFBK.
    <Point offer removed by moderator>
    Thanks in advance.
    Edited by: Vinod Kumar on Jul 28, 2011 5:48 PM

Maybe you are looking for