The value read by visa read VI is not correct!

I design a labview program to control Agilent E5072C network analyzer. When I want to get value from this instrument, I use the "VISA read" VI which listed in the block plate. However, the value read by this VI is last time measurement value. For example, last time the read value is 1.0 db and this time the measurement value is 1.2 db. But when I use "VISA read" VI to fetch the value, it is 1.0 db.
Agilent also provide a VI for this device to read measurement value, and it alway read correct value. so could someone tell me why? do I need do any action before read value from this instrument if I want to use "VISA read" VI instead of Agilent VI?
Solved!
Go to Solution.
Attachments:
Read.vi ‏23 KB

You are probably reading it too quickly.  By reading it in NI-MAX, you are doing it by hand, so it takes longer.  When you do it programmatically, it is "instant".  Try using the *OPC? command to turn your command into a query.  It will then return a "1" in the read buffer.  Read the "1" and then do the fetch command.
To Dennis:
I've had bad experiences with manufacturer-supplied drivers to the point where I don't even try to use them any more.  But if Agilent is as anal about their drivers as they are about their manuals, they should be no problem. 
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Similar Messages

  • The Event read query was not supported

    I have an error during a Search request in my collab suite calendar.
    Here the soap message :
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Header>
    <auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
    <Name>lde</Name>
    <Password>xxxx</Password>
    </auth:BasicAuth>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <cwsl:Search xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <CmdId>test</CmdId>
    <vQuery>
    <From>VEVENT</From>
    <Where>DTSTART >= '20061002T000000Z' AND DEND <= '20061002T235959Z'</Where>
    <x-oracle-searchhandle></x-oracle-searchhandle>
    <x-oracle-timestamp>20061002T113300Z</x-oracle-timestamp>
    </vQuery>
    </cwsl:Search>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    And the reply is :
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Server.Error::Data::CalEvent</faultcode>
    <faultstring>The Event read query was not supported</faultstring>
    <detail>
    <cwsl:Error xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <Class>Error::Data::CalEvent</Class>
    <Code>000C-07-00-00000023</Code>
    <Line>306</Line>
    <FileName>UniapiQuery.cpp,v</FileName>
    <Version>1.2</Version>
    <LastMod>2005/04/26 16:47:36</LastMod>
    <Author>kelsaid</Author>
    <Date>Mon Oct 02 11:48:16 2006</Date>
    <PID>30834</PID>
    <TID>1124678576</TID>
    </cwsl:Error>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    I haven't any errors with this sample.
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Header>
    <auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
    <Name>lde</Name>
    <Password>xxxxx</Password>
    </auth:BasicAuth>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <cwsl:Search xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <CmdId>test</CmdId>
    <vQuery>
    <From>VEVENT</From>
    </vQuery>
    </cwsl:Search>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Message was edited by:
    Ludovic DESSEMON

    I resolved my problem. It was a syntax error :
    <Where>DTSTART >= '20061002T000000Z' AND DTEND <= '20061002T235959Z'</Where>
    and not :
    <Where>DTSTART >= '20061002T000000Z' AND DEND <= '20061002T235959Z'</Where>

  • Error Message: The syntax of the value for prompt 'p_phone_num' is incorrect. Please correct the syntax and try again.

    Post Author: helpwithcr
    CA Forum: General
    " The syntax of the value for prompt 'p_phone_number' is incorrect. Please correct the syntax and try again."
    I am getthing this error while I tried to pass the value from an oracle package to the web when the the crystal report viewer kicks in.
    I found the source of the error. Its just a paranthesis that I used with the phone number inside the function.... The function looks like this
    function phone_number
    return varchar2
    is
    begin
    return '(123) 456 - 789';
    end phone_number;
    I really dont want that paranthesis to go. Its the format that everyone wanted. But they dont want that to be static on the report also
    Please help
    Thanks
    helpWithCr

    Sir, you are a legend!!! 
    Many thanks for putting me on the right track... 
    Here's where I went wrong and how I fixed it.
    First I installed the Azure Pack: MySQL Extension on the MySQL server.
    This was wrong, it needs to be installed on the WAP server/s.
    So I installed the extension on the WAP server and it still didn't work.
    So I uninstalled the extension from the MySQL server and it still didn't work.
    So I also installed the MySQL Connector/Net on the WAP server and it worked.
    This eventually fixed it. 
    What I will say is that in the documentation it doesn't mention installing the MySQL Connector/Net from the web platform installer on the WAP server (unless I have completely missed this)?
    Thanks again :-)
    Microsoft Partner

  • The freight condition entered on a PO is not correct.

    Hi gurus,
    I hope someone can help here
    The freight condition entered on a PO is not correct.
    It is 5600 GBP per case on line 1
    19600 GBP per case on line 2
    5600 GBP per case on line 4
    That is far too high because the amount should not be per case – it should be overall
    The total amount of the invoice is 38000 Euro
    So it should not be more than that.
    The GR was made and also the invoice was entered using tx code MIRO.
    I don’t know how could adjust that. Any idea?
    Many thanks
    Lupa

    HI  once  u done  miro   u can  not  adjust  frieght  condition
    ok
    kishore

  • How to check the value from user input in database or not?

    Hello;
    I want to check the value of user input from JtextFiled in my database or not.
    If it is in database, then i will pop up a window to tell us, otherwise, it will tell us it is not in database.
    My problem is my code do not work properly, sometimes, it tell me correct information, sometime it tell wrong information.
    Could anyone help,please.Thanks
    The following code is for check whether the value in database or not, and pop up a window to tell us.
    while( rs.next()) {
                    System.out.println("i am testing");
                    bInt=new Integer(rs.getInt("id"));
                    if(aInt.equals(bInt)){ // If i find the value in data base, set flag to 1.
                  flag=1;  //I set a flag to check whether the id in database or not
                        break;
             System.out.println("falg" + flag);
                if(flag==1){ //?????????????????????
              String remove1 = "DELETE FROM Rental WHERE CustomerID=" + a;
              String remove2 = "DELETE FROM Revenus WHERE CustomerID=" +a;
              String remove3 = "DELETE FROM Customer WHERE id=" +a;
              s.executeUpdate(remove1);
              s.executeUpdate(remove2);
              s.executeUpdate(remove3);
                    JOptionPane.showMessageDialog(null,"you have success delete the value");
              s.close();
             else//???????????????????????????????
                  JOptionPane.showMessageDialog(null,"I could not found the value"); -------------------------------------------------------------------
    My whole program
    import java.sql.*;
    import java.awt.BorderLayout;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class DeleteC extends JFrame
        public static int index=0;   
        public static ResultSet rs;
        public static Statement s;
        public static Connection c;
        public static  Object cols[][];
        private static JTable table;
        private static JScrollPane scroller;
        private static int flag=0;
        public DeleteC()
            //information of our connection
            //the url of the database: protocol:subprotocol:subname:computer_name:port:database_name
            String strUrl      = "jdbc:oracle:thin:@augur.scms.waikato.ac.nz:1521:teaching";
            //user name and password
            String strUser      = "xbl1";
            String strPass      = "19681978";
            //try to load the driver
            try {
                Class.forName("oracle.jdbc.driver.OracleDriver");
            catch (ClassNotFoundException e) {
                System.out.println( "Cannot load the Oracle driver. Include it in your classpath.");
                System.exit( -1);
            //a null reference to a Connection object
            c = null;
            try {
                //open a connection to the database
                c = DriverManager.getConnection( strUrl, strUser, strPass);
            catch (SQLException e) {
                System.out.println("Cannot connect to the database. Here is the error:");
                e.printStackTrace();
                System.exit( -1);
           //create a statement object to execute sql statements
        public void getData(String a){
            try {
             //create a statement object to execute sql statements
             s = c.createStatement();
                int index=0;
                Integer aInt= Integer.valueOf(a);
                Integer bInt;
                  //our example query
                String strQuery = "select id from customer";
                //execute the query
                ResultSet rs = s.executeQuery( strQuery);
                //while there are rows in the result set
                while( rs.next()) {
                    System.out.println("i am testing");
                    bInt=new Integer(rs.getInt("id"));
                    if(aInt.equals(bInt)){
                  //JOptionPane.showMessageDialog(null,"I found the value"); 
                  flag=1;
                        break;
             System.out.println("falg" + flag);
                if(flag==1){
              String remove1 = "DELETE FROM Rental WHERE CustomerID=" + a;
              String remove2 = "DELETE FROM Revenus WHERE CustomerID=" +a;
              String remove3 = "DELETE FROM Customer WHERE id=" +a;
              s.executeUpdate(remove1);
              s.executeUpdate(remove2);
              s.executeUpdate(remove3);
                    JOptionPane.showMessageDialog(null,"you have success delete the value");
              s.close();
             else
                  JOptionPane.showMessageDialog(null,"I could not found the value");
            catch (SQLException e) {
                 JOptionPane.showMessageDialog(null,"You may enter wrong id");
    My main program for user input from JTextField.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JOptionPane;
    import java.util.*;
    public class EnterID extends JFrame{
        public JTextField tF1;
        public EnterID enID;
        public String tF1Value;
        private JLabel label1, label2, label3;
        private static JButton button;
        private static ButtonHandler handler;
        private static String aString;
        private static Integer aInteger;
        private static Integer checkV=0;
        public static void main(String args[]){
           EnterID eId= new EnterID();
       public EnterID(){
          handler=new ButtonHandler();
          Container c= getContentPane();
          c.setLayout(new GridLayout(3,1));
          button= new JButton("ok");
          button.addActionListener(handler);
          label1 = new JLabel(" CustomerID, Please");
          label2 = new JLabel("Label2");
          label3 = new JLabel();
          label3.setLayout(new GridLayout(1,1));
          label3.add(button);
          label2.setLayout(new GridLayout(1,1));
          aString = "Enter Id Here";
          tF1 = new JTextField(aString);
          label2.add(tF1);
          c.add(label1);
          c.add(label2);         
          c.add(label3);            
          setSize(150,100);
          setVisible(true);     
       private class ButtonHandler implements ActionListener{
         public void actionPerformed(ActionEvent event){
             tF1Value=tF1.getText();
            //   CheckData cData = new CheckData();
             //  aInteger = Integer.valueOf(tF1Value);      
             if(tF1Value.equals(aString)){
              JOptionPane.showMessageDialog(null,"You didn't type value into box");
              setVisible(false); 
            else {
                DeleteC dC= new DeleteC();
                dC.getData(tF1Value);
                setVisible(false); 
    }

    You may have working code now, but the code you posted is horrible and I'm going to tell you a much much much better approach for the JDBC part. (You should probably isolate your database code from your user interface code as well, but I'm skipping over that structural problem...)
    Do this instead:
        public void getData(String a){
            PreparedStatement p;
            String strQuery = "select count(*) the_count from customer where id = ?";
            try {   
             //create a prepared statement object to execute sql statements, it's better, faster, safer
             p = c.prepareStatement(strQuery);
                // bind the parameter value to the "?"
                p.setInt(1, Integer.parseInt(a) );
                //execute the query
                ResultSet rs = p.executeQuery( );
                // if the query doesn't throw an exception, it will have exactly one row
                rs.next();
                System.out.println("i am testing");
                if (rs.getInt("the_count") > 0 ) {
                // it's there, do what you need to...
             else
                  JOptionPane.showMessageDialog(null,"I could not find the value");
            catch (SQLException e) {
                 // JOptionPane.showMessageDialog(null,"You may enter wrong id");
                 // if you get an exception, something is really wrong, and it's NOT user error
            // always, always, ALWAYS close JDBC resources in a finally block
            finally
                p.close();
        }First, this is simpler and easier to read.
    Second, this retrieves just the needed information, whether or not the id is in the database. Your way will get much much slower as more data goes into the database. My way, if there is an index on the id column, more data doesn;t slow it down very much.
    I've also left some important points in comments.
    No guarantees that there isn't a dumb typo in there; I didn't actually compile it, much less test it. It's at least close though...

  • Why is the Value Property Node of a Typedef control not typedef itself?

    This is not preventing me from progressing, but I am puzzled by what I am seeing on one of my diagrams (LV 2011).
    I have a typedef control which I am reading around my diagram and passing to some subVI. For this purpose I create a read "Value" Property Node and pass the value to the subVI.
    The subVI uses the same typedef control as that in my calling VI but nonetheless there is a coersion dot on my calling VI's diagram when I connect the "Value" to the subVI connector. Why?
    The closest to this discussion I found was this old one, but it did not end up with a final answer.... It turns out that the typedef control I am talking about is an enum, but that does not matter.
    As a matter of fact, if you connect the Value output of a Property Node to a sequence and create a subVI from that sequence, the corresponding control has lost any link with the typedef. In other words, the Value property node of a typedef control is not a typedef. Why?

    [...] Why?
    Because you haven't posted an idea here.
    Well.. maybe you or somebody else has and I missed it, after all there's more than 14k ideas so for just for LabVIEW.. What? Who said that means there's a lot of room for improvement in LabVIEW??
    Jokes appart, if there is an idea, please give the link.
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Setting the value of a JScrollBar inside a JScrollPane not working.

    I have a display area (JPanel) inside a JScrollPane. What i want to do is that every time the user closes my application a file is saved with some preferences, like position and size onscreen, and the values of the scrollbars. My problem is that when I try to set the values of the JScrollBars, they seem to be completely ignored.
    I made a small class to illustrate this:
    import java.awt.*;
    import javax.swing.*;
    public class ScrollExample extends JFrame
         private JPanel display;
         private JScrollPane displayScroll;
         public ScrollExample()
              display = new JPanel();
              display.setPreferredSize( new Dimension( 800, 600 ) );
              displayScroll = new JScrollPane( display );
              add( displayScroll );
              setSize( 400, 300 );
              setVisible( true );
              displayScroll.getHorizontalScrollBar().setValue( displayScroll.getHorizontalScrollBar().getMaximum() );
         public static void main( String args[] )
              new ScrollExample();
    }The behaviour of is as intended. However if we switch the two lines to be:
    displayScroll.getHorizontalScrollBar().setValue( displayScroll.getHorizontalScrollBar().getMaximum() );
    setVisible( true );and launch it, the scrollbar appears to have moved only a small amount. This leads me to believe that it has something to do with the main window being visible. In my actual application, this call to setValue is ignored, unlike in this sample one. Even placing it after the setVisible call, it does not do anything.
    When I tried to use:
         Runnable doScroll = new Runnable()
                 public void run()
                      taskDisplayScroll.getHorizontalScrollBar().setValue( 200 );
             SwingUtilities.invokeLater(doScroll);after the setVisible call, as mentioned on http://forum.java.sun.com/thread.jspa?threadID=723424, it rarely (maybe 3 out of 20 times) sets the scrollbar to the indicated value.
    My question is this: What does the setValue() call depend on to run properly, and how do I code it to work in my program?
    If you need any additional information, please ask.
    Note: In the sample class I provided, the scrollbar moves to its proper spot, I could not cause it to not move at all, as is the case in my application that seems to have the same calls.
    Thanks, Serge.
    Edited by: super_serge on Jun 26, 2008 8:23 AM

    Can you please explain to me how b) would be implemented.Read the Swing tutorial on Concurrency for the new approach in JDK1.6, or I still prefer to use SwingUtilities.invokeLater for somthing simple like this.

  • In the Value Mapping Table n:1 relations is not allowed???

    I'm using Value Mapping but if I try to fill the Value Mapping Table with 2 different source values (e.g AA, BB) and the same one as target (e.g. ZZ) the Integration Builder does not allow it.
    I receive the message:
    "Rappresentation already exists.
      BB | ZZ
      AA | ZZ
    Do you want to delete it from the existing group and assign it to the current group instead?
    Any idea?
    Sergio
    Message was edited by: Sergio Ferrari

    Hi Sergio,
    I think it does allow you to have n:1 relations. The error you are getting is because the mapping already exists in another group. You can try to display it to see which group the mapping belongs to.
    Nevertheless, since it exists, you do not to enter it again. You are able to use it in your mapping program anyway.
    Regards,
    Hart

  • SSRS - "The value for UrlRoot in RSReportServer.config is not valid. The default value will be used instead." But UrlRoot is blank.

    I get this error when i restart the SSRS services, so the reports pages will not load. I heard this was a permissions issue. I have tried putting in the url to the reports page with no luck. 
    any other suggestions? 
    Running SQL Dev Edition 2012 SP1

    Hi Edomedo,
    It’s a common error message. The root cause should be the incorrect configurations of Reporting Services. Have you backed up the RSreportserver.config before making modifications to the configuration file? If so, please revert back the changes by restoring
    the configuration file backup.  If possible, please configure the Reporting Services through the Reporting Services Configuration Manager.
    If it is not the issue, please post more error details in the Reporting Services log file for further analysis. If the Reporting Servces service is running, also post the error message when viewing the report server web service.  
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • My iphone 3 keeps giving me the message that my password and username is not correct when i go into my mail. It was linked to my gmail account and had been working fine. All the sudden today it won't connect to my gmail account and this message appears

    my phone has stopped connecting to my gmail account.When I click on the mail button it opens and the a message appears that says the user name and password for "imap.gmail.com" is incorrect. My information is correct under settings I have even deleted account and tried to re-set up my gmail account. Still nothing. It had been set up for months and working with no issues.

    ATtempt to power off your device and power it back on, if that doesn't work reset all settings should resolve it for you

  • Got the message 'Adobe Reader plug-in not installed or enabled'

    I have checked all the settings and enabled in tools. Moreover i have installed latest version.
    Kindly help us on the issue.
    'Adobe Reader plug-in not installed or enabled'
    T

    Hi Raja,
    I can understand your concern & will guide you in the right direction.
    Let me know the version of Adobe Reader, web browser & operating system installed on your computer?
    You can also refer to this KB doc. for the troubleshooting steps : Configure browser to use the Adobe PDF plug-in
    *Note : The Adobe Reader plugin will not be supported in Chrome. The Chromium team has decided to remove support for NPAPI plugins like Adobe Reader. Here's a blog post that describes their decision - Chromium Blog: The Final Countdown for NPAPI
    Regards,
    Aadesh

  • When I bring my InDesign PDF into Acrobat, the automated reader won't read acronyms!!!

    I'm trying to make my InDesign doc 508 Compliant. There are a lot of acronyms in this document. After I've exported my PDF and open it in reader I use the "Read Out Loud" option to make sure everything sounds correct. Whenever the reader comes to an acronym such as DOE or DUD it wants to read them as regular words (doe, dud). How can I tell it to read out each letter individually?
    Please help!
    Thanks guys/gals,

    It may be because both DOE and DUD are, in fact, actual words. I inserted hair spaces between the characters, but Preview still pronounced them as words; inserting Thin spaces made it speak out the individual letters. (I just realized I didn't test the in-between 1/6th spaces -- try them.)
    I tested with Preview, so it's possible Acrobat doesn't do this the same way. But if it does: it seems you cannot 'hide' the spaces using negative tracking. If you try this, the letters will again be spoken as words.
    (Ed.) If these are acronyms, shouldn't you write them as D.O.E. and D.U.D.? That makes it clear to the casual reader you are not using it, like, "This rumor was a total DUD, dude!"

  • Not able to set the value in marketing context node for BP_HEAD

    Hi,
    I am trying to set the value in marketing node of BP_HEAD from bp_addr component. i am calling the set_property method but it is not changing the value, when i debugg the code, it actually changing the value in bol structure but it is not calling the get/set method of bp head.
    i am working on BP corporate person  creation i.e. in bp_head component and account details view. I added the marketing attributes in UI configuration and also the address attributes.
    this is what i coded in get method of country in standardaddress context node of BP_ADDR
    lv_entity ?= current.
        IF lv_entity IS BOUND.
          lv_parent = lv_entity->get_parent( ).
          IF lv_parent IS BOUND.
            lv_entity_mkt = lv_parent->get_related_entity( iv_relation_name = 'BuilMarketingRel' ).
            IF lv_entity_mkt IS BOUND.
              CALL METHOD lv_entity_mkt->set_property
                EXPORTING
                  iv_attr_name = 'ATTRIBUTE'
                  iv_value     = attribute1.
    Can anyone please guide me on how to set the value cross component and can we call the get/set method of that attribute which is not in same component?
    Regards,
    Kamesh Bathla

    Sorry, what I said was rubbish, because the LSMW and the session run in different external sessions.
    I have searched forum for these terms: "company BUK parameter BDC background"
    These threads Is it possible to set default company code in SM35? and Release BDC in SM35 in background, How to set defaul company code? seem promising, but I'm not sure they really solve.
    In case these threads don't help you, I think you can create your own Z transaction which sets the BUK parameter id and then does a LEAVE TO TRANSACTION 'ABAON'. Then create again the recording on the Z transaction.
    If you are using ECC6, then you may also enhance the standard to reset BUK parameter id at the very beginning of ABAON, in case it's run in batch input (sy-binpt = 'X'). Be careful as sometimes SAP does batch input on some transactions, so that could make the standard fail.
    Last thing, you can contact SAP support, though it might probably be considered as consulting.

  • Replacement from the Value of an Attribute*

    Replacement from the Value of an Attribute
    With formula variables you can set the processing type Replacement from the Value of an Attribute and create a reference to the reference characteristic for the variable. The attribute Reference to Characteristic (Constant 1) is a dummy attribute that is available with each characteristic. It serves to create a reference to the characteristic, by which it does not need to be aggregated. By choosing this attribute, you can influence the aggregation behavior of calculated key figures in a targeted way and can improve performance during calculation.
    1)what does this do in the query?
    2)what is the value of the variable created ?(like 1,2 etc {i.e.} it changes or is  a constant value like 1)?
    E.g. i have created a formula variable zvar , (replacement path  type) ref. char is wbselement, then what will be the value of the zvar if its used in a formula
    eg.  Formula 1 = kef1 kef2zvar.
    what will be the value(s)  of the variables in the these cases
    1. project = 1000,1000.30.
    2.project = 2000,2000.30.01
    3.proect = 3000,3000.30.01,3000.30.02.
    3.) as per the def. its a  number which refer to a wbs, then in the FORMULA , will it consider the zvar as a VALUE or what would happen?
    Edited by: jumboash on Oct 23, 2009 7:25 PM

    Hi,
    ZVAR is not considered as value in the calculation. It is used only to calculate the formula correctly without aggregation of the operands.
    For example there are two materials m1 and m2 . total amount has to be calculated for these materials whose quantitys are 10 and 20 and whose prices are 200 and 300 respectively.
    Case1:- if ZVAR is not used then the calculation of the fromula will be as follows
    qty   Price    amount
    10 * 200   = 2000
    20 * 300   = 6000
    30 * 500 =  15000     ->   The total amount shows is 15000 which is not correct
    Case 2: -  if ZVAR is used in the calculation of the formula
    qty   Price    amount
    10 * 200   = 2000
    20 * 300   = 6000
                       8000   -> The total amount shows is 8000 which is correct
    so using the ZVAR in the formula shows the correct result without considering the aggregation . This is useful in the case if the material is not part of rows.

  • Script- problem in printing the values in from internal table

    Hi all,
    I have a requiremnt that i for a particular document no there are number of invoices are there. i.e for a single document no there are 20 invoices in that. i shoudl display the invoice number , invoice date, invoice amount , number of days of intrest , start date of interest, end date of interest and intrest amount.
    The problem is i should take the invoice number, invoice date, number of days  from TABLE <b>BSEG</b> and  inovice amount and start date, end date from table<b> INTITIT</b>.  for a particular document number there are diffent invoce numbers in both the table.
    i can display everthing but the prob is with invoice amount. it is repating only one values is displying in the ouput. The invoice number in INTITIT Is not changing. I have to write the syntax for that .Please help me The value in Bseg is chaing as per given syntax shown below.
    data:   begin of hbseg occurs 10.
            include structure hsortp.
            include structure bseg.
    data:   end of hbseg.
    data: begin of hsortp,
            sortp1 like sortp1,
            sortp2 like sortp2,
            sortp3 like sortp3,
            sortp4 like sortp4,
            sortp5 like sortp5,
            EKVBD  LIKE KNB1-EKVBD,
          end   of hsortp.
    loop at hbseg.
            WHERE BUKRS = SAVE_BUKRS.
              save_bukrs  = hbseg-bukrs.
              if  ( hbseg-kunnr = save_kunnr
              and   not save_kunnr is initial )
              or  ( hbseg-lifnr = save_lifnr
              and   not save_lifnr is initial ).
               clear bseg.
                move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
                  perform curr_document_convert_bseg
                              using
                                 bkpf-budat
                                 *bkpf-waers
                                 *bkpf-hwaer
                                 bkpf-waers
                              changing
                                 bseg.
                  if not bseg-pycur is initial.
                    alw_waers = bseg-pycur.
                    perform currency_get_subsequent
                                using
                                   save_repid
                                   bkpf-budat
                                   bkpf-bukrs
                                changing
                                   alw_waers.
                    if alw_waers ne bseg-pycur.
                      bseg-pycur = alw_waers.
                      perform convert_foreign_to_foreign_cur
                                  using
                                     bkpf-budat
                                     *bkpf-waers
                                     *bkpf-hwaer
                                     bseg-pycur
                                  changing
                                     bseg-pyamt.
                    endif.
                  endif.
                endif.
                perform fill_waehrungsfelder_bseg.
                perform fill_waehrungsfelder_bseg_2.
                if bseg-sgtxt(1) ne '*'.
                  bseg-sgtxt = space.
                else.
                  bseg-sgtxt = bseg-sgtxt+1.
                endif.
                clear save_bschl.
                clear save_umskz.
                clear tbslt.
                save_bschl = bseg-bschl.
                save_umskz = bseg-umskz.
                perform read_tbslt.
    ADDING VARIBLE V_GSALDF BY SUNIL 5.11.07******
               v_gsaldf = rf140-gsaldf + rf140-wrshb.
               rf140-gsaldf = v_gsaldf.
               clear v_gsaldf.
    SUNIL *********************
                 *rf140-gsaldf = *rf140-gsaldf + *rf140-wrshb.
                if  xmultk is initial
                and xactiv is initial
                and linecnt = '1'
                and not      xumsst is initial
                and not save_xumstn is initial.
                  if bkpf-bstat = 'V'.
                    perform read_vbset.
                  else.
                    perform read_bset.
                  endif.
                  describe table hbset lines linecnt.
                  if linecnt = '1'.
                    loop at hbset.
                      move-corresponding hbset to bset.
                       *bset = bset.
                      if bkpf-waers ne *bkpf-waers.
                        perform curr_document_convert_bset
                                    using
                                       bkpf-budat
                                       *bkpf-waers
                                       *bkpf-hwaer
                                       bkpf-waers
                                    changing
                                       bset.
                      endif.
                      clear rf140-msatz.
                      clear rf140-vtext.
                      save_ktosl = bset-ktosl.
                      perform read_t687t.
                      rf140-msatz = bset-kbetr / 10.
                       *rf140-msatz = rf140-msatz.
                      rf140-vtext = save_vtext.
                       *rf140-vtext = rf140-vtext.
                      if bset-shkzg = 'H'.
                        rf140-mwshb = bset-fwste.
                         *rf140-mwshb = *bset-fwste.
                        rf140-mdshb = bset-hwste.
                         *rf140-mdshb = *bset-hwste.
                      else.
                        rf140-mwshb = 0 - bset-fwste.
                         *rf140-mwshb = 0 - *bset-fwste.
                        rf140-mdshb = 0 - bset-hwste.
                         *rf140-mdshb = 0 - *bset-hwste.
                      endif.
                      exit.
                    endloop.
                    rf140-wrshb = rf140-wrshb - rf140-mwshb.
                     *rf140-wrshb = *rf140-wrshb - *rf140-mwshb.
                    rf140-dmshb = rf140-dmshb - rf140-mdshb.
                     *rf140-dmshb = *rf140-dmshb - *rf140-mdshb.
                  endif.
                endif.
    *****************Begin of Change by Karthikeyan J********************
                i_count = i_count + 1.
                clear rf140-element.
                clear: it_bseg, i_wrbtr,i_totday,i_tempday,i_day,i_bday.
    comparing with fields belnr AND SELECT * FROM INTITIT added by sunil 3.11.07*********
                select single * from bseg into
                corresponding fields of it_bseg where belnr = bseg-rebzg  anD GJAHR = BSEG-GJAHR.
                select single * from intitit into corresponding fields of  it_intitit where gjahr = bseg-gjahr and belnr_to = bseg-belnr and buzei = '2' OR BELNR = INTITIT-BELNR .
    added by Jayshree on 09/01/2007
                MOVE ' ' TO it_kna1-name1.
                SELECT SINGLE name1
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM ( vbpa AS a INNER JOIN kna1 AS b ON akunnr = bkunnr )
                WHERE a~vbeln = it_bseg-vbeln
                  AND a~parvw = 'zd'.
                SELECT SINGLE fkdat
                INTO CORRESPONDING FIELDS OF it_kna1
                FROM vbrk
                WHERE vbrk~vbeln = it_bseg-vbeln.
    added by Jayshree on 01/02/2007
              CONCATENATE  it_kna1-fkdat6(2) it_kna1-fkdat4(2) it_kna1-fkdat+2(2)
                INTO vfkdat SEPARATED BY '.'.
              CONCATENATE  it_bseg-augdt6(2) it_bseg-augdt4(2) it_bseg-augdt+2(2)
                INTO vaugdt SEPARATED BY '.'.
                i_wrbtr = i_wrbtr + it_bseg-wrbtr.
    added as on 29.06.2007 by jayshree again transport  on 21.07.2007
                tot_wrbtr = tot_wrbtr + i_wrbtr.
                i_totday = it_bseg-zbd1t + it_bseg-zbd2t + it_bseg-zbd3t.
                CALL FUNCTION 'fima_date_create'
                  EXPORTING
                    i_date                        = it_bseg-zfbdt
                 I_FLG_END_OF_MONTH            = ' '
                 I_YEARS                       = 0
                 I_MONTHS                      = 0
                   i_days                        = i_totday
                 I_CALENDAR_DAYS               = 0
                 I_SET_LAST_DAY_OF_MONTH       = ' '
                 IMPORTING
                   e_date                        = i_bday
                 E_FLG_END_OF_MONTH            =
                 E_DAYS_OF_I_DATE              =
    added by JAYSHREE 01.02.2007
                CONCATENATE  i_bday6(2) i_bday4(2) i_bday+2(2)
                INTO vbday SEPARATED BY '.'.
                i_day = it_bseg-augdt - i_bday.
            CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
              EXPORTING
                date1                         = it_bseg-zfbdt
                date2                         = it_bseg-augdt
               OUTPUT_FORMAT                 = '01'
             IMPORTING
               YEARS                         =
               MONTHS                        =
               DAYS                          = i_day
             EXCEPTIONS
               INVALID_DATES_SPECIFIED       = 1
               OTHERS                        = 2
            IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *added by sunil 5.11.07 ***********
    *read table it_intitit with key BELNR_TO = BSEG-BELNR  .
    *LOOP AT IT_INTITIT.
                rf140-element = '521'.
                CALL FUNCTION 'write_form'
                  EXPORTING
                    window  = 'main'
                    element = '521'
                  EXCEPTIONS
                    window  = 1
                    element = 2.
                IF sy-subrc = 1.
                  window = 'main'.
                  PERFORM message_window.
                ENDIF.
                IF sy-subrc = 2.
                  window = 'main'.
                  ereignis = '521'.
                  PERFORM message_element.
                ENDIF.
                IF save_xumstn IS INITIAL.
    *-------Umsatzsteuer -
                  IF xactiv IS INITIAL.
                    save_waers = rf140-waers.
                    PERFORM tax_data.
                    CLEAR taxlines.
                    DESCRIBE TABLE atax LINES taxlines.
                    IF NOT taxlines IS INITIAL.
                      LOOP AT atax.
                        CLEAR ereignis.
                        CLEAR rf140-msatz.
                        CLEAR rf140-vtext.
                        rf140-msatz = atax-msatz.
                         *rf140-msatz = atax-msatz.
                        rf140-vtext = atax-vtext.
                         *rf140-vtext = atax-vtext.
    *******begin of change by karthikeyan on 10.03.06*********************
                        IF sy-tabix = '1'.
                          ereignis = '522'.
                          v_stax = rf140-msatz * rf140-gsaldf / 100.
                        ELSE.
                          ereignis = '523'.
                          v_ecs = rf140-msatz * v_stax / 100.
                          v_total = rf140-gsaldf + v_stax + v_ecs.
                        ENDIF.
                        CALL FUNCTION 'hr_in_chg_inr_wrds'
                          EXPORTING
                            amt_in_num               = v_total
                          IMPORTING
                            amt_in_words             = v_spell
                        EXCEPTIONS
                          DATA_TYPE_MISMATCH       = 1
                          OTHERS                   = 2
                        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                        ENDIF.
    ***************************end of change******************************
                        CLEAR rf140-element.
                        rf140-element = ereignis.
                        IF NOT ereignis IS INITIAL.
                          CALL FUNCTION 'write_form'
                            EXPORTING
                              window  = 'main'
                              element = ereignis
                            EXCEPTIONS
                              window  = 1
                              element = 2.
                          IF sy-subrc = 1.
                            window = 'main'.
                            PERFORM message_window.
                          ENDIF.
                          IF sy-subrc = 2.
                            window = 'main'.
                            PERFORM message_element.
                          ENDIF.
                        ENDIF.
                      ENDLOOP.
                    ENDIF.
                  ENDIF.
                ENDIF.
               ENDLOOP.
              ENDIF.
            ENDLOOP.
    '521' is the element name in the main  window where i should display the values. before select qurey the values are coming in the bseg but not in table INTITIT.  Belnr is the document no with ref to that
    there are number  of invoices nos. so in both the tables it is selecting single value and displaying but in bseg the invoice number is getting refreshed and new number is coming in that place i.e in field bseg-rebzg but in INTITIT  in belnr only it is taking single value it is not getting refreshed.
       move-corresponding hbseg to bseg.
                 *bseg = bseg.
                if bkpf-waers ne *bkpf-waers.
    this is the syntax whr the values in bseg are getting refresh and new invoice number is selecting.
    How to write the syntax for INTITIT? As per invoice number it is giving new values.
    The invoice number in Bseg is different campare to in table INTITIT. in output is shoud show the fields as follows
    it_besg-rebzg(invoice number of besg) it_besg-zuonr(invoice date) INTITIT-INT_BASAMT(base amount) i_day (no of days ) INTITIT-INT_BEGIN (INTREST START DATE) INTITIT-INT_end(INTREST END DATE)  rf140-wrshb(INTREST AMOUNT).
    THE VALUE OF IT_BESG-REBZG IS CHANGING  BUT THE VALUE IN INTITIT-BELNR ( INVOICE NUMBER) IS NOT CHANGING THAT IS WHY IT IS SHOWING
    ONLY SINGLE RECORD.
    for both the table documet no is same. in besg-belnr is the document no. in intitit-BELNR_TO is the document no.
    here in bseg-rebzg is chaning but in INTITIT-BELNR IS  not changing.
    If i take loop at INTITIT. ALL the values are repating so i am unable to take loop. so i want to write
    a syntax such that intitit-belnr should be refreshed and also for every loop it shoud take new invoice no.
    Please help me out it is very urgent.
    <b>USEFUL ANSWERS WILL BE REWARDED.</b>
    regards,
    Sunil kumar.

    assumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
    try with AT NEW - ENDAT.
    AT NEW belnr.
    here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
    ENDAT.
    pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
    thanq
    Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM

Maybe you are looking for

  • Cant access to BIOS aftre HDD/SSD password!

    Hello, Today I set a HDD/SSD password to my Tecra A-11 (updated BIOS) and I am verry happy with that pas,but I cant enter to the BIOS after I enter my HDD/SSD passwor - I press F2,but the screen just go dark for a second or two and the system acts li

  • Remote Desktop and Admintool

    I am using Solaris 10x86 1-How to get admintool to work. I was told to smc but nothing happens. I open a console then type smc then press enter.Where can I download the admintool only. 2-How can I remote desktop Unix-Windows XP Pro and vice versa.(St

  • Video Automatic download in Safari

    Before the last automatic update for my iMac, when I watched a video it was displayed automatically in the download folder. I could decide whether to download or not. Now all this does not happen again. What happened? I can not download the videos. W

  • Migration Working with Errors and Taking Very Long Time: Transient error MapiExceptionNetworkError, StalledDueToMailboxLock

    So, I am migrating mailboxes to a 2013 EXC from a 2010 EXC. Both in same subnet on same domain. Firewall on WIndows disabled:  Setup batch move on 2013 box. But users logs are getting  StalledDueToMailboxLock in the status as well as  Transient error

  • Test & Dev on Same Machine

    Hi, I want to install test & dev on the same machine what i know is i have to assign different port numbers to them. But i want to access them with diffrenet url addresses how i can install with same host or different host plz clarify one more thing,