Custom report missing proper data

I've written a custom purchasing report but we just encountered a problem. For any item which hasn't been sold yet, the price and cost don't appear in the report.
SELECT
T0.ItemCode, T0.ItemName, T0.U_SES_PageNo, T0.OnHand, T0.IsCommited, T0.OnOrder,
(SELECT Price FROM ITM1 WHERE ItemCode = T1.ItemCode AND PriceList = 1) [UnitPrice],
(SELECT Price FROM ITM1 WHERE ItemCode = T1.ItemCode AND PriceList = 2) [UnitCost],
UTQ = case when datepart(qq,OINV.DocDate) = 04
             and datepart(yyyy,OINV.DocDate)=datepart(yyyy,GetDate())
       then INV1.Quantity else 0 end,
UPQ = case when datepart(qq,OINV.DocDate) = 03
             and datepart(yyyy,OINV.DocDate)=datepart(yyyy,GetDate())
       then INV1.Quantity else 0 end,
UTY = case when datepart(yyyy,OINV.DocDate) = datepart(yyyy,GetDate())
       then INV1.Quantity else 0 end,
UPY = case when datepart(yyyy,OINV.DocDate) = datepart(yyyy,GetDate())-1
       then INV1.Quantity else 0 end
  INTO ##TEMP
  FROM OINV
INNER JOIN INV1
    ON OINV.DocEntry = INV1.DocEntry
FULL JOIN OITM T0
    ON INV1.ItemCode = T0.ItemCode
FULL JOIN ITM1 T1
    ON INV1.ItemCode = T1.ItemCode
WHERE T0.CardCode = '[%0]'
ORDER BY T0.ItemCode
SELECT
ItemCode AS 'Item Code',
ItemName AS 'Description',
U_SES_PageNo AS 'Page Number',
CAST(OnHand AS INT) AS 'On Hand',
CAST(IsCommited AS INT) AS 'Committed',
CAST(OnOrder AS INT) AS 'On Order',
CAST(SUM(UTQ)/10 AS INT) AS 'Units 4th Qtr',
CAST(SUM(UPQ)/10 AS INT) AS 'Units 3rd Qtr',
CAST(SUM(UTY)/10 AS INT) AS 'Units This Year',
CAST(SUM(UPY)/10 AS INT) AS 'Units Prior Year',
UnitCost AS 'Cost',
UnitPrice AS 'Price'
FROM ##TEMP
   GROUP BY ItemCode, ItemName, U_SES_PageNo, OnHand, IsCommited, OnOrder, UnitCost, UnitPrice
   ORDER BY ItemCode
DROP TABLE ##TEMP
What am I missing to make the report display the Price and Cost for an item which hasn't appeared on an invoice?

I am wondering if maybe we haven't lost the scope of this problem.
I am unable to get any of the code examples you provided working. I am unclear on which parts of my code I should be using and which parts of your code I should be using.
We seem to be going over the problems with linking tables that "aren't linked" but in the first example I posted they are linked.
Everything works fine except that price and cost do not display on certain items. The rest of the information exists, is linked, and working.
This is the code I am currently using which results in the error: The multi-part identifier "OINV.DocDate" could not be bound.
Again, the problem is that for any item which we haven't sold (the item has not appeared on an AR Invoice, that is how we are calculating "units sold" numbers), the Price and Cost do not appear. The item is listed in the report but the price and cost do not show. I am thinking this is because a price and cost do not exist on the AR Invoice Rows table.
So the question is: How do we properly join the Items table to display cost and price using Item table and not Invoice table.
All of the information from the Invoice table still needs to be there, and it is displaying fine. We just need a way to display price and cost based on the Items table and not the Invoice table.
Edited by: Steve Blake on Nov 17, 2009 12:33 PM
Edited by: Steve Blake on Nov 17, 2009 12:34 PM
Edited by: Steve Blake on Nov 17, 2009 12:35 PM
Edited by: Steve Blake on Nov 17, 2009 12:36 PM
Edited by: Steve Blake on Nov 17, 2009 12:37 PM
Edited by: Steve Blake on Nov 17, 2009 12:40 PM - Not sure why formatting won't work with the code in post

Similar Messages

  • Custom Report return no data

    Hi,
    i have a custom report, when i choose to log in the application with Arabic language and run the report it return no data, while it return data when i log with English language  ,
    i have English as basic lang and Arabic as installed lang and i am using R 12 .
    any help, many thanks.

    In Report Attributes tab, under Messages, you will see a section named "When No Data Found Message". In it, I added this javascript code. When no data was found, the javascript worked, and popped up a message box. You can replace the alert code below with a call to your javascript function.
    <script language="javascript">
    alert("no data found");
    </script>
    There is another way. In the Region Definition tab, there is a section called "Region Footer". In it, add this javascript:
    <script language="javascript">
    var i = #TOTAL_ROWS#;
    alert(i);
    </script>
    When variable i is zero, then you know that no data was returned.
    Hope this helps.
    Ravi

  • UCCX 10 CUIC Custom Report (using external data source)

    Hi.
    We have a customer where we are storing information in an external data source. We would like to built a report and import that report into their UCCX CUIC System in order for the customer to have the new report along side with the UCCX built-in reports. We need to add the external data source to CUIC but I'm not sure if the strip CUIC version of UCCX can allow that. Is that possible?
    I know that with CUIC Premium we can add third party data sources into the CUIC. The Premium CUIC NFR allows that and we can create the report but for it to work in UCCX we need to add the external data source to CUIC.
    What are my options? If any?
    Thanks in advanced,
    -Jose

    Hi Jose,
    You can basically build custom reports on a standalone CUIC server and import them to the CUIC on UCCX.
    But I am not sure if this datasource is continuously polling information from the DB and giving it to the report and if this is possible.
    Please refer to the link below for creating the custom reports on CUIC in UCCX:
    https://communities.cisco.com/docs/DOC-31936
    Regards,
    Arundeep

  • Report missing some data from dataset

    Hi
    I populate my report using a dataset and most of the time the report generation is successful.
    but after a while (3-5 reports) I start getting missing data in the report. Either the png blobs do not get printed or some other string fields. Usually the same strings are missing.
    If I continue generating reports after that I get "report could not be submitted for background processing" error or since I use some fields for formatting I get errors corresponding to those formulas where I try to use the missing fields.
    I have checked the dataset before SetDataSource and it is complete, images and all.
    Is there some way to restart the embedded crystal reports thread/process programmatically from c#? if the problem is because of memory fragmentation, this might solve the problem.
    I use crystal reports basic 2008 for visual studio 2008.
    Kind regards
    //Gunnar

    In a memory intensive environment like this, it is possible that we will run into these issues. The thing is - as I understand these tings, Microsoft does not let a 3rd party just go out and use the dataset. E.g.; the Crystal Reports engine is forced to make a copy of the dataset and use that. So, now you've chewed up more memory again. It would be interesting to do four things;
    1) monitor the memory and see if there is a particular value at which it is more likely to get the issue
    2) take out the report and dataset into another sample app that is not using these x-rays and see if you duplicate the issue there
    3) see if CR 2008 (12.x) handles the memory better. As these versions go, there are always improvements. I am not aware of a particular "thing" done to the report engine or database engine in this respect, but it may be worth trying. An eval of CR 2008 can be downloaded from here:
    http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    Once you have installed the above, check the version (Help | About). If the version is not 12.3.0.601, download SP 3 from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    4) rather than using datasets, would it be possible to write the data into some database temp table and consume the data from there?
    Ludek

  • Customized report based on data from 2 different infoproviders.

    Hi Team,
    The scenario is as follows:
    We have an Datasource based on a ECC Table which contains data based on FISCAL YEAR and no period field such as X03, X06 & X09. these values are populated in INFOCUBE A. Also note that the ECC table itself does not contain any field which refers to Period.
    In my another INFOCUBE B, I have the value for the Period (ZZPERIOD) field on a Quaterly basis.
    Now the report requirement is:
    For the input value of ZZPERIOD = 201103, display value X03.
    similarly for X06 and X09.
    PLEASE ADVICE.
    Thanks & Regards
    Sneha

    I'm not sure you've understood my reply. Do you understand the notion of granularity? If not please read about this and understand it. Then you will have the answer you need.
    I'm assuming you have KFs in both cubes right? Now if Cube A is aggregated by Year - you cannot split these figures by anything other than Year.
    Just because you want to add other key figures from another cube (B) whose values sit at Cal Quarter does not mean that any coded rules you apply will result in correct figures when you drill down to Quarter. How do you propose to fix that? Answer: you can't, it's impossible without getting yourself in a lot of trouble with the business/your client.
    Your best bet is to add a characteristic into Cube A called 'Source of Data' and fill that in your transformations. Then you can load both data from A and B into the same cube A. When reporting, just use a restricted KF to pull out the values you want.
    If you drill down by Quarter of course Cube A KFs will be "not assigned" for the simple reasons I explained above.

  • Custom Report producing inconsistent data columns

    Hello,
        I'm trying to create a detailed user report and it's not displaying properly.  The code is as follows:
    SELECT v_GS_COMPUTER_SYSTEM.Name0 as 'Computer Name','Chassis'=CASE
    WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 in ('3') THEN 'Desktop'
    WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 in ('10') THEN 'Laptop'
    WHEN v_GS_SYSTEM_ENCLOSURE.ChassisTypes0 in ('1') THEN 'Virtual'
    ELSE 'Unknown' END,
    vru.User_Name0 as 'User Name', vru.Full_User_Name0 as 'Full Name', vru.department0 as 'Department',
    vru.employeeNumber0 'Employee ID', vru.title0 as 'Job Title', vru.manager0 as 'Manager', vru.l0 as
    'Location', vru.streetaddress0 as 'Street Address', vru.telephonenumber0 as 'Telephone Number',
    vru.lastlogon0 as 'Last Logon Time'
    FROM v_R_User vru
    FULL JOIN v_R_System vrs ON vru.ResourceID = vrs.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM ON vrs.ResourceID = v_GS_COMPUTER_SYSTEM.ResourceID
    LEFT JOIN v_GS_SYSTEM_ENCLOSURE ON v_GS_COMPUTER_SYSTEM.ResourceID = v_GS_SYSTEM_ENCLOSURE.ResourceID
    ORDER BY v_GS_COMPUTER_SYSTEM.Name0
    I suspect my joins are not quite right.  Here is a small snippet of the output.  I cut out large sections to give an idea of how it's jumping around with the output.

    Your problem is you full join. User and computer does NOT join on
    vru.ResourceID = vrs.ResourceID
    They can only be joined by logon user details.  The catch is there are 4 different place to gather this info. Which one are you going to use?
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • RESCIS - Unable to select custom report from Selection Screen

    Hi all,
    we have developed a custom report for transaction "RESCIS-Evaluation of service charge settlement" but we have found that althought the report appears in selection screen field called "REPORT" it throws message RESCIS003 but the report is not shown.
    If we doesn't fulfill report field in selection screen, the program shows a second screen where a couple of ALVGrids are shown allowing the user to select the report that will be displayed. Here we are able to select our custom report and the data in it is displayed.
    We have analyzed the standard program that is executed via transaction RESCIS and we've found that the selection screen executes standard function RESC_GUI_ANYREPORTS_APPL that doesn't executes reports dinamically but statically. That means that SAP doesn't allows to execute custom reports directly from selection screen.
    I think this is a SAP error but afert opening an OSS message SAP sais that is not an error but a bad configuration or lack of knowledge for customizing it.
    Has anyone developed a custom report for RESCIS transaction?

    Hm what exactly did you want to change? Normally it is in REFX cases you should not copy standard REPORTS. In your case with transaction RESCIS, I myself do not see any need to add any functionality in this report because it is only a sum of all lists from your service charge settlement. What else do you want to see there?
    For displaying new fields in the separate lists maybe there is some BADI for it.
    Regards
    Michael

  • How to create custom reports.

    Hi ,
    Could you please let us know how to create custom reports which are data based and not analytics. Which is the best method , is it to devlop reports in sites or integrate with OBIEE reports. could you please let us know the best practices for this approach.
    Thank you,
    Sashank P.

    Hi Jiri ,
    Thanks a lot for your support. Below are my answers for the request:
    1) what data you want to report on? Is it data from a database? file system? Web service outputs?
    Ans : The Data would be mostly from Database only.
    2) what is the overall purpose of your solution?
    Ans: The overall purpose of this solution is to generate reports with sorting capability and should be able to export in different format documents.
    3) what is your architecture?
    Ans :
    4) why Sites?
    Ans: The customers login into our site and can be able to view the different reports and the present site is already a webcenter site. and the reporting capability is an enhancement .
    Can you please provide the right approach here. We have an option of using ADF or even we can use Webcenter Portals. So which would be the best approach to go. And can you please guide us any approach or examples for integrating Webcenter Portals and Sites and even integrating ADf with Sites.
    Thank you,
    Sashank P.

  • Custom report -Mb51 -EBELN,AUFNR,KDAUF & KUNNR -Data issues

    Hi,
    This custom report is related to material document list (MB51).
    I was trying to retrieve Purchase Order(EBELN),Order number(AUFNR),Sales order(KDAUF) & Ship-to-party( KUNNR) from MSEG & MKPF.
    Unfortunately
    It looks like for Sales Orders, it picks up the Customer Number but no Order Number. For STO’s, it looks like it picks up the STO # but no Customer #.
    How to over come this?
    FYI..I also tried adding fields to standard report(MB51) and it is also doing the same manner .
    Am I pulling it from Wrong tables? or is it related to DATA issues?
    Regards
    Praveen
    Message was edited by:
            PRAVEEN s

    Hi,
    This custom report is related to material document list (MB51).
    I was trying to retrieve Purchase Order(EBELN),Order number(AUFNR),Sales order(KDAUF) & Ship-to-party( KUNNR) from MSEG & MKPF.
    Unfortunately
    It looks like for Sales Orders, it picks up the Customer Number but no Order Number. For STO’s, it looks like it picks up the STO # but no Customer #.
    How to over come this?
    FYI..I also tried adding fields to standard report(MB51) and it is also doing the same manner .
    Am I pulling it from Wrong tables? or is it related to DATA issues?
    Regards
    Praveen
    Message was edited by:
            PRAVEEN s

  • How to populate the data for additional fields in custom report of fbl5n tr

    hallo friends,
    i ha ve to add some fields to the output of custome report of transaction FBL5N.
    Till now i have only added the fields to the output.
    Now i have to write the code to populate the data for those fields in the program.
    1.     Customer Credit Group(ACM/RCM): (Table: KNKK; Field Name: VKORG )
    2.     Credit Representative Group: (Table: KNKK; Field Name: SBGRP)
    3.     Customer Account Number(CAN#): (Table: KNKK; Field Name: KNKLI)
    4.     Alternative Payer(ALTP#) : (Table: KNA1; Field Name: KUNNR)
    5.     Risk Category: (Table: KNKK; Field Name: CTLPC)
    6.     Credit Info Number: (Table: KNKK; Field Name: KRAUS)
    7.     Rating: (Table: KNKK; Field Name: DBRTG)
    8.     Payment Index: (Table: KNKK; Field Name: DBPAY)
    9.     Credit control area: (Table: KNKK; Field Name: KKBER)
    10.     Company code: (Table: KNB1; Field Name: BUKRS)
    11.     Sales Organization: (Table: KNVV; Field Name: VKORG)
    These are al fields i have to populate in the program..
    MY ATTEMPTS:
    I tried getting the data for KNKK table by GET KNKK ,but it is giving some garbage values...
    And Logical database used here is DDF,and i have to add the VKORG of KNVV too...but KNVV is not there in DDF...
    Can anybody tell me how should i proceed..
    thanks in advance.

    Thnx Andreas,
    i have following doubts again..
    I have to add sales organisation field to the selection screen...(this is given in the req.)
    now if i will say GET KNKK...it would not keep account of this 'sales organisation' field...so how should i fetch the data with these input data( i.e. 'compny code' and 'customer' are the fields given by LDB and 'sales oraganisation' is the field i put it on the selection screen)
    And what about the KNVV-VKORG ,because the KNVV is not present in the LDB.

  • Custom Report Query - Patches install on specific computer AND date installed

    I'm looking to create a 2 custom reports that show installed.  I have a similar report already but it shows patches needing to be installed.
    Devices in a collection with columns for total number security patches installed (I'll break them out further by severity) 
    Breakdown of each patch installed on a computer (from report 1) and the date installed. (may also include severity, KB article, description etc.  I already have these fields)
    Essentially I'm looking for the query to pull this data and add to an existing report format I'm already using.
    Ideas?

    Garth,  
    Thanks for the reply.  I've flipped the 2->3 in the report and that gave me what I needed.  
    The other piece was the date installed. This was not in either report.  I did however find it under the database view ucsa.LastStatusChangeTime which my report was already pulling.

  • Custom Reports Data Model - can't report on custom dictionaries

    Custom Reports Data Model - can't report on custom dictionaries
    In QA and Prod I see custom dictionaries in the Custom Reports Data Model, in Test there are none.
    Dictionaries and Sevices marked Reportable are not showing up under Dictionaries and Services Dimensions.
    I rerun the ETL and the scheduled tasks, but no luck. any suggestions?

    Do you see any error when you run the ETL, i.e. the Java ETL embedded with the app server? 

  • Customizing report, list all GL items open as of a key date

    Hi Experts,
    For a customizing report, i have to list all those GL items open as of a key date, though they may be cleared now.
    i m finding in GL open items table BSIS, i can find open items (uncleared) only.
    please help me in developing this logic.
    Regards,
    Apoorv

    Table BSAS has cleared items but it also includes the clearing date, so you can combine results from both tables.
    Rob

  • Date type-specific Customizing missing for date type ACTActPln

    Hi all.
    I'm using a Web Service obtained by copying the CRM 7.0 built-in WS APPTACTCRTRC.
    I'm using it to create Appointments using an Adobe Interactive Form.
    It goes everything fine (a Date is created in the system, with all the input data properly set) excepted the dates...
    The WS uses two TIMESTAMPS, TIMESTAMP_FROM for StartDateTime and TIMESTAMP_TO for EndDateTime, whereas the GUI transaction to create Dates accepts dates and times in separated fields.
    Going in Debug I can see that the execution ends with the following error, referred to the involved entity (CRM_APPOINTMENT):
    Date type-specific Customizing missing for date type ACTActPln
    CRM_APPOINTMENT uses date profile 0000000001 with three possible date types: ORDERACTUAL, ORDERPLANNED and ORDERPROPOSED and I cannot find anywhere date type ACTActPln (just to add it in customizing).
    Is anyone able to enlight me?
    Thank you in advance!
    Alessandro
    PS I've years of experience in Java programming but I'm quite new to the SAP world. Maybe the problem is not a problem at all, but it seems to me as such. Even if it has a trivial solution, please let me know. Thx!

    Hi,
    Well I was about to write that you should enter date in decimal format. but you already did that as mentioned in How to set a date in a Form where the bound date format is a decimal?
    In response to following from above thread (copied for others to understand my response)
    Hi all.
    I'm successfully using the LiveCycle Designer and I've managed to remotely create Appointments using a CRM Web Service (a mere copy of APPTACTCRTRC).
    The only problem I'm encountering is that I'm not able to set the dates/times (start and end of the appointment).
    Dragging each of the two fields from the WSDL based Data Connection I obtain a Decimal Field limited to 15 digits.
    How can I write a date and time in such a field?
    I've tried with a retroverse date as YYYYMMDDHHmmss (for example, 20100301124500) but it does not work
    (the appointment is indeed created, but with the start date and time fields filled with
    the current date/time and the end date and time fields filled with the current date and time plus 10 minutes).
    The retroverse date above is only 14 digit long, so, maybe, this is the problem.
    But, given the field definition, I'm not able to fill a blank space between the date and the time.
    I'm not able to put a dot either.
    What should I do?
    Any suggestions?
    Thank you in advance.
    Alessandro
    15 digit in UTC time format here is fraction of second so you should enter 201003011245000 (add one more zero).
    14th Oct 2010 16:00 should be written as 201010141600000, so just try it and and see if it works, I guess if you do not supply end time then by default it will be starttime + 10 min but this is just guess.
    Regards,
    Gourav

  • Task Quantity in Custom Reports Data Package

    Task Quantity in Custom Reports Data Package
    Using the Custom Reports Data Package how can you report on task quantity?  Neither the ServiceTaskFact nor the RequisitionTaskFact tables have quantity as a query item. 

    Hi David,
    Thanks for your question. The good news here is that this is a common use case and can be addressed using standard Cognos functionality. Here are some general instructions for you and others who might be reading this post with a similar need. These instructions are for Cognos Query Studio.
    Build your report and drag a column/fact that is unique to the record onto the work area – I used TaskID.
    Highlight the TaskID column.
    From the left side menu, click Edit Data

Maybe you are looking for

  • Can anybody help me pls?

    im having a problem with my jsp and its giving me a null pointer exception <%                          if(request.getParameter("username")!=null){                               String username=request.getParameter("username");                        

  • Can no longer send mail - strange errors/activity

    I'm hoping a guru can help me. This is driving me insane. My mail has worked perfectly for years. Over the past 2 days, it can no longer send mail. I can recieve, but not send. It first began with error messages saying that it couldn't use Port 25. M

  • Self Event Registration

    I want to know if it is possible for a company that runs Marketing on-line to create an event where customers can register their themselves to that event. I.e. is there a self-service type application that runs on HTML where evenet registration can b

  • Calling stored procedure

    Hello Techies I want to call a stored procedure which does not return anything but it executes the query inside itself. How should I take the output from it �I want 3 values from that procedure. The stored procedure is::::::: CREATE Procedure NewPFAt

  • How do I get BT to LISTEN & RESPOND to my genuine ...

    I set up a new company with a new phone line in November with the sole aim of redirecting it to another manned line.  The setting up was oh so easy - nothing too difficult for the sales man on the line.  It was agreed a standard line, with add on red