Generate due dates

create table bills (id int,next_dt date,frequency varchar2(1));
insert into bills values (1,to_date('6/15/2013','mm/dd/yyyy'),'M'); -- Monthly
insert into bills values (2,to_date('6/15/2013','mm/dd/yyyy'),'W'); -- Weekly
insert into bills values (3,to_date('6/15/2013','mm/dd/yyyy'),'S'); -- Semi-annual
Given this data, how would one write a query to generate "due dates" for each item based on its frequency i.e. For id=1, the next payment date would be 7/15/2013 (1 month after the date specified), for id=2, it would be 6/22/2013 (1 week after its current date) and for id=3, it would be 12/15/2013 (6 months after its current date). Each row should generate the same number of "future" dates, say 6.
Help? Thanks

Hi,
Here's one way:
WITH cntr AS
        SELECT  LEVEL AS n
        FROM    dual
        CONNECT BY LEVEL <= 6     -- number of due dates to show
SELECT   b.id, b.next_dt, b.frequency
,       CASE  b.frequency
            WHEN  'W'  THEN  b.next_dt + (c.n * 7)
            WHEN  'M'  THEN  ADD_MONTHS (b.next_dt, c.n)
            WHEN  'S'  THEN  ADD_MONTHS (b.next_dt, c.n * 6)
        END AS due_dt
FROM        bills b
CROSS JOIN  cntr c
ORDER BY  b.id
,         c.n
Output:
        ID NEXT_DT     F DUE_DT
         1 15-Jun-2013 M 15-Jul-2013
         1 15-Jun-2013 M 15-Aug-2013
         1 15-Jun-2013 M 15-Sep-2013
         1 15-Jun-2013 M 15-Oct-2013
         1 15-Jun-2013 M 15-Nov-2013
         1 15-Jun-2013 M 15-Dec-2013
         2 15-Jun-2013 W 22-Jun-2013
         2 15-Jun-2013 W 29-Jun-2013
         2 15-Jun-2013 W 06-Jul-2013
         2 15-Jun-2013 W 13-Jul-2013
         2 15-Jun-2013 W 20-Jul-2013
         2 15-Jun-2013 W 27-Jul-2013
         3 15-Jun-2013 S 15-Dec-2013
         3 15-Jun-2013 S 15-Jun-2014
         3 15-Jun-2013 S 15-Dec-2014
         3 15-Jun-2013 S 15-Jun-2015
         3 15-Jun-2013 S 15-Dec-2015
         3 15-Jun-2013 S 15-Jun-2016

Similar Messages

  • How to generate 3 payment due dates& 3 posting against single invoice?

    Hello Experts,
    Kindly provides some inputs on below requirement.
    For example :- In the Utility Bill,
    Consumption months: June, July, August
    Meter Reading taken in August
    Billing Months: September, October, November
    Bill generated in August
    Consumer receives the bill on September month
    Payment Due dates: 12 Sep 2009, 12 Oct 2009 and 12 Nov 2009
    Issues-:
    1.How to generate three posting against single invoice?
    2.How to generate three payment due dates for above postings in three consecutive months since payment due date logic is incremental in nature here, e.g.
    1st due date = posting date + 15 days
    2nd due date = 1st due date + 30 days
    3rd due date = 2nd due date + 30 days
    Requirement description:-
    The utility generates bill quarterly for domestic consumers. For such consumers, the utility takes reading from the consumers premises after end of consumption period (quarterly ) and generates bill on the 1st billing month (here 1st billing month is September).
    In the bill the utility divides total consumption into three parts (considering each part for each consumption month) and calculates all charge heads separately on each part. It however, consolidates and generates a single bill having three rows, each row showing charge heads of each consumption month and also net and gross amount to be given for each consumption month.
    Moreover, three postings have to be generated in FICA against that single bill. Also, it provides three due dates to the consumer, each date falling in each billing month, to pay the above three net amounts respectively. Dunning and other activities should be triggered if the consumer fails to pay the stipulated amount by corresponding due date.
    Looking forward for valuable suggestions
    Thanks in advance
    Regards,
    Vaseem
    Moderator note - question reposted - OP notified of violation Issue on quarterly bill
    Edited by: William Eastman on Jun 3, 2010 3:25 PM
    Edited by: William Eastman on Jun 3, 2010 5:01 PM

    Hello Experts,
    Kindly provides some inputs on below requirement.
    For example :- In the Utility Bill,
    Consumption months: June, July, August
    Meter Reading taken in August
    Billing Months: September, October, November
    Bill generated in August
    Consumer receives the bill on September month
    Payment Due dates: 12 Sep 2009, 12 Oct 2009 and 12 Nov 2009
    Issues-:
    1.How to generate three posting against single invoice?
    2.How to generate three payment due dates for above postings in three consecutive months since payment due date logic is incremental in nature here, e.g.
    1st due date = posting date + 15 days
    2nd due date = 1st due date + 30 days
    3rd due date = 2nd due date + 30 days
    Requirement description:-
    The utility generates bill quarterly for domestic consumers. For such consumers, the utility takes reading from the consumers premises after end of consumption period (quarterly ) and generates bill on the 1st billing month (here 1st billing month is September).
    In the bill the utility divides total consumption into three parts (considering each part for each consumption month) and calculates all charge heads separately on each part. It however, consolidates and generates a single bill having three rows, each row showing charge heads of each consumption month and also net and gross amount to be given for each consumption month.
    Moreover, three postings have to be generated in FICA against that single bill. Also, it provides three due dates to the consumer, each date falling in each billing month, to pay the above three net amounts respectively. Dunning and other activities should be triggered if the consumer fails to pay the stipulated amount by corresponding due date.
    Looking forward for valuable suggestions
    Thanks in advance
    Regards,
    Vaseem
    Moderator note - question reposted - OP notified of violation Issue on quarterly bill
    Edited by: William Eastman on Jun 3, 2010 3:25 PM
    Edited by: William Eastman on Jun 3, 2010 5:01 PM

  • Cannot update due date in SharePoint 2010 Approvel Workflow generated Task

    Wondering why due date cannot be changed by users with List permissions on a Task which was generated from the built-in Approval workflow.
    I can have the workflow set the initial due date. The business process dictates that at times the due date need to be updated on the Task before they are completed (shift to the right or whatever).
    The column settings for the due date field do not seem to be set as read only??? why can the not be updated by users/admins?
    If the due date must be updated by a workflow how can a workflow be manually be run...like an administrator business process feature?
    BTW...this project mandates that all processes are run with OOB settings (codeless).
    Thanks
    Ok, found the answer to this on another post: click on the workflow status field of the workflow that generated the tasks. Then click "Add or update assignees". Very nice!

    Hi,
    Thank you for sharing this with us!
    Beside the way you mentioned, you can also try to reassign the task from the task list directly. Thus you can enter a new duration for this task and SharePoint will generate a new task.
    Thanks
    Pengyu Zhao
    TechNet Community Support

  • How to identify open sales orders by sales representative by due date. ?

    We rely heavily on forecasting our "billing pipeline".   Billing Pipeline is defined in our organization  by:
    All billings for a specified date range + (all open sales orders + deliveries)  not yet billed but due by  a specified due date = Billing Pipeline.  
    The open items list by Sales Orders + Deliveries will accommodate that by the company but does not accommodate a breakdown by sales person.
    I am looking for a way to generate all Sales Orders & Deliveries that are not yet billed by due date for each sales person. 
    Has anyone done this in SAP core reporting or have a query to accomplish this ...?
    Thanks, Dan
    Prograde

    This one will show you Open orders by open lines by Sales Person by Date Range
    You can use the same structure for Open Deliveries. Change Ordr to Odln and RDR1 to DLN1
    Regards,
    M. Jenkins
    SELECT T2.SlpName, T0.DocNum, T0.CardCode, T0.CardName, T0.NumAtCard as 'Cust PO', T1.ItemCode, T1.Dscription, T1.Quantity, T1.OpenQty AS 'Open', T1.Price, (T1.OpenQty * T1.Price) AS 'Total Net', T1.ShipDate FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode WHERE CONVERT(nchar(8), T0.DocDate, 112) >= [%0] AND  CONVERT(nchar(8), T0.DocDate, 112) <= [%1]  and  T1.LineStatus ='o' ORDER BY T2.SlpName, T0.CardName, T0.DocNum
    Edited by: Inc. Cowper on Feb 4, 2009 8:39 PM

  • Due date for BoEx is not picked up by payment programme RFFOF_V??

    Hi!
    I would be most grateful for your help/advise on my problem;
    I have a French customer for which I have set up BoEx with payment method 4 -LCR non accepté with payment programme RFFOF_V, as it is compliant with the bank's file specification "AFB-CONFB pour le virement et prelevement par fichiers".
    File is generated according to bank file specification (and accepted by bank), but I am having problems with the due date of BoEx since it is not picked up by payment programme when running trx F110. Instead issue date is picked up by file.
    What do I need to do/change in order for file to pick up BoEx due date instead of issue date?
    It should be possible to run F110 and group items so that file picks up information on due date instead of issue date so that bank does not withdraw money from customer bank account before BoEx due date..or??
    At least it was possible for payment method 2 LCR magnétique and payment method 4 does not seem that different.
    Ex.
    Trx: F110
    Posting date: 2014.04.08
    Docs entered up to: 2014.04.08
    Customer items due by: 2014.04.30
    Pmt method:4
    Next pmt: 20140501
    B.ex/pmt request > Issue date=2014.04.08
    B.ex/pmt request>Items Due by=2014.04.30
    B.ex/pmt request>Incoming pmt due by=2014.04.30
    Config settings for paying company code:
    Bill/exch pymt: X
    One bill of exch. per due date period: X
    Latest due date in: 90 days
    Bill on demand for due date up until:- (blank)
    Payment method 4: Create BoEX before due date.
    Any information that could help me resolve my problem is highly appreciated.
    Kind regards
    Linda

    Dear Ramana,
    I am really thank to you for your kind answer.
    With your guidence, i could able to solve this problem, but i would ask you one question.
    Why this sales order is not updated in VEPVG table? Does the data in  this table will archieve after some time. if yes what is that particular time.
    Onemore thing, my understanding on delivery due list VL10C, that system will not pick those sales order for which the delivery date is older than one month. i,e if the sales order in created in the month of september and has the delivery date as 29.08.2010 then system will not pick up this sales order.
    Please correct me if my understanding is wrong.
    Once again i am really thank you for your great help.
    Warm Regards,
    Sridhar Burugula

  • Change the Net Due Date of a vendor Document

    Hi,
    Can anyone please tell me if it is possible to change the net due date of an AP Local document (doc. type = RE) generated by MIRO?
    I`ve tried to change the base line date (Bline date) but this field is unavailable to be changed in my company`s SAP.
    There is any other way?
    Thanks in advance!

    Hi
    You can change the payment terms
    Also
    To make any field as modifiable check the document change rules in OB32
    Regards
    Sach!n

  • Calculation of due date based on Business Days for FICA documents

    Hi All,
    I am working on project where SD - FICA integration is in picture. We post some charges through SD and FICA document gets posted on relevant Contract Account.
    Normally we create Sales Order using transaction VA01 and then we do Billing for this Sales Order through VF01. After billng is done, FICA document automatically gets generated.
    We have following requirement to be fulfilled.
    For the SD bills posted as above, I want to calculate due date of these bills based on Business Days for FICA document generated (SAP Standard calculate due date based on Calander days). We can use factory calander for calculating business days in relevant function module.
    I have checked in the system and it seems that event 1330 ( FM - ISU_DUE_DATE_DETERMINE) is not working in this scenario. Is there any other FM which I can use?
    Can anyone help me on this?
    Regards,
    Pradeep

    Hello Praeva ,
    The event 1330 has a sample FM FKK_SAMPLE_1330. It doesnt even have a Standard Function Module.
    You need to create a Installation-Specific FM and put your code to determine the Due Date based on the logic.
    Rgds
    Ram Kumar.

  • Payment Block removed or allow to make the payment after the due date

    Hi,
    Regarding Payment block, we have created one payment term with block indicator and assigned to some vendors. So each posting system will generate the entry with payment block, once the document crossed the due date (assume that 30days) system wants to allow to make the payment to the vendor without deleting or removing  the payment block. Is it possible.
    govind

    Hello,
    For this change, you need to develop a program and need to identify the age of 30 days invoices and remove payment block for those invoices. So 30 days aged invoices can clear.
    Logic: go to BSIK and find out ZFBDT of the document and deactivate the ZLSPR (Payment block).
    Or
    try to find out any functional module or user exit is available while clearing invoices. if available maintain the above logic.
    Regards,
    venkat

  • Payment Stop Before Due Date.

    Dear All.
    I need to know is there any option we have to stop the processing of Vendor Payment against the NON DUE ITEMS.
    Here in my client, normal terms of payment is for 45 Days. Now the users are asking that, if a line item is Not Due as on Date, if by mistake we have selected such item for payment processing, the system should drop a error & stop the processing.
    The requirement is as follows as error message....
                 """ The Selected Item is Not Due"""""
    So, wht i have found out is, by changing the line item layout included the additional fields like:
    Due Date
    Item Due Indicators.
    But, here these are only for the information purpose, which dont have any control over item payment process.
    SO, CAN ANY BODY PROVIDE SOME IDEAS ON THIS, IF SUCH OPTION IS AVAILABLE IN SAP..
             """ LINE ITEM PAYMENT BLOCK IS NOT SUITABLE HERE """""
    Thanks
    Talluri

    Hi
    With my knowledge,  You have choosen the best process ie., brining the due date in the screen layout. even thou, the client required to make the error message, first work out the change of the message type
    or
    there is no such standard process to stop the payment voucher. Either you have to evaluate any routine
    or alternatively last option will be
    you can use the following procedure
    1. Maintain the Vendor Master -> Payment Transactions -> Maintain the Payment Block
    2. Generate the vendor line item daily with due date is "today's" date & select the MIRO document numbers.
    3. Release the documents through MRBR by selecting the above line items.
    This is for your information.
    Regards
    Anilkumar

  • Vendor due date analysis

    Frnds
    I need to generate the report which consists of Vendor number, vendor name and invoice no with total amount of invoice and due date of that invoices.
    is it possible i cna get all the above required information in one report?
    actuall i tried to check out that due date analysis report but didnt fullfill my requirement.
    Please reply asap
    Thanks

    Hi Methew,
    There was a similar post for transaction FBL5N, please refer below post:
    Name field in FBL5N transaction
    <i>"You need to code BTE 00001650 to add extra data to your FBLxN reports.
    We have added name for customer and vendor to our FBLxN reports. We even added to FBL3N since we use line item management on our reconciliation accounts. It provides an alternative view of your subledgers with the name of the customer and vendor to boot.
    "</i>
    Hope this helps.
    Pls assign points as way to say thanks

  • Open item due date forecast

    Hi
    i run the report   due date forecast for particular customer   fi customer only
    it gives report like
    company code  /   busa  /   total open / due in 8days or less  /  due in 30 days or less  /due in 30 days or more
    data came only in company code  and business area  and total open otems
    issue is  i would like to generate one report   i need some data in  due in 8days  or less  /// due in 30 days or less
    inorder to get this report  what should i do   i need to do any  i need to assign any dunning procedure in customer data
    plz  put some light on this
    thanks
    mvnr

    Hello,
    If the standard report are not sufficing your requirement,
    I would suggest you create a FORM in FDI4 - Refer FDI5 and FDI6 for standard forms.
    Create a report in FDI1 and assign the form that you have created in FDI4.
    Refer FDI2 and FDI3 for standard reports.
    You can flexibly configure the forms according to your requirement and even add the formulas.
    Regards,
    Ravi

  • Payment due date was changed without notice

    I received a text message on 7/9/15 advising me my bill would be due on 7/23/15 rather than 8/1/15.  A text message is really not an appropriate form of notification first of all. If I'm 2 days late you charge me a late fee, yet my billing cycle can be changed without notice?  I called on 7/9/15 regarding this along with many other issues I have been having with AT&T.  I was told this was corrected and my bill would be due on 8/1/15. Today I recieve an email stating my bill is due on 7/23/15.  I again contacted AT&T and I was told this change was never made by the agent I spoke to. I was apparently lied to.I was then told it would take up to 2 billing cycles to change it back to 8/1/15. So in short, AT&T can change my billing cycle without notice yet it takes 2 months to change it back?  At the very least I would call this practice. I have been with AT&T for many years and will likely cancel once my contract is up in December.

    My billing cycle had always run from teh 20th of the month to the 19th of the following month, with the bill due around the 17th.  Several months back, AT&T notified me that my bill due date would be changed by up to one week.  I got serveral weeks notice, and when my due date changed, my bill is now due on the 14th of the month.  The billing cycle did not change, it is still the 20th to the 19th, but the due date move up by 3 days.  Since my billing cycle ends on the 20th, and it had always taken 3-4 days before the bill was generated, the new due date now means it's due 3 weeks after the bill is generated.
    If you look back at the details of the bill you have received (either paper or electronic) you will probably find a small section in there telling you that this change was coming.  So many people don't look at their bill each month, they just look at the total and say, "yeah, that looks about right" and they pay it without looking at the details of what they are paying for.  If there is an error in your bill, you only have 90 days to bring it to AT&T's attention, so it is in your best interest to look at it each month.

  • SD down payment invoice due date

    Hi,
    Down payment request invoice is generated in SD ,and its clear that the due date in FI document corresponding to this will show the posting date as Due date.but our client needs that the due in downpayment request should be according to the payment terms .i.e it should show due date according to payment term days in the FI document generated automatically when the invoice is saved.is there any user exit /any modification so that the due date should be calculated in background accoding to payment terms when the invoice is saved.
    warm regards,
    rohit

    Hi Glynn,
    I have gone through the sap note ,but in case if the payment terms day is only 5 days i.e  today i will do the invoice and after 5 days it should be due. how this can be done and also if 40 days is payment terms then how we can map this in SAP.
    Thanks & Regards,
    Rohit

  • Incorrect net due date in FBL5N

    Hi,
    I have problem with incorrect net due date in FBL5N. I made payment term "120 day end of month". Configuration of payment below.
    Maturity date whitch is invoice is correct. For example: Invoice was generated on 6th of February and the maturity date is 28th of June. Problem is that the net due date in FBL5N is incorect, it means net due date is 8th of June. This date isn't counted from end of the month.
    Does anyone have any suggestions on a fix?
    Thanks

    SAP has standard functionality for credit note (without invoice reference) to populate net due date as base line date itself irrespective of payment terms. Hence net due date and base line date is appearing same in FBL5N.
      For this, we have to put “V” in invoice reference field (BSEG – REBZG). By putting “V” SAP correctly populates net due date in FBL5N. We have done this manually for below mentioned customer and its working fine. It can be automated by writing user exit mentioned in the link.
    http://scn.sap.com/thread/342202

  • Payment term configuration with installment and due date

    Hi,
      I have one requirement,  one paymne term we have as 40 % advance and 60 % after 45 Days,  in description it is as mention,  when we do the MIRO one accounting etry is generated in system we can check in FBL1N,  now as only one entry is created  and the due days are as we maintain in No. of days  so according to that the due date is calculated  but the requirement is system should show two due date  as 40 we have to pay advance  so for that for 40 paymne tamount is should so one due date  and for remianing amount it should show different due date, How to configure this.
    regards,
      zafar

    Hi,
      Can you help on this issue.
    regards,
    zafar

Maybe you are looking for

  • TOTALLY disappointed in Apple

    I bought an iPhone from my local Apple store on 12/22. Gave it to my wife on the 25th. She didn't want it. I went back to the store to return it on the 6th, 15 days later. The store said they couldn't take it back--unused, never taken out of the box-

  • Install Acrobat 9 Pro from Disk purchase onto laptop with no disk drive

    I have a disk version of Actobat 9 Pro purchased. I want to install on a new laptop with no disk drive. I have tried downloading Acrobat 9 Pro from the adobe.com website and am getting an Invalid Serial Number message.  A little help please!

  • "RCL" folder in all hard drives

    Can someone help creating a batch file? I want to locate "RCL" folder in all hard drives on a computer and copy few important files and folders from this directory.It needs to be DOS batch file.

  • NotSerializableException using PreparedStatement in 2.3.1

    Hi, I tried the new 2.3.1 and got a java.io.NotSerializableException using query.executeWithMap(...) on a precompiled query. The same query without precompilation succeeds. We use an Oracle 8.1.7. This is the query: String filter = "fromStateNode ==

  • Office set up question

    We currently have this set up in our office complex: Modem>Original TC (not dual band in main office)>Airport Extreme (Dual band in another bldg). My question is would my "n" computers in the main office have faster access to the internet by putting