Basic logic for date

Hi Folks,
I have a v_date variable to hold a date value.Now my requirement is:
        v_date:= SYSDATE+2 if date is going to change in next 1 Hour.
Else assign v_date:= SYSDATE+1
How to achieve it please.
Thanks in advance.
gvk.

Hi,
Here's one way:
v_date := SYSDATE + CASE
                        WHEN  SYSDATE <= TRUNC (SYSDATE) + (23/24)
                        THEN  1
                        ELSE  2
                    END;

Similar Messages

  • Logic For Data Fetching

    I am doing a dump program for qp02 change inspection plan and  unable to fetch the data for qualitative and quantitative fields these fields can be x or '' . iam not getting the fields in plmk table..when i changed these fields STEUERKZ in plmk table gets reflected by adding
    X= . i think there is a different logic for it.If any one
    knows then pls reply me.
    regards.
    Sanchit Sharma

    Hi KR,
    if you want particular items from the table VBREVE (Revenue Recognition: Revenue Recognition Lines)
    Pass all the keyfields in where condition..
    try to provide maximum field values from below list in where condition... if you are not be able to get it directly then try to get it from some other tables and then paas it here...
    VBELN ==> Sales Document
    POSNR ==> Sales Document Item
    SAKRV ==> G/L Account Number
    BDJPOPER ==> Posting year and posting period (YYYYMMM format)
    POPUPO ==> Period sub-item
    VBELN_N ==> Subsequent sales and distribution document
    POSNR_N ==> Subsequent item of an SD document
    also have a look on other tables related to this...
    VBREF
    VBREVAC
    VBREVC
    VBREVE
    VBREVK
    VBREVR
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Write custom logic for data archiving using Open text(SAP archiving)

    Hi,
    We are currently doing archiving for sales documents and billing documents using Open text. As part of this we need to have a search functionality based on Sales document,customer number, customer address etc...
    since customer address doesn't exist in sales order tables we need to write logic so that the document gets archived and retrieved using the address.
    can you please help me out in how and where to write logic for this...can this be achieved?
    i observed an area on Attribute Object for a Node which gives an option for Event and User exit. can this be used..if so how?
    Thanks,
    Anil

    hi,
    please write more detailed information what do you really need...

  • Formula Logic for Dates in the Cell Editor in Query Designer

    Hi All
    We are on BI7. (This is in the Cell Editor in Query Designer)
    I am trying to create a formula in one cell that enters a date based on the following logic (Lets call this formula A):
    I also have a placeholder "Cell reference" for a Date in another cell in the Cell Editor (Lets call it B).
    I also have two other dates in seperate cells in the Editor (Lets call them C and D)
    What i need to do is check that either C or D are not blank i.e one at least has a date and if so enter the date that is in B in A.
    My formula logic in (Cell A) at the moment is as follows:
    ( Cell C <> 0 ) OR ( Cell D <> 0) * Cell B
    When I run the query It is coming back with either a 1 or  0 depending if there is a date in C or D.
    What I want it to do is to display the actual date of  'Cell B'  in 'Cell A' if  ( Cell C <> 0 ) OR ( Cell D <> 0)
    If the value of B is blank ie no date I also want A to be blank i.e not equal zero or a blank date ie 00/00/0000
    Example 1
    Cell A    08/09/2009
    Cell B    08/09/2009
    Cell C   15/03/2010
    Cell D
    Cell A should = 08/09/2009 as there is a Date in Cell C or D and if so enter the date of Cell B in cell A
    Example 2
    Cell A   
    Cell B    08/09/2009
    Cell C  
    Cell D
    Cell A should = BLANK as there is a NO Date in Cell C or D
    Example 3
    Cell A   
    Cell B  
    Cell C   15/03/2010
    Cell D
    Cell A should = BLANK as there is a No Date in Cell B although a Date in cell C or D.
    Thank you for assistance in advance
    Kind regards
    Stevo

    Hi there,
    It seems you have done almost everything...
    What it seems that is missing is probably the cell reference for Cell C and for Cell D, or did you forget to mention it here?
    So here it is the big idea:
    - In the Cell Editor of the query designer, create a new cell reference for Cell C, let's name it ref_cell_c;
    - In the Cell Editor of the query designer, create a new cell reference for Cell D, let's name it ref_cell_d;
    - In the Cell Editor of the query designer, create a new cell reference for Cell B, let's name it ref_cell_b;
    - In the Cell Editor of the query designer, create a new formula for Cell A, let's name it form_cell_a;
    The form_cell_a should be created by the following:
    ( COUNT(ref_cell_c) + COUNT(ref_cell_d) ) * ref_cell_b
    So COUNT(operand) returns 1 if operand is different of 0 else it returns 0; So if ref_cell_c has any valu or ref_cell_d has any value it should return the value of ref_cell_b.
    Please note that with this formula, if you have values in both ref_cell_c and ref_cell_d this formula returns 2 * ref_cell_b, which is not what you pretend, I'm assuming you'll have value only for the following combinations:
    ref_cell_c has value but ref_cell_d don't have any
    ref_cell_c don't have any value but ref_cell_d has a value
    ref_cell_c don't have any value neighther has ref_cell_d any
    Diogo.

  • Calculation logic for date with respect to time.

    Dear all,
    In BI, i want to get the time for two different dates - how to caculate this
    For example
    Initial date :- 01.08.2007
    Final date :- 24.08.2007  - I want system to calculate the total hours between these dates - the logic should also be applicable if years,months and days are different.
    Regards,
    M.M

    Dear ....
    By subtracting final from the initial we will be able to get if the difference is only in days but if the month or year is differing will the same logic hold good - kindly explain?
    Regards,
    M.M

  • Logic for data transfer

    Hello,
    I have a requirement, wherin there are 10 tables for which the data changed/inserted/deleted for any field needs to be transferred to third party.
    I have gone through the change pointer concept and found that SAP does not recommend this as this will create large number of change pointers in the system
    Second option was to create techincal log for each table to log the change.But here again it will slow down the system as everytime system has to write the log when updating the table.
    Third option was to write report to get all the record for a particular date based on change date from the table and write down into custom table. The custom table is then treated as source. But here the problem comes when there is no 'Change date' field in the table. For some table we do not have change date field.
    Can somebody suggest what should be the best approach to filter the changed data.
    Thank you!
    Arvind

    Hello Arvind,
                       why not u try to achieve IDOC's concept as whatever the change will occur in Database that will store in idoc.And most beneficial thing is this that u can see idoc whenever u want and can easily find out what changes has done by which idoc.So i suggest u to try IDOCs.
    Thanx,
    Vaneet Thakur

  • Logic for date

    hi all,
    in the selection screen i have fields like BUKRS, COST CENTER, PROFIT CENTER, PERIOD, AND YEAR.
    The problem is if i give period as 5 i.e., may and year as 2008
    i need fetch the records from 1 st may to 31st may only.
    can any one please help me how to write code for this.
    thanks in advace

    Hi,
    you the code below :
    ranges : gr_date for bsis-budat.
    CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
        EXPORTING
        i_gjahr              = sp_gjahr
    *     i_monmit             = gp_monat
          i_periv              = 'K4'
          i_poper              = sp_monat "Period
    IMPORTING
         e_date               = gv_firstday
    EXCEPTIONS
       input_false          = 1
       t009_notfound        = 2
       t009b_notfound       = 3
       OTHERS               = 4
      CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
        EXPORTING
          i_gjahr              = sp_gjahr
    *           I_MONMIT             = gp_monat
          i_periv              = 'K4'
          i_poper              = sp_monat "Period
       IMPORTING
               e_date               = gv_lastday
             EXCEPTIONS
               input_false          = 1
               t009_notfound        = 2
               t009b_notfound       = 3
               OTHERS               = 4
    gr_date-sign = 'I'.
    gr_date-option = 'BT'.
    gr_date-low = gv_firstday.
    gr_date-high = gv_lastday.
    append gr_date.
    "And use gr_date in the date field of select statement while
    "retrieving the data.
    "And declare period as T009B-POPER
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Jun 19, 2008 12:29 PM

  • Treasury - Cash Management 0TR-CM-1 logic for Data Source

    Hi all,
    I am trying to understand how the value of the DATA_SOURC field in the extract structure FTI_BIW_CM in DS 0TR-CM-1 is populated. This value propagates to the InfoProvider (0TRCM_RC1) and standard content queries have a hard-coded restriction to a value of '2' The DS is returning values of 1 and 2 and I need to understand the implications of the two values. The help pages don't provide this information.
    Any help is greatly appreciated.

    Hi,
    Extractor 0TR_CM_1 reads from table FDSB and FDSR. Not sure what could be
    the reason for this code to avoid zero values. Please check with application
    colleagues if zero values are allowed for this field in ECC system.
    Thanks,
    Vimal

  • Need logic for invoice due date and discount due date uncear

    Hi Experts.. am new to ABAP
    i had an issue please need some logics for these..
    Formatting of the Invoice due dates and Discount due date is unclear e.g 20101109,
    Invoice due date and Discount due dates are in correct on 10 and 20 days  reminders on missing credit notes for blocked invoices.
    <removed by moderator>
    Thanks & Regards
    Edited by: Thomas Zloch on May 18, 2011 1:55 PM

    Can you provide more info?
    are you talking about BSID open accounts?
    if yes, use function module DETERMINE_DUE_DATE.
    <removed by moderator>
    Edited by: Thomas Zloch on May 18, 2011 2:10 PM - please do not ask for "award"

  • Logic for finding transfer order creation date for a given delivery??

    Hi,
    I am trying to find a logic for connecting the table LTAK which has ERDAT as the T.O. creation date with LIKP/ LIPS table.
    Can you please help me with this information. 
    Regards,
    Peeyoosh.

    Hi,
      Go to LTAP to get the transfer order number based on delivery ltap-vbeln. Then got to ltak to get the Creation date.
    Hope it helps
    Vinod.

  • Logic for sending data files to multiple instances of Central

    We are using Central Pro Output Server 5.6 with a single Central instance as of default installation on a Windows Server 2003. Data for the transaction files coming from our iSeries system via a printer queue (\\.\pipe\jetform\queuename)
    Now we want to be able to produce more documents from Central much faster and therefore setting up multiple instances of Central. The problem is then where to put the logic for choosing instances.
    The simplest way to do this would be to have iSeries to alternate the data files to different pipes (printer queues) for Central. But as we dont want to change our iSeries configuration for this, is there a way to solve this problem in Central?
    Any help with this is much appreciated

    Central provides no mechanism that I'm aware of that would do anything resembling the job distribution that you are wanting. Central is written to monitor it's input folders and process the files it finds there. Each instance is essentially separate from each other.
    Your source system will need to select the appropriate instance to be used. Either that or you will need to have something between the source system and Central that is doing the distribution. For example, you could have the source system write to a folder that is not being monitored by Central and write a program that runs as a service that does monitor that folder. This program would then distribute the files. The likely drawback of having an intermediary program is that you are likely to not end up getting the documents printed any faster than with a single instance.
    Another possible way, if the source system can create files with different file name extensions, would be to have them all written to the same folder and have each instance checking that particular folder but looking for files with different extensions. This might be problematic, though, because it might also end up with each instance watching the same "control" folder so that doing things like pausing Central would end up with no control of which instance was going to be paused.
    The default setting for Central has it pausing for 5 seconds if it completes a job and there are no more files waiting for it. If your jobs are not coming in faster than Central is processing them then you would be getting some of this delay for your jobs. You could reduce this time or even set Central to process a job as soon as it shows up. I don't know if version 5.6 still has the problem but an earlier version would not "see" a file if it happened to show up exactly when it was looking for more (it was probably showing up milli-seconds after Central looked). This caused that job to just sit there until the next job showed up.
    A major factor in getting the documents produced faster is going to be the speed and number of printers that they are going to - plus the number of pages in each document. For us, the single instance of Central that we are currently using can produce print much faster than our HP9050 printers (50 ppm) can actually print it.
    You must be doing a lot of forms or each job is doing a lot of processing. Our typical print job does 4 tasks (depending on the job this can include things like: passing the file through the transformation agent, updating a mainframe database, FTPing the file to another server for archiving, and producing the print). A typical job with 11 output pages takes only 2-3 seconds. We have a task that runs every morning that retrieves mainframe generated jobs. I just checked one of our servers and it processed 208 jobs in exactly 8 minutes (26 jobs per minute at an average of 2.3 seconds per job). We also thought we'd need multiple instances due to speed but that just isn't the case for us. We have other reasons to move to multiple instances but speed in not a major factor any more.

  • Basic Phones but I still have to pay for data?

    I want to change my plan over from the 700 min plan to the Family share plan with unlimited talk and text...the only problem is that we have 4 basic phones.  I can pay the $30 per phone per month no problem...but then I'm forced to select the base 300mb of data plan (for $40/month) as well.  What is this paying for?  I'd be throwing away $40 a month for data that I can't use since we have basic phones.  There should be another option.  Has anyone else encountered this, and had it resolved?

    chasejr wrote:
    I want to change my plan over from the 700 min plan to the Family share plan with unlimited talk and text...the only problem is that we have 4 basic phones.  I can pay the $30 per phone per month no problem...but then I'm forced to select the base 300mb of data plan (for $40/month) as well.  What is this paying for?  I'd be throwing away $40 a month for data that I can't use since we have basic phones.  There should be another option.  Has anyone else encountered this, and had it resolved?
    Actually basic phones CAN use data. Also you're not paying $40 for the data. You paying $40 for unlimited minutes and texting AND data. And since the unlimited minutes and texting have a $40 value the 300 MB is basically FREE.
    If you need more minutes then you can get the 1400 minute plan for $20 more than what you're paying for now as was said. or 2000 minutes for $40 more.
    So let's break this down
    1400 minutes,  4 lines, unlimited texting = $140
    2000 minutes, 4 lines unlimited texting =$160
    Share Everything 4 lines, unlimited minutes and texting 300 MB data=$160.
    If you're going to need more than 1400 minutes Share Everything is better.

  • Is Verizon attempting to get customers to abandon basic phone services for data plans?

    I was just in the Verizon store to pay my bill and while there I wanted to verify my upgrade eligibility date.  My husband and I have a shared plan with him having a basic phone and I have a smart phone with a data plan.  Due to a need to upgrade phones last year I used his upgrade eligibility date to go from a basic phone to a mart phone.  At that time I was told that when the time that I was eligible to update my phone he would be able to use that date, which he did.  The next time we are eligible to update will be in Feb. but since we had switched the dates last year, I was told that if I wanted to update this year at his time, we would be charged an additional $30 per month for a data plan even though we would still have 1 basic phone and only 1 smart phone.  In essence we will be paying for 2 smart phones and have the benefit of only 1.  Does Verizon think that this is good customer service and that it will foster customer loyalty?

    It is true that if you switch lines and upgrade with a smartphone, but then add a basic phone back on that line you will be charged $30 per month for data since you used that line to upgrade to a smartphone, and the data costs are part of the payback for the higher price of the smartphone.
    However, that is not what you are doing, and I have not heard that if you use an upgrade to get a basic phone, you still have to pay $30 even if that is a transfer from an upgrade eligible line that has a smartphone.
    I honestly think you were given wrong information and they misunderstood the new policy. This is one situation I have not seen yet, so will await others to give input, including any Verizon representatives.

  • Select - next  logic for copy data

    Hi,
    I have 3 main values from an excel template: a specific data value (i.e. 35), in that same template one is TIME  and the other one is  $$$.
    What I have to do is copy  the $$$ amount starting from the date set in the template (TIME) through X number of months (i.e.35).
    All this is going to be obtained from a template, I cant use prompt.
    Lets say:
    X: 35
    $$. 100
    TIME: 2011.July
    To do:
    Repeat 35 times the amount 100, starting from 2011.July to the next months.
    Therefore, 2011.August, 2011.September,etc,etc---> 2012.Jan....2013-Jan  and so on until the 35 months are reached.
    I am trying to make some logic using the Select command, however I dont quite understand how to perform this. Equally using the logic NEXT i think it will be helpful.
    Any suggestions...? I cant share my logic because im still trying and mine does not work.
    Thanx in advance.
    Velázquez

    Hi Madis,
    Thanx for the response, i reaally appreciate it.
    I created the dim DURACION as user defined. Included for the moment 25 members (numbers) and it wasnt matched to any application.
    Now, the script where i am working is called Test.
    1. I typed in my script the following:
    **SELECT (%MYSET%,ID,Duracion,"[ID]<=MYDURACION")
    2.Entered to BPC Excel - eData - organize package list - select script Test  and added the following:
    'DEBUG(ON)
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
    PROMPT(SELECTINPUT,,,"Please select category, entity and time for restatement",%TIME_DIM%)
    PROMPT(Text,%INPUTDURACION%,"Enter No of duracion",,"")
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,FORMULASCRIPT,"FUNCTION MYDURACION=H%INPUTDURACION%")*
    TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%TestAlldoraVentas2.lgx)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    TASK(Execute formulas,CHECKLCK,%CHECKLCK%)
    Now... im having trouble because after validating & saving, it shows the error:
    - Invalid column name 'MYDURACION' in:select ID from mbrDURACION where <=MYDURACION
    Can you please help me...
    So far, I have the following logic for performing a "calc each period"  once  YEAR.MONTH  is introduced by a prompt.
    The xdim members are making reference to a particular situation, the important stuff here is that if I pass a hardcored # of periods to the XDIM - next logic it works, and im trying to apply your suggestion...
    *CALC_EACH_PERIOD
    *XDIM_MEMBERSET lob=servicios_out
    *XDIM_MEMBERSET consumibles=consumibles_dummy
    *XDIM_MEMBERSET vendedor=04
    *XDIM_MEMBERSET cliente=5
    *XDIM_MEMBERSET oi=400000
    *XDIM_MEMBERSET TIEMPO=%tiempo_set%,next
    *WHEN METRICA
    *IS importe
    *REC(metrica="importe",tiempo=next(1))
    *ENDWHEN
    **SELECT (%MYSET%,ID,Duracion,"[ID]<=MYDURACION")
    However, is there still a way to pass a # of periods by excel?... this is, not using a prompt but by reading the number form a specific CV ?
    Thanx again
    Velázquez

  • Programming logic, passing data from a page to another

    Hi,
    I just began with developing with APEX 4.1.1, and I think I don't get how I should use it efficiently, I am more used to C-like programming.
    I have a table which contains the state of some electricity meters taken at some non-regularly spaced dates. I want to make a chart of the electricity consumption, e.g for each month. This (I think) implies that the application must do that (I used this logic for the same application made with php and sqlite and it worked):
    - User chooses a meter
    - Application tells him the available range of dates and the mean interval between measurements
    - User chooses the range of dates and the interval
    - Application verifies that the range of dates is valid (not outside the real data)
    - Interpolate the state of the meters at the requested regular interval
    - Calculate the consumption for each interval (simply a difference)
    - Draw the chart
    For now, I created some procedures which should pass a custom data type containing all the meta-data about the chart and a PL/SQL table containing the actual data to be charted, but I'm stuck at the point of interacting with the user (meaning writing the output of the procedures on a page and passing them to the next procedure and also charting that pl/sql table).
    Maybe should I create a temporary table ? But of what I read, this is a "real" table stored on the disk, and I just need this data once (and it is a small dataset, at most 20 points or so) for drawing a chart. This table should also be specific to the chart currently being created, it could happen that the same user or different users make multiple charts at the same time (like in two firefox tabs).
    I hope my post is not too confused..
    Ben

    940065 wrote:
    Hi,
    I just began with developing with APEX 4.1.1, and I think I don't get how I should use it efficiently, I am more used to C-like programming.Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "940065".
    APEX is intended for the development of database centric applications. It's a physical implementation of Tom Kyte's philosophy of database application development&mdash;possibly replacing Java with JavaScript ;-) .
    To use it efficiently you need to stop thinking procedurally in C-like terms and think in terms of the set operations that SQL uses effectively.
    I have a table which contains the state of some electricity meters taken at some non-regularly spaced dates. I want to make a chart of the electricity consumption, e.g for each month. This (I think) implies that the application must do that (I used this logic for the same application made with php and sqlite and it worked):
    - User chooses a meter
    - Application tells him the available range of dates and the mean interval between measurements
    - User chooses the range of dates and the interval
    - Application verifies that the range of dates is valid (not outside the real data)
    - Interpolate the state of the meters at the requested regular interval
    - Calculate the consumption for each interval (simply a difference)
    - Draw the chart
    For now, I created some procedures which should pass a custom data type containing all the meta-data about the chart and a PL/SQL table containing the actual data to be charted,
    but I'm stuck at the point of interacting with the user (meaning writing the output of the procedures on a page and passing them to the next procedure and also charting that pl/sql table).It seems that you don't really get APEX yet: have you read the introductory documentation and taken the <i>Oracle® Database 2 Day + Application Express Developer's Guide</i> tutorial in order to understand basic APEX techniques and terminology?
    You should be aiming to collect and validate the required parameters in APEX session state values and use the built-in charting capability with SQL data sources that use these parameter values in query predicates.
    If you really can't generate the chart series from queries run on the original table, generate the chart data using an APEX collection rather than a "PL/SQL table" (preferred terminology is "collection type", but it's even better to specifically say "associative array", "nested table" or "varying array") or temporary database table.
    Maybe should I create a temporary table ? But of what I read, this is a "real" table stored on the disk, and I just need this data once (and it is a small dataset, at most 20 points or so) for drawing a chart. This table should also be specific to the chart currently being created, it could happen that the same user or different users make multiple charts at the same time (like in two firefox tabs).Temporary tables are rarely required in any Oracle application, but standard Oracle Global Temporary Tables are database-session specific and so have no concurrency issues. However there are issues when using them in APEX, so APEX collections are the preferred method for temporary, session-based storage.

Maybe you are looking for

  • Convert a number value to a date

    Post Author: Jeremiah CA Forum: Formula I'm using Crystal Reports XI. I'm coming across a problem trying to convert a number value to a date.  I'm using formula below: if not isnull({qryStoreCheckIn.CHECKINDATE})  or {qryStoreCheckIn.CHECKINDATE}="0"

  • How do i upgrade from Mac OS X V10.4.11 to 10.5?

    I think i might have missed a software update somewhere along the way....i need v10.5 to be able to download itunes v10.  I need the latest itunes version so as i can sync my (work) iphone 4 before they take it back (i'm leaving!) and I loose all my

  • Nokia 1020 - any way to get an internet connection...

    There doesn't seem to be any way to get networking via BT. As a possibly separate issue, I can connect to my Nokia 808 over BT and they pair up OK, but the 1020 doesn't see any network, dial-up or any other service like that in the 808. Every windows

  • Reduced font size in browser

    All of the sudden some of my text is showing up a point or two smaller in Safari and in FireFox. The font is Arial and all of the text was created in text boxes. Even on the same page some of the text will be the correct size and some will be a reduc

  • Booting up

    Hello, I am in need of serious help. When ever i boot up my mac g4 450mhz dual, a picture of the globe flashes on and off! HELP ME