SQL subselect rounds unintentional in SAP B1

Hey everyone,
if I am executing a select-statement with a subselect in sap b1, the result of the subselect is rounded - why? If I run a query without other tables, I get the exact value.
SELECT T0.[TransId], T0.[RefDate],
(SELECT T2.Rate FROM ORTT T2 WHERE T0.RefDate = T2.RateDate AND T2.Currency = 'USD')
FROM OJDT T0  INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId WHERE T1.[ShortName] = 'T0001'
T2.Rate is rounded unintentional to two decimals and so further arithmetic operations are senseless because not exact. If I run the same query with Managment Studio, I get the exact value with four decimals. Several tries with CONVERT and CAST did not solve the problem.
Any suggestions? Thank you!
Best Regards
Sebastian

Hi,
thanks for your reply. I have tried it out and you were right.. but the problem is, that I want to export the results into excel, but there the rounded values are exported.
I have solved the problem by extending the where-clause and putting the T2.Rate into the normal select-clause.. then the values keep their format.
Best Regards
Sebastian

Similar Messages

  • How to submit custom SQL to the DB in SAP system

    Hi
    In the project in which I had participated before, there were CRM server and WAS which had IPC server (price decision tool). There was a requirement that IPC referred CRM data, but there was no suitable BAPI in CRM. So, at the UserExit in IPC I made the programs that submit custom SQL to CRM DB via JCo.
    In a similar idea, Can I submit custom SQL to the DB of SAP environment (ERP, CRM and so on) from general WAS (don't have the IPC) ?
    I already know the way that I make the function module which throw SQL in SAP and call it from WAS. Could you tell me other methods if it exists ?
    Best regards,

    What's about RFC?

  • SQL Server 2005 data in SAP BI

    Hi All !
    Having a requirment to pull the SQL Sever 2005 data in SAP BI. How you go about for creating the datasource? As I understand SQL maintains tables. We can create views based on the table. But how to generate the Datasource of out it?
    With Regards
    Rekha

    Hi Rekha:
    You might want to consider connecting from BW to SQL Server using either DB Connect or UD Connect (by defining a Source System).
    The contents of tables or views on the SQL Server side can be sent to BW after defining the corresponding DataSources.
    Regards,
    Francisco Milán.

  • Round functions in SAP

    Hi Experts,
    Can you help me in finding a suitable round function in SAP? I need to round off to 3 decimal places. I used the function module ROUND but it is not very much helpful.
    I have 3 values ex 0.43444567 , 0.0824495 , 0.48310483. The total is 1. But wen i update in transaction Kp46 for Plan value column it takes only 3 decimal places. So if i reduce the above 3 values to 0.434,0.082,0.483 then i get total as 0.999.
    But if i reduce them ( rounding off ) to 0.435,0.083,0.483 i get 1.001. Please help me get a proper solution for this.
    Thanks and Regards,
    Ramya S

    Hi,
    Thanks for your reply. But I need not calculate the sum to update it anywhere. I just want the total to be 1. I just want to reduce them to 3 decimal places and also retaining the the total as 1.
    Thanks,
    Ramya S

  • To retrieve data from sql table and pass to SAP

    Dear expert,
    My company is using e-store, customers place order thru the web, these orders are stored in sql server
    Now I want to retrieve this data then call BAPI to create sales order in SAP.
    What is the proper way ? RFC or DBCON ? Can RFC call BAPI ? I'm not familiar with RFC/DBCON.
    Please let me know how to do that ? Would appreciate if there is any sample given.
    Thanks

    Few Nice Blogs .
    Using ABAP to access non-SAP databases
    Installing DB Connect with MSSQL Server Database
    Thanks to Tony and Graham Robbo.

  • Sql Server configuration requirements for SAP ECC 6.0

    Dear  All,
    I am using Sql server 2005 Enterprise as data store for Sap ecc 6.0.There are certain configuration requirements to be done while installing it so that sapinst.exe (sap installer) is able to use it to create its own DB's.
    For eg it requires a collation of SQL_Latin1_General_CP850_BIN2 whereas the default that gets installed is SQL_Latin1_General_CP1_CI_AS.
    Like this there are other requirements which I am not aware of.Most of the docs available on the Internet are talking of ecc 6.0  with Oracle 10.2G which is the most common combination.I am having docs for this combination.
    I am installing ecc for the first time.
    *I am unable to download docs from sap. marketplace as it requires a login given to certified users or sap purchasers.I am neither.*
    Can anyone help me with this.If anyone has ECC 6.0 installation guide with sql server it will be serve my purpose.
    Thanks for your efforts.

    "Excuse me?
    What he is doing is illegal , you know what that means, right? If you don't believe me, read the license that comes on the first installation DVD.
    Actually, I even think it's kind of barefaced to ask in the forum of the software vendor for help! I mean, it's like asking in a bank forum how to rob and fraud the bank! You - and many others - may think that it's right and ok to do that. I tell you: it is not. Not for "home use", not for personal use, not at all.
    You can use the software available here in the SDN to lean and study, that's why it's there.
    If you deal at all with copied software, then just be smart enough to make other people not notice. He can be happy if he's not prosecuted (which would legally be possible)."
    Do u understand what is legal or illegal? Have u read the license in full?
    The license does not put any limit on the number of users.So if I am using it means that one more user has been added by the license holder.
    Therefore there is nothing illegal about it.
    It would have unethical (not illegal) if the software is being used for a business purpose other than for which it has been purchased.
    Since it being used for training purpose the above does not hold good.
    In fact it is SAP who is benefited in the long run bec' after a person learns it technology because  he is going to implement it somewhere, for which the concerned user will have to purchase a license.Therefore I am helping SAP to increase its business.
    But there are some stupid people who don't understand these things but are ready to shout at the top of their voice thinking themselves to be intelligent.
    Edited by: coolmind26 on Jun 5, 2011 10:57 AM

  • SQL Server 2008 compatibility with SAP PI 7.0

    Hi All
    Scenario is like this:
    XI is fetching data from SQL Server.
    Previously we were using SQL Server 2005 and XI was successfully fetching data from it.
    Communication channel setting:
    JDBC Driver : com.microsoft.sqlserver.jdbc.SQLServerDriver
    Connection : jdbc:sqlserver://10.10.100.180;user=abc;password=xyz;database=CUSTOMER
    Two days back SQL team uninstalled SQL Server 2005 and installed SQL Server 2008
    After doing this XI stopped fetching data from SQL and error is "Error during database connection to the database URL 'jdbc:sqlserver://10.10.100.184;user=sqluser;password=india123;database=CUST_HO' using the JDBC driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:sqlserver://10.10.100.184;user=sqluser;password=india123;database=CUST_HO': com.microsoft.sqlserver.jdbc.SQLServerException: The server version is not supported. The target server must be SQL Server 2000 or later."
    Please help me how to solve this problem.
    Regards
    Dheeraj Kumar

    Hi Prateek
    As far as i know if i will load JDK5 then netweaver will not work. i asked to basis person too he also told me the same thing.
    We even tried to load another driver got from microsoft website - sqljdbc_2.0.1803.100_enu.exe
    after updating this driver i got error - "Error during database connection to the database URL 'jdbc:sqlserver://10.10.100.184;user=sqluser;password=india123;database=CUST_HO' using the JDBC driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:sqlserver://10.10.100.184;user=sqluser;password=india123;database=CUST_HO': UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver (Unsupported major.minor version 50.0)'"
    Regards
    Dheeraj kumar

  • Upgrade SQL Server 2000to SQL Server 2005 in an SAP environment

    Hi,
    I have a scenario in which we are going to upgrade SQL server 2000 to SQL server 2005 in SAP an environment.
    Now SQL server has a concept of In-Place Upgrade and Side-by-Side Migration Process.I want to know what does both of these mean.
    We have an SAP note(799058.It talks about the upgrade in Step II.Is it the same as In-Place Upgrade concept in SQL?
    What is step III in the note talking about? Is it talking about Side-by-Side Migration?
    It would be of gr8 help if someone could provide the conceptual knowledge on these and what does the note mentioned above talks.

    Hello
    Please review my post on SQL upgrade.
    SAP on SQL Server
    You may also like to review
    http://www.microsoft.ie/downloads/itprosql-90.ppt#568,17,Demo
    Can you please advise your DB size and the max. amount of downtime your business can afford?
    I will check, but I am almost sure that a side-by-side SQL upgrade is not appropriate for SAP systems.
    Thanks
    N.P.C

  • Size of SQL Server 2005 Database for SAP B1 2005 B is heavy

    Hi all,
    In my company we are working with SAP B1 2005 B SP 25.
    Our Database is in SQL Server 2005. Its Size reaches 6 GB in less then two years periods.
    Can Any body guide me to reduce the size or how to maintain database. Can we split Database in SAP B1 ?
    Due to the size users getting less speed
    Awaiting your valuable guidance for the same.
    Best Regards,
    Chintesh Soni

    Hi Chintesh,
    I would advise caution doing any of the things suggested in SAP Note 548772. In particular, I strongly recommend you do NOT set auto-shrink on. This is a really bad idea on a production database and I can't understand why SAP would suggest it.
    Is it the data file that is 6GB or the overall size of the database (ie data and log files)? If your log file is large  then this can slow performance. I recommend setting up transaction log backups on an hourly basis. This is good practice and not only keeps the log file healthy but also gives you the option to recover your data to the last transaction log backup in the case of an emergency. If you don't want transaction log backups then do as the SAP note mentions and set the recovery model to simple and do a once-off truncation of the log file.
    Are you doing regular maintenance on the database (ie rebuilding indexes, updating statistics)? Are you monitoring fragmentation on the data drive and doing a defrag occasionally to keep the drive healthy?
    Kind Regards,
    Owen

  • Microsoft SQL Server 2008 Express for SAP BO BI 4.0

    Dear Experts,
    I am curently installing a SAP BO BI 4.0 with the bundle database, and after watching the thread  10610337 and http://www.microsoft.com/sqlserver/en/us/product-info/compare.aspx I am wondering if the SQL server express is sufficient for a usage of BI .(we will also add on this instance the Data Services)
    I don't know how the data are stored (is that like BW ?) and if it will need a large disk space ?
    According to your experience, are the 10 Gb database space of SQL express are ok for a development environment ?
    Best Regards,
    Thibaud.

    The bundled DB with BI4.0 is provided as a sample and as a means to quickly deploy product.
    You should use your company standard DB solution for any serious BI4.0 deployment.
    The bundled DB should be enough for Development or test/sandbox type of deployments.
    As to the required size - it depends on what and how exactly you're going to use it - without a proper Sizing exersize it is impossible to say.
    see sizing section on SMP for more details on that.

  • Microsoft SQL Server 2008 Express for SAP BusinessObjects Enterprise 4.0

    Hi Expert,
    I'm going to install SAP BusinessObjects Enterprise 4.0 on my virtualized system (vmware) composed as: windows server 2008 Enterprise Edition R2 + Tomcat. I have some doubts related to the DB version to choose.
    Due to the fact that Microsoft SQL Server 2008 Express is bundled with SAP BOE 4.0 I want to use this DB.
    However, I saw in the Microsoft Portal that Microsoft SQL Server 2008 Express (http://www.microsoft.com/sqlserver/en/us/product-info/compare.aspx)  that:
    Number of CPUs     1
    Maximum memory utilized     1 GB
    Maximum database size     10 GB
    These my doubts:
    1) Could these characteristics  generate performance issues for a production environment?
    2) Which is a typical DB size for a production enviroment? could be greater then 10 GB?
    3) Can I use Microsoft SQL Server 2008 Express  in a virtualized system (vmware)?
    Thanks in advance for collabortion
    regards
    gio'

    Hi Gio
    Remember that the BOE system database (or repository) only has a few tables in it, with really one main table that stores a reference to each folder, report, user, group, server, etc. on the system. So the table and the database itself do not grow very large. In the past year, we have done over 70 SAP BusinessObjects projects and I can't recall one where the database size would even approach 5GB in total, let alone 10GB.
    The reason for this is that the database only stores a reference to the physical objects and content within BOE-- the actual reports, universes, etc. are stored on the file system within the Input and Output file repository folders.
    And the memory constraints are not really an issue either with BOE-- the database itself does not come under much strain during the day-to-day operation of the server. If you believe that the memory may be an issue, you can always start with SQL Server 2008 Express and then using the new tools in the 4.0 CMC to monitor the memory usage on the server. If you need to, you can move the system database to another SQL Server edition, or alternately move the database to another one of the supported platforms, including Oracle, DB2, etc.
    Hope this helps!
    regards
    David

  • Rounding Issue in Sap Business One 2007A

    Hi Experts:
    Could you please assit us?: We are running Sap Business One 2007A SP01 PL08, Our client is using Rounding Method "By Document". and the option "Automatic Rounding for document" is only available for sales documents. How can we achieve to use Automatic rounding in header total fields in Purchase Documents????. Can we achieve this by a Formatted searches?
    And secondly, In all marketing documents, under the "Define tax amount distribution"  we need to round the amount field. ie: if the amount is $2250.01 to be rounded in 2250 and if the amount is 2250.89 to be rounded in 2251. Can we achieve this with a formatted search as well in the Amount field in this table?.
    Thanks very much in advance
    Claudia Gutierrez

    Hi Claudia Gutierrez,
    Have you checked Round function by query?  You may check this thread first:
    Re: Rounding Tax amount in row
    Thanks,
    Gordon

  • SQL error 9002 while Login SAP

    Hi All,
           Today we were upgrading ABAB and BASIS support pack . while the proccess was going we had an error "SQL error 9002 transaction log is full" after that session got terminate . now we unable to login SAP . We are getting this message "SQL error 9002 transaction log is full" at time of login . Now how do I login SAP and clear the transaction log. what is the solution of this problem .
    Thanks in Advance
    Jitendra Singh

    Hello Jitendra,
    whenever you usually do such type of basis tasks like patch upgrades and all it is preferable to switch off the logging so that transactional logs doesnt increase
    I would recommed you to go to SQL server studio and change the automatic logging to simple...then you will not face any issues of transactional logs
    but remember after your work is over switch automatic logging to full
    Let me know of any questions
    Rohit

  • Database backup strategy(MS sql server 2005, Winodws 2003, SAP ECC 6.00)

    Hello gurus,
        I am confused, about the backup system i should go for(backup device, abckup software)?? Fllowing is my SAP Landscape.
    1) IDES
    2) Solution manager
    3) Development
    4) BIW
    no of users 25 max
    modules implemented
    MM
    HR
    FICO
    BIW
    <b>    I want to implemente before go live, backup system in my company.</b>
    We have received backup schedule from our implementation partner. Our backup system is as follows.
    Backup device is HP Surestore Autoloader.
    Cartridge capacity is 100/200GB
    Backup software is Veritas (version 8.6)
    Note: Through this we take backup of our legacy system and it takes around 3 1/2 hour to 4 hours to take backup of 60 GB of our legacy data.
         Right now the problem is our backup software version is old and i even believe, the hardware we have is not sufficient to take daily database backup and fortnightly, SAP system backup.
        The only solution to the problem i can see is
    1) to go for another backup device exclusively for SAP system
    2) Even go for SQL Agent software used to take backup of SAP system thorugh Veritas.
    3) Even upgrade my Veritas version.
    <b>   Its a request to GURUS</b>
    1) Is the solution, i am thinking to this issue is correct.?? If no then please advice me
    2) Please tell me the best backup system in your opinion for my above mentioned system.
    Thanks Gurus
    Rahul

    Hello,
    A indication of the size of each database would be helpful.
    However, its NOT a good idea to take only one on line backup a week. What if you have a tape error and cant recover a TL? You have no chance for recovery. This is not best practice. Can the business except a 4,5 or even 6 days loss of data - id guess not.
    This is what id do if you don't want to purchase a new device, I would take an online backups from SQL to disk every night - this would be a separate disk! From the disk you can the pick up the backup to take at a time to suit that wont impact the existing backup. Plus you always have two copies of the backup. One on disk, one on tape.
    My normal transaction log strategy is similar, again backup to disk, every hour on a production system. Then after midnight move the existing 24 logs into an archive folder. This folder would also be picked up by the existing device at a suitable time before being moved to a 'saved' folder and deleted the next day. Again you always have multiple copies of the data. two on disk, two on tape.

  • SQL for rounding to the nearest value

    Hi All,
    My Oracle DB version is 10g Release2 and also 11gR1
    I have data like below, I need to write a SQL for the below requirement.
    ID   RANGE_LOW                RANGE_HIGH
    1      50                    55             
    2      55                    60
    3      60                    63 
    4      63                    77 
    5      77                    84   The requirement is like I need to check a value between the above range low and high then round it to the nearest value.
    Say, for example if I have 68 then the value is rounded to 63 else if 74 then 77 else if its in the middle of two values (70) then rounded to the highest value, here its 77.
    Please advice.

    Ashu_Neo wrote:
    hi Purvesh,
    I think , you didn't check it properly with requirement of posting. Your query needs to be changed a bit. Please verify againYes, I probably missed or overlooked the last line.
    Here is the updated solution then:
    with data as
      select 1 id, 50 low, 55 high from dual union all
      select 2, 55, 60 from dual union all
      select 3, 60, 63 from dual union all
      select 4, 63, 77 from dual union all
      select 5, 77, 84 from dual 
    chk_val as
      select &val val from dual
    select id, low, high,
           val input_value,
           case
            when val < (low + high)/2
              then low
            else
              high
           end round_value
      from data, chk_val
    where val between low and high;
    ID                     LOW                    HIGH                   INPUT_VALUE            ROUND_VALUE           
    4                      63                     77                     70                     77

Maybe you are looking for

  • Optional editable regions in head

    I'm trying to create a master template that will enable me to include or not include cross-fading photographs in pages based on that template. I know that with DW8 I can insert an editable region in the <head> (ie for description, keywords). I know t

  • Consignment and payment terms

    All, I understand that during MRKO (the consignment settlement) the payment terms is pulled from the vendor master at the company code level.  This is SAP standard.  Is anyone aware of anything in SAP that could change that default?   For example dur

  • Agent and Supervisor Desktop is in Partial service

    Hi, My CAD and CSD shows the status in the bottom as Partial service,when i analyse the service status by clicking on that " Agent Statistics Viewing is Inactive ". What i need to do to enable it.My environment is CME 7.0 , UCCX 7.0 with IP Communica

  • How do we track payments against Repository Contracts ?

    Hi Gurus, Is there any way can we track payments done against Repository Contracts. Business example : We have Estate Contract ( Gardening Contract ) , which don't run through Purchasing department and we decided to use Repository contract to capture

  • How to Upgrade Solaris Package ?

    Hi, I created a solais package (*.pkg), which I've installed with the following command: "pkgadd -d mypkg.pkg" 1. What command should I use in order to upgrade it to a higher version? 2. What are the changes I have to do in the installation pkg for s