How to get exact Ageing Date In "Customer Receivable Ageing" report?

Need query   that  give the exact aging date instead of date/month range  in customer receivable ageing.Pls Help

Hi,
Please note, just added for 52 days. if you want more days, just add.
declare @Cust as nvarchar(20)
Declare @FromDate Datetime
Declare @ToDate Datetime
declare @Group as nvarchar(20)
set @cust = (select max(t0.cardcode) from OINV t0 where t0.cardcode = '[%0]')
Set @FromDate = (Select min(t0.Docdate) from dbo.OINV t0 where t0.Docdate >='[%1]')
Set @ToDate = (Select max(t0.Docdate) from dbo.OINV t0 where t0.Docdate <='[%2]')
set @group = (select max(t2.groupname) from OCRG t2 where t2.groupname = '[%3]')
SELECT [CustName] as CustName, [G] as CustGroup, [1] as '1', [2] as '2', [3] as '3', [4] as '4', [5] as '5', [6] as '6', [7] as '7', [8] as '8', [9] as '9', [10] as '10', [11] as '11', [12] as '12', [13] as '13', [14] as '14', [15] as '15', [16] as '16', [17] as '17', [18] as '18', [19] as '19', [20] as '20', [21] as '21', [22] as '22', [23] as '23', [24] as '24', [25] as '25', [26] as '26', [27] as '27', [28] as '28', [29] as '29', [30] as '30' , [31] as '31', [32] as '32', [33] as '33', [34] as '34', [35] as '35', [36] as '36', [37] as '37', [38] as '38', [39] as '39', [40] as '40', [41] as '41', [42] as '42', [43] as '43', [44] as '44', [45] as '45', [46] as '46', [47] as '47', [48] as '48', [49] as '49', [50] as '50', [51] as '51', [52] as '52'
from
(SELECT T0.[CardName] as CustName, sum(T0.[DocTotal]) as Total, datepart(dd,T0.[DocDate]) as DAYS, t2.groupname as G  FROM OINV T0   left JOIN OCRD T1 ON T0.CardCode = T1.CardCode left JOIN OCRG T2 ON T1.GroupCode = T2.GroupCode   WHERE year(T0.[DocDate]) = 2013 and T0.[CardCode] = @Cust and  T0.[DocStatus]  ='o' and T0.[DocDate] between @fromdate and @todate and t2.groupname = @group GROUP BY T0.[CardName],T0.[DocDate],t2.groupname
union all
(SELECT T0.[CardName] as CustName, -sum(T0.[DocTotal]) as Total, datepart(dd,T0.[DocDate]) as DAYS,t2.groupname as G  from ORIN T0  left JOIN OCRD T1 ON T0.CardCode = T1.CardCode left JOIN OCRG T2 ON T1.GroupCode = T2.GroupCode   WHERE year(T0.[DocDate]) = 2013 and T0.[CardCode] = @Cust and  T0.[DocStatus]  ='o' and T0.[DocDate] between @fromdate and @todate and t2.groupname = @group  GROUP BY T0.[CardName],T0.[DocDate],t2.groupname )) S
Pivot
(sum(S.total) For DAYS IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12], [13], [14],[15],[16],[17],[18],[19],[20],[21], [22], [23], [24], [25], [26], [27], [28],[29], [30], [31], [32],[33],[34],[35],[36],[37],[38],[39],[40], [41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52])) P
Hope helpful.
Thanks & Regards,
Nagarajan

Similar Messages

  • Add Doc. Date to "Customer Receivables Ageing" report

    Hi!
    Let me know if you can in the PLD layout called "Business Partners Aging (Details) (System)" show instead of the Posting Date the Doc. Date.
    Thanks!

    Hi,
    Please check Note No. : 1260740.
    Extracts from the Note :
    Symptom
    How to print Posting date, Document date or Due date of the documents on Detailed Receivable Ageing Report.
    Cause
    Consulting
    Solution
    In 2005 A version this is not possible to print Posting date, Due date or Document date on Detailed Receivable Ageing Report. However this can be printed in 2007 A Version.
    To do this please follows the below steps:
    1. Open the customer receivable ageing report as follow:
    Reports -> Financials-> Accounting-> Ageing-> Customer Receivable Ageing
    2. Run the report.
    3. In the 'Customer Receivable Aging' window you can Age by Due date/Posting date/Document date. Here select any date (that you want to display) e.g. Document date for ageing.
    5. Take the print preview.
    6. Select the option "Detailed Receivable Ageing Report" from the print options.
    7. Click on Ok.
    You will see that Document date of all the documents will be printed.
    Check if it helps.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Variable for Document Date in Customer Receivable Aging

    Hi all,
    This is regarding u201CCustomer Receivable Aging u2013 Detailsu201D in SBOne.
    In the print layout, I found 3 types of date in system variables i.e.
    1) system variable 184 = Due Date
    2) system variable 185 = Posting Date
    3) system variable 187 = The is vary by u201Cage byu201D Date (either document date, posting  date or due date)
    Regardless the date chosen for aging, we would like to display both Invoice (Document) Date and Due Date permanently on the layout.
    Does anyone know what is the system variable for invoice/document date in this layout. Thanks for help in advance.
    Regards,
    Eric Tan

    Sorry this is no right answer. I had test it variable 65 doesn't work.
    I found that the System variable 187 will be either document date, posting date or due date based on the aging date selection in Receivable Details Aging Report
    Any other advise.How to check the all the variable in Receivable Detals Aging Report.
    Thanks.

  • How to get the output data of Standard drill down report into z-program?

    HI every one,
            I want to get the output data of drill down report into z-program.
           Actually,if the output is only one, I can get into z-program,
          But, Here the report consists 3 alv outputs. when double clicking function happens, it will direct to another alv output.
        Those, all the outputs of report i want to get into z-program.
    PLease , give reply as early as possible.
    Thank u in advance,
    karthik

    HI,
      When i download,only one output i will get.
      But,if i double-click the particular record it will show another output. I want that output also.
      Like that,when i double-click particular record, it will show some other alv ouput based on record,     
    i wanted all those outputs.
    If  i copy the code, whether i face any problems?

  • BI Publisher: how to get Oracle database data row as interval in report

    Dear everyone,
    I am new to BI publisher and trying to get a data from Oracle table and display it as cumulative columns in a report. But stuck at this, please help, detail as below:
    Example: this is a sample of database table taken from Primavera application ODS
    == Activity ID == Start == End == Budgeted_Labor_Unit == Remaining_Labor_Unit
    == A1000 == 01-Jan-10 == 30-Jan-10 == 1000 == 500
    == A1000 == 01-Feb-10 == 28-Feb-10 == 1500 == 500
    == A1010 == 01-Jan-10 == 30-Jan-10 == 500 == 500
    == A1010 == 01-Feb-10 == 28-Feb-10 == 100 == 100
    How to make a report in BI Publisher and display above data as below:
    == Activity ID == Jan-2010 Budgeted == Feb-2010 Budgeted
    == A1000 == 1000 == 1500
    == A1010 == 500 == 100
    Is this possible in BI and how to do that, please help!!!
    Best Regards,
    Duy

    Hi ,
    OEM starts gathering the data after agent is installed and management packs are applied on the database.
    So you cannot get the data before the agent installation.
    Apart from that, if you go on to the database home page, the click on metric collection errors.
    Most of the time you will find many metric collection error regarding to the targets.
    I had faced the similar issue and agent was not able to capture the space usage due to metric collection error.
    Please search on metalink and metric collection error may be due to some bug/permission issue.
    Once all metric collection issues are resolved, and management packs are enabled then you can see the reports.
    Regards
    Rajesh

  • How to get exact date using to_date

    Hi all
    how to get exact date over there
    select TO_DATE(TRUNC(PLLA.CREATION_DATE),'DD-MON-YYYY'),TRUNC(PLLA.CREATION_DATE),round(PLLA.CREATION_DATE),
    TO_DATE(round(PLLA.CREATION_DATE),'DD-MON-YYYY'),TO_DATE(PLLA.CREATION_DATE,'DD-MON-YYYY'),PLLA.CREATION_DATE,
    TO_DATE(TRUNC(PLLA.CREATION_DATE)),TO_DATE(round(PLLA.CREATION_DATE))
    from po_line_locations_all plla.
    In one of the plsql program i want to compare the creation date with given date where as creation date is in Timestamp format

    Hi,
    Use trunc or to_char with masking like 'dd/mm/yyyy' format. If this does not solve your problem then do post your sample input and sample output. As I am unable to make out what is your actual problem.
    Regards

  • POSTING DATE RANGE INCLUDED IN CUSTOMER RECEIVABLE AGEING REPORT PLD

    Dear All,
    Please can you tell me how to print the posting date range selected in the parameter selection for Customer Receivable Ageing Report PLD.
    Thanks
    Gary

    Dear Rahul,
    I know that but it is really painful to develop the whole report in crystal where it is available in SAP itself. Imagine just for one requirement i will have to build the whole report in crystal. I think SAP should give flexibility to change the hard coded reports.
    Regards,
    Gary

  • Customer Receivables Aging Report doesn't show correct data

    Hi Experts,
    I have some problem when executing Customer Receivables Aging Report.
    I'm using 8.8 PL14.
    (It should be bug this is very strange ...)
    I can't get same result even if I run it continuosly when I selected option "group by Customer" .
    Total amount of balance due is change each time because of BP shown in the report is change.
    I also got the message " Data is not available, modify selection criteria and re-enter" even though I never change selection.
    During executing this report, no Invoice and JE and banking data were input.
    Please advice if you know about this error or having something information.
    Thanks,
    Kaori Shirasuna

    Hi,
    The latest patch level available for B1 8.8 is PL16. it will be released on week Oct 25-29, 2010. You may directly upgrade to this latest patch level to solve the issue. If you want to try using query SQL to generate the aging report, there are some threads discussion about the query. You may search it in the SBO reporting and printing forum.
    JimM

  • How to get  the actual data in ALV report

    I am doing some upgradation work   in that i am using Submit  & And return and  also i am using some function modules like LIST FROM MEMORY , LIST TO TXT wnd WRITE LIST , it gives output in normal list format , But i need to print in ALV report .
    With the use of set table for 1st display i got the  ALV report   but not with actual data, (some junk value is showing) , So can any 1 suggest me how to get  the  actual data in ALV report, With the use of  Any Function Module or with Coding,
    with regards,

    Hi Saravana
    I am sure you must be getting the values in tables of table parameters from every FM.
    consolidate the values from tables of all FMs in one table and built ALV for that table only.
    I hope this way you can show the actual data in ALV.
    thanks
    Lalit

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • *** How to get the username in a custom password change routine....

    How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
    We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.

    OK !
    Use that maybe good :
    select USERID into v_user from sys.aud$
      where ntimestamp#=(
      select max(ntimestamp#)
      from sys.aud$ );

  • How to get last Build date of a dll in the real time target

    Info On My Project    
       I am working on LabWindows CVI 12.0 for development . This project is a real time application for hardware, which is having Phar Lap ETS as RTOS...  
    I am facing some problems while checking Build date of my Application file( .dll)
    I have tried to use GetFileDate API. But it is not supporting for realtime Target..
    So i have tried __DATE__ macro.. That also having some problems..
    How to get last Build date of a dll from the real time target  ??
    Please Help to solve this....
    Thanks
    Vaishakh A  K

    Please reply if any one have suggestion...

  • I loos my APPLE ID, I have a new one, how can get access to data stored in the old one?

    I loos my APPLE ID, Now I have a new one, how can get access to data stored in the old one?

    Do you have the email & password of the old Apple ID?

  • How to get the "current date" in the BEx?

    Hi all,
    I need to get the "current date" in my Bex report in order to make a comparison. I know there is a "How to" which shows how to get the current date via a User Exit, but I didn't find it. Could you please help me?
    Thanks

    1. Create a  New Formula in Key Figures structure
    2. Give tech name and description and Select "New variable" option
    3. Next screen will launch Variable Wizard -> create a new variable with replacement path as processing type
    4. in next screene  select the date characteristic that represents the first date to use in the calculation (From Date)
    5. In the next  screen select Key in the Replace Variable with field. Leave all the other options as they are
    6. In the next Currencies and Units screen select Date as the Dimension ID.
    6. Save variable
    repeate the Above steps to create another variable (To Date)
    and now you can use these two new replacement path variables in your new formula.
    Dev

  • How to get the current date in a workflow

    Hey,
    Can anyone tell me how to get the current date while in a workflow?
    Thanks in advance.

    Here is how we did it, hope it helps
    <defvar name='locCalendar'>
    <new class='java.util.GregorianCalendar'/>
    </defvar>
    <defvar name='dateFormat'>
    <new class='java.text.SimpleDateFormat'>
              <s>MM/dd/yyyy</s>
         </new>
    </defvar>
    <defvar name='formatedDate'>
         <invoke name='getTime'>
    <ref>locCalendar</ref>
    </invoke>
    </defvar>
    <invoke name='format'>
    <ref>dateFormat</ref>
    <ref>formatedDate</ref>
    </invoke>

Maybe you are looking for

  • Set multiple items with javascript function in chart link

    Hi Folks I am able to use the javascript $s function to set the value of one item from a chart link. I need to pass values to multiple items. Is there a way to use javascript function to pass values for multiple items on a page from a chart link Appr

  • How to display PDF on each device

    We observed some mobile devices don't open the PDF directly and start to download. Does this depend on OS, Browser or something else? We tested iPhone and Android. Android starts to dawnload PDF by clicking PDF on our application. User has to open th

  • Problem in hosting Siebel application after configuration

    Hi All I was able to configure Siebel gateway, database , server and web server extension successfully. But after the web server extension configuration the PUBLIC folder in SWEApp is not having any files in it. The IIS default website in not having

  • Iphone5 OS7 pastes web address when I copy a gif or pic. WHATS UP

    When I find a gif or even a picture I want to copy, I do the same thing I did before upgrading to OS7.. finger on screen until box comes up with options to save, copy , open .. blah blah then go to a message box or whereever I wanted to paste and pas

  • Airport express is driving me crazy...help!

    I have a modem set up connected to a dlink wireless router which I use to connect to the internet on my powerbook G4. I have the airport express only connected to the home stereo so that I can use airtunes to wirelessly play music from my powerbook G