Incrementing Date field in Variable based on a specific calendar

Hello All,
    I am currently setting up a schedule that includes Mass activities. I am running into a problem when i want a particular date field an activity to increment by one day based on a specific calendar i.e. Factory calendar (M-F open).
EX)
The due date field for on any given day the mass activity runs should be system date plus 2 business days.
While the posting date field on the same transaction should increment by 2 day.
Result would be:
On System date = 02/17/11
Due Date Field = 02/21/11
Posting Date = 02/19/11
I am currently using expression similiar to this: =Time.expression(Time.now('GMT'), 'add 2 days') but cannot find documentation how to include calendars in this as you would with =Time.isTimeWindowOpen(Time.now('GMT'), 'Factory Calendar').
Can someone please point me in right direction?
Thanks
Dan

Hi Gerben,
   I tried this and it yielded unacceptable(expected) results. Here is why i think this is the case.
=Time.expression(Time.nextTimeWindowOpening(Time.now('America/Regina'), 'System_Week_WorkDays'), 'add 7 days') suppose to only be open m-f
Time.now() should evaluate to today lets say 02/21/11
then Time.nextTimeWindowOpening should return the next open day, after but including today, it checks and finds today is open so = 02/21/11
and the time expression will add n= 7 days to that. 02/21/11 + 7 = 02/28/11 this is wrong.
According to this calendar it should be 03/01/11
Problem is that the add function is just adding n days indiscriminate of the calendar as the calendar is not part of the addition argument.
Edited by: Daniel Austin on Feb 21, 2011 9:31 PM

Similar Messages

  • Auto-Incrementing Date Field

    In my report I have information on parts that have been ordered.  I have the part number, date ordered, quantity ordered, date received, among others.  What I want to do is insert a custom field that gives me each day that had transpired beteen the Date Ordered and the Date Received.  I want one row for each intervening date, including the Date Ordered and the Date Received.  How can I do that?

    Hi,
    I am not sure if you can get a dates between ordered date and received date. However you can get it as a comma separated list as a field.
    Try following formula
    numberVar d:= DateDiff ("d",{ABC.DT_ORD},{ABC.DT_RECEIVED} );
    numberVar i;
    StringVar abc;
    StringVar inDate;
    for i:=1 to d do
    abc:=totext({ABC.DT_ORD} + d);
    inDate:=inDate & abc & ",";
    inDate;
    --Kuldeep

  • Get data in a subreport based on a shared variable from the main report.

    Goodd morning,
    My question/problem is how to manage this scenario.
    I am transfering 2 shared variables (pereiod from /period To, ) from the main report to a subreport and now  i would like to get data in this subreport based on these 2 variables...
    The problem is that i can not find the shared one in select expert icon...
    Could anyone point me to solve this issue?
    Thks for any help.
    Jose Marin
    Crystal Report XI SR3

    Hello Jos,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Workflow based on created date field in opportunity?

    Hi All,
    Can we write a workflow based on created date field in opportunity that if a opportunity record has not been modified after say 90 days,what will be the workflow syntax.
    I just want an email notification to owner and owner's manager.
    Thanks in advance,
    Manish.

    I think you can use the WAIT workflow using Duration('P90D') then Send Email, triggering it upon save and upon modification. Make sure that the Re-evaluate Rule Conditions After Wait option is checked so that the previous WAIT would be reset upon modification.
    Edited by: marcocollado on Aug 31, 2012 5:57 AM

  • Need Report based on "CUSTOM DATA field @ Shop Order Maintenance"

    Need the REPORT based on CUSTOM DATA field.
    Requirement - I am having the CUSTOM data at Shop Order Maintenance that is called as XXX, I need some report in SAP ME which can display the SFC related to particular Shop order based on XXX Number.

    Hi!
    As far as I remember there is no such base report. So, you may try to create it using SDK or request it as custom enhancement from SAP.
    If you want to create it using SDK, you can find the required data for report in CUSTOM_FIELDS table.
    Regards,
    Alex.

  • XML Forms Builder: Sorting news based on a date field in a XML form

    Hi Experts
    I have a requirement and I am stuck up in finding a solution. I have a XML form and this has been mapped to a folder in KM. It publishes news. In the collection renderer settings there is an option to sort the news ascending or descending based on created/modified criteria.
    The requirement is to sort the news based on a date field in XML form. Can you experts help me in getting the solution for same?
    The users who post the news in our portal needs the information to be sorted based on a date field shown.
    Thank you
    Best regards
    Ramamoorthy D

    Hi Experts
    I have not got any solution for this issue. Can any of you get me some clue to work on this issue with sorting news based on a date field in a XML form?
    I removed the property link from the screen field Input field.
    Thank you
    Best Regards
    Ramamoorthy D

  • Assign date field to ddmmyy variables

    Hi Guys,
    I have some code which takes the current date and splits it into dd, mm and yy variables.
    var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth()+1;
    var yyyy = today.getFullYear();
    if(dd<10){dd='0'+dd}
    if(mm<10){mm='0'+mm}
    this.rawValue = "Text, " + dd+ "-" + mm + "-" + yyyy;
    I need to pass this a date from a date field instead of taking to days date but I cannot get it working.
    var today = this.parent..DateTimeField2.rawValue;
    var dd = today.getDate();
    var mm = today.getMonth()+1;
    var yyyy = today.getFullYear();
    if(dd<10){dd='0'+dd}
    if(mm<10){mm='0'+mm}
    this.rawValue = "TEXT, " + dd+ "-" + mm + "-" + yyyy;
    Any help would be appreciated.
    Thanks!

    Hi,
    you can use FormCalc and date patterns to do this easily.
    Here an example for the calculate event of DateField2.
    It grabs the formatted value of DateField1 (which is DD.MM.YYYY) and formats it to TEXT DD-MM-YYYY.
    $ = Num2Date(Date2Num(DateField1.formattedValue, "DD.MM.YYYY"), "'TEXT ' DD-MM-YYYY")

  • Count records based on detail row containing a null date field

    i need to count the no of rows where a date field is null and print the result in each group footer. the formula isnull works well in details section  but not when I create a running total to count records where evaluate condition is based on a formula and when i test isnull(field) ?
    works in detail section:
    Global NumberVar numOpen;
    if (IsNull({db.DateField}))
    then numOpen := numOpen + 1;
    does not work in group footer?
    IsNull({db.DateField})

    Abhilash Kumar wrote:
    Well, what database are you reporting off and how did you insert a NULL value to the date column?
    In my case, I have worked with Oracle, Access, and now SQL.,
    and have used several different versions of Crysal (but never XI)
    I/we don't put anything into the date...  the field is simply empty and I use 
    IsNull({datefield})
    also for numbers (&currency)
    IsNull({numberfield})
    For text fields I now use
    IsNull({textfield}) or {textfield} not equal ""
    as SQL is a little funny about the empty text fields. Sometimes one works and sometimes the other so I use both.
    Debi

  • Populate a variable based on input (Customer Request Ship date)

    Hi Gurus,
    I have a requirement to code on a custom variables.
    Created two Customer Exit Variables:  "ZCRD" AND "ZFYPRD."
    Variable one - "ZCRD" - customer requested ship date.  ( input) variable.
    Populate a variable - "ZFYPRD" based on users input - "ZCRD."
    Please provide me if function module exist / how to code a new FM and code to populate the value on variable ZYPRD.
    For Instance:
    if user's input is "ZCRD = 05/30/08".
    Populate the value in the variable (custom) "zfyprd" = 005/2008.
    How would I code in ABAP If this is the condition.
    Please help.
    Thanks in advance.
    BW

    Hi Ramesh,
    Thank you for the response.  Your input is valuable.  For this requirement its a BPS Planning Layout.
    Do I need a function module to work this code?  The (key date) customer requested ship date (variable) is an input from users through planning area.  If function module requires please give me the code for the function module.
    Users enter = customer requested ship date.
    Variable for this fiscal yr/period should populate/ convert it to the period.
    I used the function module convert it to period.  But which function module is to use to connect it to the variable for customer requested ship date in bps?
    I created a variable (customer exit) for period in the query.  I referred the code given in the document to convert it to period from key date.  But while testing the variable customer requested ship date is coming as initial.  what is it that I am missing here?  Please help
    Thanks in advance,

  • How to show a text field based on what is entered in a date field

    Hi there LiveCycle experts!
    I have a form with a text field that I want to show only if the value of the previous date field once entered is less than 1 month from today?
    Any help appreciated, been researching in vain for hours!!!
    Sarah

    Wow Steve - thanks so much this is so exciting I just love learning these new scripts.
    I assume I need to make the text field 'Hidden' - ?
    I seem to be struggling a little to get it working - are you able to have a quick squizz at my document - it is in the very early stages!
    Regards,
    Sarah Milne
    FACEBOOK : Join our  'BritBound Social Events' Group on Facebook to receive details of forthcoming social events...click here to join. 
    For a sociable & stress free arrival experience!
    BritBound London Office: Britain & London Visitor Centre, 1 Regent Street, London, SW1Y 4XT.
    Tel UK: | 0845 450 3536 | From OS + 44 (0) 20 7808 3815
    Tel OZ: | Sydney: (02) 8003 7651  | Melbourne: (03) 9005 8304 | Brisbane: (07) 3102 9766
    Tel NZ: | Auckland: (09) 889 3175 | Wellington: (04) 889 2015   | Christchurch: (03) 669 2032
    Website:        www.britbound.co.uk
    E-mail:           [email protected]
    Click Here to find out more about: | UK VISAS  | MOBILE PHONE CONTRACTS FOR NEW ARRIVALS TO THE UK  |  UK ACCOMMODATION  |  AIRPORT TRANSFERS  |  UMBRELLA COMPANIES   |  DISCOUNTED INTERNATIONAL BANK TRANSFERS  |  SOCIAL EVENTS   |  TAX REFUNDS  |  NATIONAL INSURANCE (NI) NUMBERS
    Disclaimer: The information contained in or attached to this message is intended only for the people it is addressed to. If you are not the intended recipient, any use, disclosure or copying of this information is unauthorised and prohibited. This information may be confidential or subject to legal privilege. BritBound cannot accept liability for any virus damage caused by this message. This documentation is for your general information, and is not to be construed as advice. Clients should not act on the information contained herein alone, and should seek independent advice if necessary.

  • Variable Date Field

    Problem Background
    I've created a form for mulitple users to fill out on a regular basis.
    Some of the date fields are set to automatically tabulate the current date, while others are set to present the user with a dropdown menu.
    The automatic date feature saves a lot of time for the vast majority of circumstances, but I've had several requests for the field to offer the additional option of displaying "TBD" or "See below for explanation".
    Question
    Is it possible to concurrently offer automatic date formatting and a custom field option in the same field?
    Thank you for your thoughts!

    Hi Gerben,
       I tried this and it yielded unacceptable(expected) results. Here is why i think this is the case.
    =Time.expression(Time.nextTimeWindowOpening(Time.now('America/Regina'), 'System_Week_WorkDays'), 'add 7 days') suppose to only be open m-f
    Time.now() should evaluate to today lets say 02/21/11
    then Time.nextTimeWindowOpening should return the next open day, after but including today, it checks and finds today is open so = 02/21/11
    and the time expression will add n= 7 days to that. 02/21/11 + 7 = 02/28/11 this is wrong.
    According to this calendar it should be 03/01/11
    Problem is that the add function is just adding n days indiscriminate of the calendar as the calendar is not part of the addition argument.
    Edited by: Daniel Austin on Feb 21, 2011 9:31 PM

  • How to make Date fields Editable or Non-Editable based on Call Staus

    Hi,
    We are using CRM2007 Web GUI for Service call creation. We are using date profile to populate the dates. Here my requirement is if call status is 'Call created' then some set of date fields to be appeared in display mode(Non Editable) and some set of date fields to be appeared in change mode(Editable). How to achieve this. Kindly suggest me.
    Regards,
    Steve

    Hello,
    Kindly check the following thread which is giving many solutions for your requirement:
    Re: how to make field non-editable (display mode)
    Kind regards,
    Nicolas Busson.

  • How to extract incremental data from SQL server to oracle tables in ODI

    HI All,
    In my ODI sql server is install.My Source is in SQL server and my target is in Oracle.
    I need to create a interface mapping where i need to extract incremental data from sql server to oracle.
    There is a datetime(with Timestamp) field in sql server .I need to pull incremental data based on dateime.
    Example = tablename.DateTime > (select '1-jan-11' from dual) .....i am using this query but its not woking.the error is Invalid object name"dual".
    We are not going to use Incremental in IKM and LKM.
    Request you to please provide any suggestion ASAP.
    Thanks,
    Lony

    You can do that via Variable.
    In the interface mapping create a filter on Tablename.DateTime
    and put the condition like this
    Tablename.DateTime BETWEEN #VAR and in the variable use this query in refreshing tab with oracle schema
    SELECT max(start_time)||' AND '||max(END_TIME)+1 from audit_table where ETL_JOB_CODE = '20'In the package call the above variable in refresh mode and then interface.
    This way you will pass from the query between and condition date and pass to interface so that SQL Server fetches the data between those too range.
    Note:- You might need to tweak the date format so that SQL Server can understand.
    Hope this helps.

  • Add number of business days to date field

    Hello, I noticed that there is not much discussion in the forum surrounding u201Cbusiness daysu201D so I hope this post/discussion/solution contributes to the content of this forum.
    I am using the following 3 formulas to try to Add number of business days (based upon a table field) to a specified date:
    1. Variable name = SetVar
    //Set Variable for Add Business Days:
    DateVar Array Holidays;
    DateVar Target:= CDate({TMS_MOVEMENT_EVT.EVT_DATE}); // Put your field name in here
    NumberVar Add:=  {DTCI_DOD_TRANS.TRANS}; // put the number of days here to add (a positive number)
    NumberVar Added := (0);
    2. Variable name = AddBizDays
    //Adding Business Days:
    EvaluateAfter({@SetVar});
    WHILE Added < Add
    Do (target := target +1;
        if dayofweek (target) in 2 to 6 and not (target in holidays)
            then Added:=Added+1
            else Added:=Added);
    Target
    3. Variable name = HOLIDAYS
    //Holiday Array Formula for the report Header:
    BeforeReadingRecords;
    DateVar Array Holidays := [
    Date (2003,12,25),   // you can put in as many lines for holidays as you want. 
    Date (2003,12,31)
    0
    I am successfully getting my data needed to make the necessary calculations and variable assignmentsu2026 I believe that my ISSUE is that I am not sure where to place these formulas into my report so they assign the variables and execute properly when previewing my report. I am curious if that is my issue, and if so, can someone provide me direction on where to put each of these formulas in my report.
    Currently, when I try to preview the report, I get the following Crystal Reports Error:  -u201CA number, currency amount, Boolean, date, time, date-time, or string is expected here.u201D
    Then Crystal automatically opens the AddBizDays formula and highlights the word added, see below RE: u201CWHILE Addedu201D
    For reference, my report has 3 groups, and I am displaying all of my output information (and locating my formulas) in the group footer #3 report section. I have moved them around to other report sections/groups/placements, but to no success.
    Thanks so much.
    Best, Matt

    I worked this out... FYI - for the benefit of all forum users:
    ADDING BUSINESS DAYS TO A CERTAIN DATE (excluding weekends and holidays)
    1. Variable name = AddBizDays
    //Adding Business Days:
    WhileReadingRecords;
    DateVar Array Holidays;
    DateVar Target:= CDate(); // Put your field name in here
    NumberVar Add:=  ; // put the number of days here to add (a positive number)
    NumberVar Added := (0);
    WHILE Added < Add
    Do (target := target +1;
        if dayofweek (target) in 2 to 6 and not (target in holidays)
            then Added:=Added+1
            else Added:=Added);
    Target
    2. Variable name = HOLIDAYS
    //Holiday Array Formula for the report Header:
    BeforeReadingRecords;
    DateVar Array Holidays := [
    Date (2003,12,25), // you can put in as many lines for holidays as you want.
    Date (2003,12,31)
    0
    ...too bad i don't get forum points for sharing this solution.
    Special thanks to KenHamady.com -- for sharing this solution.
    Sincerely,
    Matt

  • Creating process for multiple Date fields for update or insert in APEX

    hello there,
    could someone please help me?
    i have a form on Apex based on view that is based on three tables and updating and inserting ok using trigger instead of.
    i have a problem now as in my form i have around 75 fileds (items) incuding 30 or more date fields which could be populated or left blank or update later.
    so for each date field i have two boxs; one for date, input as dd/mm/yyyy (text field) and second for time, input as 23:45. All dates will be insert or update manually by user. so as i mentioned not all date fields could be poulated at one stage.
    so i have created some process and validations and all of them work fine but i came accross if date left blank then (:) giving me problem so i have done following further process for each date field. In real table all the date fields have data type date.
    declare
    v_my_var date; -- for first date field
    str_dy VARCHAR2(10);
    dt_indx date;
    str_tm VARCHAR2(20);
    tm_indx date;
    begin
    str_dy := :p4_first_date
    str_tm := str_dy||' '||substr(:p8_first_date_hh,1,2)||':'||substr(:p8_first_date_HH,4,2);
    dt_indx := to_date(str_tm,'DD/MM/YYYY HH24:MI');
    IF str_dy is not null then
    v_my_var :=dt_indx;
    ELSE
    v_my_var := NULL;
    END IF;
    update table 1 set my_date = v_my_var where d_id= :p4_d_id;
    end;
    above code work fine but one date field of course therefore i have to do same code for each date field with changes and initialise variable again and again for each field.
    so i like to ask is there any easy way that is more professional. i was thinking about the procedure and using collection or similar but honestly not much experience on that so could some one please help me?
    I will be very thankful.
    KRgds

    Hi,
    You can do the needful by re-using the code if you can give the item names as P8_DATE1, P8_DATE_hh1, P8_DATE2, P8_DATEhh2 etc..So your item name just differs by a sequence.
    Now you write function which will return desired date value taking above items as input. Pass item names to this function, get session state using APEX_UTIL.GET_SESSION_STATE('item_name') API.
    Now modify you code as
    FOR i IN 1..30
    LOOP
    v_date_array[i] = f_get_date('P8_DATE'||i, 'P8_DATEhh'||i);
    END LOOP;
    ....Now you have all date valus in array. Just write one update as follows
    UPDATE  TABLE1
    SET date1 = my_date_array[1], date2 = my_date_array[2]..
    WHERE ....Hope it helps :)
    Cheers,
    Hari

Maybe you are looking for