REPORT - Sold quantity and OnHand quantity

Hello Everyone,
How can I create a query to show what I have sold within a date range and how much inventory I have of those items.  Thank you.
itemcode      sold        onhand     whscod
x                    10                5            AH
x                      5                0            CH
x                    12                3            GB
Y                      0               5            AH
Y                      0             10            CH
Y                    2                20            GB

That is the 2nd step for the query. I would like him to try this first.
Here is the final:
SELECT S.ItemCode, SUM(S.quantity) 'Sold', S.Onhand, S.WhsCode
FROM (SELECT T0.ItemCode, T0.quantity, T2.Onhand, T0.WhsCode
FROM dbo.INV1 T0
INNER JOIN dbo.OINV T1 ON T1.DocEntry=T0.DocEntry
INNER JOIN dbo.OITW T2 ON T2.WhsCode=T0.WhsCode AND T2.ItemCode=T0.ItemCode
WHERE T1.DocDate Between [%0\] AND [%1\]
UNION ALL
SELECT T0.ItemCode, -T0.quantity, T2.Onhand, T0.WhsCode
FROM dbo.RIN1 T0
INNER JOIN dbo.ORIN T1 ON T1.DocEntry=T0.DocEntry
INNER JOIN dbo.OITW T2 ON T2.WhsCode=T0.WhsCode AND T2.ItemCode=T0.ItemCode
WHERE T1.DocDate Between [%0\] AND [%1\]) S
GROUP BY S.ItemCode, S.Onhand, S.WhsCode
ORDRE BY S.ItemCode

Similar Messages

  • T-Code for reporting stock quantity difference between IM and WM

    Hi All
    I'm probably going to kick myself for asking this quastion but is there a report to show the stock quantity differences between IM and WM?
    I have searched the forum first but cannot find info.
    We have various differences in IM and WM shown in MD04 and LS26. This is usually the result of an unplanned plant to plant transfer not being recipted in at the destination plant.
    If no standard T-code is available, which tables can I join to create my own query?
    Thanks in advance
    Darren

    compare MMBE with LS26
    Make sure you dont enter a storage location and storage type in selection screen of LS26.
    if you post a difference with LI20, then you have just posted a difference within WM, means you moved a quantity from a bin into the difference storate type 998.  The balance of both is still equal to your stock shown in MMBE. You have to clear the difference with IM by executing LI21 transaction. Only then the quantity will disappear from difference storage type and will be adjusted in MM and FI.
    LX23 will only report real inconstencies and will adjust them.
    If you do a MM movement like 303, then this creates a transfer request in WM, this TR needs to be converted into a TO. to move the stock from the bin to the interim storage type for goods issue.
    In your case you created just a negative quant in the interim storage type for goods issue and still have a positive quant in the bin, the balance is equal to the stock shown in MMBE.

  • HT201472 I sold a unlocked iphone 5 that I bought second hand andhad for a 2 weeks no problems and i sold it and the next day the lady called me saying it was reported stolen and asking for her money what should i do.

    I sold a unlocked iphone 5 that I bought second hand andhad for a 2 weeks no problems and i sold it and the next day the lady called me saying it was reported stolen and asking for her money what should i do.

    Give the Lady her money back then try and get your money back don,t buy
    from someone off the street buy from shop or webb site ie EBAY but still be careful
    no no one can unlock a blocked iPhone only the owner who has the correct
    APple ID
    bbsydd uk

  • Put report .rdf file and .xml customization

    hi frnds,
    where can i keep .rdf file and .xml file (for customization)? shall i keep on application server? now, to generate report i've written one script ...where can i keep this?
    -bhavin

    Hi Tim,
    Context: R12 France Telecom (FT) migration from 11i
    FT Reports are complex and the quantity of data / size of files generated by reports can reach up to 20Go. So I need to convert RDF to DATA Template because RDF can not generate some so big files (limit=2Go in 11i and may be 10Go in 12)
    I experience some troubles / issues / limits with reports conversion to XML.
    1 - some Data templates are not generated because of error : [052107_102109040][][EXCEPTION] java.lang.IndexOutOfBoundsException: Index: 0, Size: 0. I sent you 2 mails in the past with error detail but have no answer.
    2 - Data Templates are not directly usable because Reports include call to packages stored in PLL files. Pakages definition are well include in XML file generated by Report converter (1st step of conversion) but are not take in account when PL/SQL routine generation (Data template generation).
    Can you help me especially for the 1st issue
    I'd like to show a XMLP demo to FT using the Data source generator XDODTEXE in GL. I see XDOGLDEMO and GLGENJRNDT concurrent programs but there is no Data Definition / XML Data Template associated. Can you tell me if it exists a Data Template and where it can be retrieved from.

  • If image file not exist in image path crystal report not open and give me exception error problem

    Hi guys my code below show pictures for all employees
    code is working but i have proplem
    if image not exist in path
    crystal report not open and give me exception error image file not exist in path
    although the employee no found in database but if image not exist in path when loop crystal report will not open
    how to ignore image files not exist in path and open report this is actually what i need
    my code below as following
    DataTable dt = new DataTable();
    string connString = "data source=192.168.1.105; initial catalog=hrdata;uid=sa; password=1234";
    using (SqlConnection con = new SqlConnection(connString))
    con.Open();
    SqlCommand cmd = new SqlCommand("ViewEmployeeNoRall", con);
    cmd.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    da.Fill(dt);
    foreach (DataRow dr in dt.Rows)
    FileStream fs = null;
    fs = new FileStream("\\\\192.168.1.105\\Personal Pictures\\" + dr[0] + ".jpg", FileMode.Open);
    BinaryReader br = new BinaryReader(fs);
    byte[] imgbyte = new byte[fs.Length + 1];
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dr["Image"] = imgbyte;
    fs.Dispose();
    ReportDocument objRpt = new Reports.CrystalReportData2();
    objRpt.SetDataSource(dt);
    crystalReportViewer1.ReportSource = objRpt;
    crystalReportViewer1.Refresh();
    and exception error as below

    First: I created a New Column ("Image") in a datatable of the dataset and change the DataType to System.Byte()
    Second : Drag And drop this image Filed Where I want.
    private void LoadReport()
    frmCheckWeigher rpt = new frmCheckWeigher();
    CryRe_DailyBatch report = new CryRe_DailyBatch();
    DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter ta = new CheckWeigherReportViewer.DataSet1TableAdapters.DataTable_DailyBatch1TableAdapter();
    DataSet1.DataTable_DailyBatch1DataTable table = ta.GetData(clsLogs.strStartDate_rpt, clsLogs.strBatchno_Rpt, clsLogs.cmdeviceid); // Data from Database
    DataTable dt = GetImageRow(table, "Footer.Jpg");
    report.SetDataSource(dt);
    crv1.ReportSource = report;
    crv1.Refresh();
    By this Function I merge My Image data into dataTable
    private DataTable GetImageRow(DataTable dt, string ImageName)
    try
    FileStream fs;
    BinaryReader br;
    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + ImageName))
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    else
    // if photo does not exist show the nophoto.jpg file
    fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + ImageName, FileMode.Open);
    // initialise the binary reader from file streamobject
    br = new BinaryReader(fs);
    // define the byte array of filelength
    byte[] imgbyte = new byte[fs.Length + 1];
    // read the bytes from the binary reader
    imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));
    dt.Rows[0]["Image"] = imgbyte;
    br.Close();
    // close the binary reader
    fs.Close();
    // close the file stream
    catch (Exception ex)
    // error handling
    MessageBox.Show("Missing " + ImageName + "or nophoto.jpg in application folder");
    return dt;
    // Return Datatable After Image Row Insertion
    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

  • Simulair report for FBL5N and FBL1N for new general ledger on segment level

    We are working with segments in new G/L ledger. We want to run a open item report where we can combine customers and vendors by segment. The vendors and customers are linked in the master data. In the "old"  reports FBL5N and FBL1N you can do this but not by segment.I found the following report on segment level:
    - S_PCO_36000218 - Receivables: Segment
    - S_PCO_36000219 - Payables: Segment
    What I'm missing is to run 1 report for Customers and vendors. What I'm missing to is that there are only some fields available on line item level. (I like to have invoice number, documentype,.......)
    Is there a standard report for this in new genaral leger?
    Is it possible to ad additional field to th list viewer.

    What is this user license type?  All financial transactions need professional license.
    Thanks,
    Gordon

  • Excel Download of a Web SAP BW Report asks userid and password.please help

    Dear BW folks,
    Issue: When I run a specific SAP BW Report from Web and download the same into excel & csv.
    When I open the excel file downloaded, it asks me user name and password to enter. csv file downloaded doesn't ask.
    The report has 0cust_sales hierarchy and SBU hierarchy.
    Is there any thing to do with these hierarchies that the excel download is asking user name and password?
    Please help me out!!!!! This report needs to be downloaded into excel sent to my manager.....
    Regards
    Pavan

    Hi Pavan
    It is possible,please refer the below link
    Report execution without prompting user id
    Providing un-secured access to a web report.
    Also, for the time being, you can run the query and save a workbook and sent across
    These will resolve the issue
    Thanks
    Pavan Agarwal

  • Crystal Report 2008 SP3 and BO XI 3.1 conflict

    Hi every body,
    We have a BOE system:
    BO XI 3.1
    Oracle db 10g
    All running successful and can create some types of WebI report.
    But we also want reports with Crystal Report.
    1> So we install Crystal Report 2008 SP3 (without knowing the conflict error between BO XI 3.1 and Crystal Report 2008 SP3 and overwrite some .dll file). After installing, we can not create WebI report any more. And a error message box display: "DBDriver failed to load: C:\Program File\Business Objects\BusinessObjects ENterprise12.0\win32_x86\dataAccess\connectionServer\dbd_oci.dll ".
    2> We uninstall Crystal Report SP3. But this is not the solution. Still error because of missing .dll files.
    3> We open BO XI 3.1 setup and repair BO XI 3.1. Even we uninstall BO XI 3.1, delete all of its components and delete in regedit key. We install BO XI 3.1 again. Now we have full .dll file, not missing them any more. But when we open universe and click on Table browser, cannot fetching any tables.
    We set rights for Oracle DB user again. But still error: cannot fetching.
    4> We searched the solution for this problem on the internet. But not worked, no answer.
    Can somebody help me bring back the BOE system state again ? pls   :"<
    T______T

    Hi Paul,
    I hope I read your question right!
    Yes, It is possible to run XIR2 and 3.1 on the same server although it's not recommended by BO. You will need to make sure they are both pointing to different CMS databases and different FRS repositories, like you already mentioned you will need to specify different ports for the CMS db and Tomcat.
    Why not uninstall Business Objects XI R2 in your BO development environment or a spare server (if you have one), and do a clean install of XI 3.1 SP3.
    Tip: If you were already having performance issues with your XI R2 environment, I would seriously consider upgrading the hardware. XI 3.1 needs a bit more RAM and CPU than XI R2
    Regards
    Rim Geurts

  • Unable to schedule a report to email and print

    I have been working on a task to both print and email a report to recipients whose email addresses are obtained at runtime.  So far I am able to email the report as a PDF attachment, however, I am not able to get the report to print.  I have three thoughts as to why the report is not printing.
    1. The printer is in a subdomain under the domain where InfoView and the Enterprise server reside.
    2. It is not possible to schedule a report for both an SMTP and print destination simultaneously.
    3. The format is causing an issue in printing - the SDK API states "Printer is a report format specific destination and can only be used when the report object is a Crystal Report."
    I have looked at the scheduled report in InfoView and can see that the print settings I am passing are correctly set for the scheduled instance.  Does anyone know if there is a problem with trying to schedule printing and email at the same time, or if the report format must be .rpt?
    Below is my code. Thank you for your time.
    String query = "Select SI_ID, SI_NAME, SI_PROCESSINFO, SI_SCHEDULEINFO, SI_SCHEDULE_STATUS From CI_INFOOBJECTS Where SI_ID=" + reportId;
            IInfoObjects results = null;
            ISchedulingInfo schedulingInfo = null;
            try {       
               results = iStore.query(query);           
            } catch( SDKException sdke ){
               logger.error(sdke);
            if( !results.isEmpty() ){
                // get the actual report object from collection and set scheduling information
                IInfoObject report = (IInfoObject)results.get(0);
                schedulingInfo = report.getSchedulingInfo();
                schedulingInfo.setType(CeScheduleType.ONCE);
                schedulingInfo.setRightNow(true);
                schedulingInfo.setRetriesAllowed(3);           
                try {
                    Set<String> keys = destinations.keySet();
                    Iterator i = keys.iterator();
                    while( i.hasNext() ){
                        String dest = (String) i.next();
                        if(dest.equals(CrystalDestinations.EMAIL)){
                            // get the destination object and set it to SMTP plugin
                            List emailAddress = destinations.get(CrystalDestinations.EMAIL);
                            IDestination destinationObject = schedulingInfo.getDestination();
                            destinationObject.setName("CrystalEnterprise.SMTP");    
                            IDestinationPlugin smtpPlugin = (IDestinationPlugin) iStore.query("SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_PARENTID = 29 AND SI_NAME='CrystalEnterprise.SMTP'").get(0);
                            ISMTPOptions smtpOptions = (ISMTPOptions) smtpPlugin.getScheduleOptions();
                            smtpOptions.setDomainName( emailDomain );
                            smtpOptions.setServerName( smtpHost );
                            smtpOptions.setSMTPUserName( smtpUser );
                            smtpOptions.setSMTPPassword( smtpPass );
                            smtpOptions.setSubject( "Email for report " + report.getTitle() );
                            smtpOptions.setMessage( "This is the message body" );
                            smtpOptions.setSenderAddress( smtpUser + "@cdrh.fda.gov" );
                            smtpOptions.setSMTPAuthenticationType( ISMTPOptions.CeSMTPAuthentication.LOGIN );
                            for(int j = 0; j < emailAddress.size(); j++ ){
                                smtpOptions.getToAddresses().add( emailAddress.get(j) );
                            destinationObject.setFromPlugin( smtpPlugin );                                                                               
    } else if ( dest.equals(CrystalDestinations.PRINT) ){
                            List printers = destinations.get( CrystalDestinations.PRINT );                   
                            IReportPrinterOptions printerOptions = ((IReport)report).getReportPrinterOptions();
                            printerOptions.setCopies(1);
                            printerOptions.setEnabled(false);
                            printerOptions.setPrinterName( (String)printers.get(0) );                   
                            printerOptions.setPageLayout(IReportPrinterOptions.CeReportLayout.USE_SPECIFIED_PRINTER_SETTING);
                    List reportPrompts = ((IReport)report).getReportParameters();
                    for(int j = 0; j < reportPrompts.size(); j++){
                        IReportParameter prompt = (IReportParameter) reportPrompts.get(j);                   
                        if(prompt.getParameterName().equals(mdrParamName)){
                          IReportParameterSingleValue v = prompt.getCurrentValues().addSingleValue();
                          v.setValue(reportParameters.get(mdrParamName));
                        } else if(prompt.getParameterName().equals(addressParamName)){
                            IReportParameterSingleValue v = prompt.getCurrentValues().addSingleValue();
                            v.setValue(reportParameters.get(addressParamName)); 
                    IReportFormatOptions format = ( (IReport) report).getReportFormatOptions();
                    format.setFormat(IReportFormatOptions.CeReportFormat.PDF);
                    iStore.schedule( results );

    Hi Jason,
    Based on your code, I could not tell if you were scheduling a Crystal Report or a WebI document.
    Regardless, what I would suggest is you try scheduling the report/document on InfoView.
    Once you schedule it on InfoView, you can retrieve the instance on Query Builder (or through code) and compare the properties that are being set through InfoView and the one you set through your code.
    This should indicate if you are missing some properies or have set some properties incorrectly.
    Hope this helps.
    Regards,
    Dan

  • Need Report in Training and Event Management

    Dear All,
    I want a report in Training and Event Management consisting of attendee name and training date and venue details, price for training event and would like to know any standard report available.
    Kindly let me know the std report name.
    Thanks and Regards
    Suresh,V

    Hi!
    for all reports try T-code : SAP1 ( Report Selection ) & SAP2 ( Info catalog ) here you will get all the standard reports available for that module .
    Regards
    Sheetal
    Edited by: sheetal Gulati on May 14, 2009 7:51 AM

  • App store reports Pinball HD and 11 other apps cannot be purchased at this time.....

    App store reports "Pinball HD and 11 other apps cannot be purchased at this time"..... This occurs whenever I log into the app store. I have already purchased this app (and presumably the 11 others as well).  I believe this started when it showed up as an app I should update (for free).
    My wife and I share this iPad and we have apps purchased under two different store accounts on this machine. I have tried to log off and sign in with her account and then check updates but with either account I am told that all apps are up to date. All of our credit card info is current. Any clues?

    Already on Automatic..... :(
    This is an iPad 1 - I've had it since it first came out (ordered directly from Apple). Lots of apps and purchases over the years. My wife got her own WiFi only iPad shortly after mine as she fell in love with it and I don't share well. ;) This only started about 7-10 days ago. I did not update to iOs 5.1 until last night so this predates that. My concern is that when the iPad 3 arrives next Friday that this will transfer over.
    Ever since my wife received her own iPad our purchases are pretty much separate.

  • SCCM Report for Applicable and Installed Updates Collection Wise

    Hi All, I was looking for a report on Applicable and Installed Updates Collection Wise and got this below query on the Internet and want to create a SCCM report with this below query. How to make this query working in SCCM report?
    Do I need to add prompts, if yes please guide me on adding prompts.
    SELECT
    DISTINCT
    SYS.Name0
    AS [Server Name], SIS.SMS_Installed_Sites0 AS [Site Code], UCS.Status AS [Patch Status Code],
    CASE WHEN UCS.Status = '2' THEN 'Applicable' WHEN UCS.Status = '3' THEN 'Installed' ELSE '' END AS 'Patch Status', UI.BulletinID AS [Bulletin ID],
    UI
    .ArticleID AS [Article ID], UI.
    Title
    FROM
    v_R_System AS SYS LEFT OUTER
    JOIN
    v_Update_ComplianceStatusAll
    AS UCS ON SYS.ResourceID = UCS.ResourceID INNER
    JOIN
    v_UpdateInfo
    AS UI ON UCS.CI_ID = UI.CI_ID INNER
    JOIN
    v_RA_System_SMSInstalledSites
    AS SIS ON SYS.ResourceID = SIS.
    ResourceID
    WHERE
    (UCS.Status IN ('2', '3')) AND (UI.ArticleID IN ('972270', '974392', '973904', '969947')) AND (SYS.Name0
    IN
    (SELECT DISTINCT v_FullCollectionMembership.
    Name
    FROM v_FullCollectionMembership INNER
    JOIN
    v_R_System
    ON v_R_System.ResourceID = v_FullCollectionMembership.ResourceID AND v_R_System.Active0 = 1 AND
    v_FullCollectionMembership
    .CollectionID IN ('Collection ID'
    ORDER
    BY
    [Patch Status Code]

    Yes it can be done and please run the query which i have shared in the thread
    I again pasted the query for you below..
    SELECT DISTINCT
    SYS.Name0 AS [Server Name], CASE WHEN UCS.Status = '2' THEN 'Applicable' WHEN UCS.Status = '3' THEN 'Installed' ELSE '' END AS 'Patch Status',
    UI.BulletinID AS [Bulletin ID], UI.ArticleID AS [Article ID], UI.Title
    FROM         v_R_System AS SYS LEFT OUTER JOIN
                          v_Update_ComplianceStatusAll
    AS UCS ON SYS.ResourceID = UCS.ResourceID INNER JOIN
                          v_UpdateInfo AS UI ON UCS.CI_ID
    = UI.CI_ID
    WHERE     (UCS.Status IN ('2', '3')) AND (SYS.Name0 IN (SELECT DISTINCT v_FullCollectionMembership.Name
    FROM v_FullCollectionMembership INNER JOIN
         v_R_System ON v_R_System.ResourceID = v_FullCollectionMembership.ResourceID AND v_R_System.Active0 = 1 AND
                                                       v_FullCollectionMembership.CollectionID
    IN ('XXX00000')))
    Kamala kannan.c| Please remember to click “Mark as Answer” or Vote as Helpful if its helpful for you. |Disclaimer: This posting is provided with no warranties and confers no rights

  • Custom Report for slow and fast moving items

    Dear Xperts,
    My client wants to develop a new report for slow and fast moving items, I checked the std report MC46 however as per std SAP design this report does not consider the special stock like project stock (Q)...could you please help me to know how can develop this new report with following input and output fields?
    Input fields:
    Plant
    Material
    Material Group
    MRP Area
    Special Stock Indicator
    Special Stock (Type)
    Output Fields:
    Material
    Material type
    Material group
    MRP Controller
    MRP Area
    ABC indicator
    Material price
    Category field – Slow, Fast, Non-moving
    Current Stock
    Last Issue Date
    Thanks in Advance
    Regards
    Rahul

    Dear Rahul,
    If you required  project stock and consignment stock with valuated stock report in same place you need to generate new info structure as given below link. Or you can go with customized report with abaper.
    Info structure validation
    Regards
    Sanjeet Kumar

  • Enhancement request for VAT Report of Customer and Vendor.

    Hello SAP Gurus,
    Have enhancement request for adding new fields in existing VAT report of Customer and Vendor like user id, GL account etc.
    As I am fresher, can you please help me that how I need to approach. Thanks for your support.
    Regards,
    Saleem

    Hello Saleem,
    Almost all fields required for VAT reporting are available in standard tax report
    S_ALR_87012357 .
    You have to configure the layout from the selection screen as below
    regards
    pb

  • Output same Deski report as PDF and XLS

    Hello,
    will it be possible to generate (not schedule) a Deski - Report using Java SDK ?
    desired workflow:
    - generate/refresh the report to hold new data (User specific, Local specific)
    - output this report in Formats PDF and XLS
    - store the output - reports in Users inbox
    The goal is to generate the report only once and output the same twice - as pdf and as xls.
    As far as i saw in scheduling a report, it is only possible to produce one output (pdf or xls), if we need both, we have to schedule twice. And therefor we will have to generate the same report twice.
    I found somthing like
    binaryView = (BinaryView)documentInstance.getView(OutputFormatType.XLS);
    binaryView = (BinaryView)documentInstance.getView(OutputFormatType.PDF);
    in RBean for Webi - reports.
    Looking forward for any idea.
    Thanks in advance.
    Johannes
    Edited by: Johannes Kammerer on Sep 15, 2009 4:55 PM

    If you're on XI 3.x, then you can specify multi-format exports using Publications.
    Otherwise, you'd need to export to a file using REBean SDK, then Enterprise SDK to create a new InfoObject for that artifact.
    Sincerely,
    Ted Ueda

Maybe you are looking for