Need to subtract one day from the date appearing

Hi, I am modifying a script in such a way that for an output type there is an invoice date appearing.  This invoice date should be back dated to 1 date less to the actually date that is appearing currently.
For ex the date is 2007.08.30 it should appear as 2007.08.29.
While debugging I found that it is picking up the data for the date from the structure vbdkr and the field is fkdat. From the following code in the script.
/:   DEFINE &SALES_ORDER& := &VBDKR-VBELN_VAUF&
/:   INVOICE DATE,, : &VBDKR-FKDAT&
What changes do I need to make the changes in the script or in the driver program?
Can you please suggest?
Thanks.

Hi..
You can get this Functionality by Calling a FORM (subroutine) from the Script Layout itself  There is no need to change the Print program.
Eg:
In the layout set -> window -> text elements. Write this before displaying invoice date
/: PERFORM F_DATE_SUB IN PROGRAM ZPRG01
/: CHANGING &VBDKR-FKDAT&
/: ENDPERFORM
INVOICE DATE,, : &VBDKR-FKDAT&
Create the report program ZPRG01: In the program ZPRG01
FORM F_DATE_SUB TABLES INTAB STRUCTURE ITCSY
                                              OUTTAB STRUCTURE ITCSY.
DATA: L_DATE TYPE D.
READ TABLE OUTTAB INDEX 1.
L_DATE = OUTTAB-VALUE. "you need to convert here
SUBTRACT  1 FROM L_DATE.
OUTTAB-VALUE = L_DATE.
MODIFY OUTTAB INDEX 1.
ENDFORM.
reward if Helpful.

Similar Messages

  • How to subtract a day from the presentation variable @{system.currentTime}

    Hello,
    How can subtract a day from the presentation variable - @{system.currentTime}
    I use the above as a title in the report. However I want to subtract a day from the above variable. How can I accomplish it?
    Thanks.

    Hi,
    Did you try the steps which I mentioned above. You can use TIMESTAMPADD function in many places in your report but I think not in title section of the title view.
    Also you can try using Narrative view instead of title view to achieve this. Follow below steos:
    * Pull another column in the report and change its fx to TIMESTAMPADD(SQL_TSI_DAY, -1, @{system.currentTime})
    * Now go to the Narrative view and add the below text in Narrative section of the view.
    Active Person Report as of @1
    Here @1 assuming the new column created is placed before all the columns in the request.
    * Also set the 'Rows to Display' as 1.
    * Delete Title view from the report and this narrative view on top of your report.
    Hope this helps.
    Thanks

  • Reg : subtracting weekoff day from the time difference

    Hi ,
    I have query where I am getting time difference first of all in terms of hours as:
    DECLARE @L_TIME_DIFF   INT
    SET @L_TIME_DIFF= (DATEDIFF(hh, '05/09/2014', '05/12/2014'))
    i.e. subtracting 12th may - 9th may and getting diff in hours ..in this case it will be 3*24 = 72 hours
    All fine till here. Now next step I need to subtract from this 72 hours if falling any week off day. It can be Friday, it can be Saturday, or Sunday, or Half day Saturday, or Half Day Sunday, or Full 2 days Saturday/Sunday  .
    The above scenario is decided based on one table [CALENDER_WORKINGDAYS] which looks like below :
    CAL_WORKING_DAY 
    CAL_AM
    CAL_PM
    CAL_SEQ_NO
    Monday
    1
    1
    1
    Tuesday
    1
    1
    2
    Wednesday
    1
    1
    3
    Thursday
    1
    1
    4
    Friday
    0
    0
    5
    Saturday
    1
    1
    6
    Sunday
    1
    1
    7
    So in this case, if you look at friday (CAL_AM=0 and CAL_PM=0) this measn friday full day holiday for some country.
    Hence I need to : 72 - 24 = 48 Hours should be my output.
    In another scenario, let s say some country work half day Saturday and Sunday full day off.
    So my output should be : 72 - 36 (because 24 hours for sunday off, and 12 hours for saturday half day off) =
    36 should be my output
    and so on..
    Can you help to build such query based on the above table given ?
    Thanks

    Hi Jose Diz,
    I am trying the below logic. Seems it should be working:
    DECLARE
    @L_START_TIME    DATETIME,          
    @L_END_TIME    DATETIME,
    @L_TIME_DIFF   INT, -- Time Difference considering week offs          
    @W_TIME_DIFF   INT ,-- Whole Time Difference,
    @PUBLICHOLS   INT,
    @WEEK_OFF INT
    set @L_START_TIME    = '5/9/2014';
    set @L_END_TIME    = '5/12/2014';
    /* TO GET THE TIMDIFFERENCE */          
      SET @L_TIME_DIFF=(DATEDIFF(hh,@L_START_TIME,@L_END_TIME))          
      SET @W_TIME_DIFF = @L_TIME_DIFF          
    -- Subtracting day off in the week(i.e. sat/sun or in some case friday) if it is in between start and end
      set @WEEK_OFF= 0;
        SELECT @WEEK_OFF= @WEEK_OFF + 12 * (abs(CAL_AM -1) + abs(CAL_PM -1))
        from CALENDER_WORKINGDAYS
     IF DATENAME(WK,@L_END_TIME) > DATENAME(WK,@L_START_TIME)           
     BEGIN          
      SET @L_TIME_DIFF= @L_TIME_DIFF - @WEEK_OFF          
     END          
    Thanks to confirm

  • Reg: Excluding one day from the daily schedule process chain

    Hi All,
    I have a process chain scheduled daily except Sunday i.e. from Monday to Saturday. Now i want to exclude Saturday from the daily scheduling.
    Any idea how we can do that. Early response will be highly appreciated.
    Best regards

    Hi,
    Restrict chain Scheduling on Sundays/Holidays
    Create a factory calender using TCode SCAL or ask your basis team to create one.
    In this calender mark all days except the day you dont want the chain to run as workday.
    Now while scheduling the process chain make use of this calender and restrict it to run only on the workdays.
    There is a setting in the start process of the PC by which your chain wont run in sundays/holidays based on calendar or run only on workdays as defined in the factory calendar.
    Go to PC > start process > change selection  > Date/time. Here enter the date from which the chain should be scheduled and then click the Restrictions button at the bottom. There u can check the option "Dont execute job on sundays or holidays.
    Hope this helps.
    Thanks,
    JituK

  • Getting Day from the date :

    Hi,
    I want to get the day(Monday ,tuesday.. like that) and the input parameter for that function is the date let say 02/14/2006.

    > Can you explain it more elobarately.Because the
    content i got from that link some what puzzling to me.
    I posted the link to that class at 13:26, you again posted a reply at 13:40. If my calculator is correct, you've spent about 14 minutes looking at that class and the examples from that page. I also wouldn't understand it in that time.
    Try the examples on the page, alter them, see what happens. Come back here with a specific question.
    Good luck.

  • Over thirty emails in one day from the itunes store.

    I've happily received one or two emails a week from the itunes store for years.
    But today I've received nearly thirty and they are still coming. They are mostly all different but there have been a few duplicates. This is just spam. I've repeatedly asked to be unsubscribed as I'd rather not get any than this constant stream.
    Is anyone else getting spammed to death by the store today? I'm in the UK but a few seem to be coming from the US store as well though I don't know why as we can't buy anything from the US store in the UK.

    Go to the myInfo page at - https://myinfo.apple.com/cgi-bin/WebObjects/MyInfo.woa - and login then go to the 'subscriptions' and 'contact' tabs and turn off the correct check box.
    You can also give feedback to the iTS from the main iTunes drop-down menu. Sounds like a bug.
    MJ

  • Subtract business days from date - calculated column

    Hello,
    I had a calculated column on a library that took two dates and found the difference between them in business days, but I am not sure how to subtract business days from a date...for instance I get a start date from a form and I need to
    subtract 10 business days from that date.
    Can anyone help?

    I've always resorted to Javascript/JQuery for that kind of function. I found an old fashioned loop worked the best for me - it supports going forward or backwards. I key it off of a change in a starting date, or sometimes a status change. My actual production
    code takes into account another list where we remove holidays and non-work days.
    newDate = getNextDate(newDate, -3);
    $("input[title='Date Due']").val((newDate.getMonth() + 1) + "/" + newDate.getDate() + "/" + newDate.getFullYear());
    function getNextDate(currentDate, offset) {
    // offset is business days
    var wkend = 0;
    var index = Math.abs(offset); // need positive number for looping
    var neg = true;
    if(offset >= 0) { neg = false; }
    var curDOW = currentDate.getDay();
    var nextDate = new Date(currentDate);
    for(var i=1; i <= index; i++) {
    nextDate.setDate(nextDate.getDate() + (neg ? -1: 1));
    var nextDOW = nextDate.getDay();
    if(nextDOW == 0) {nextDate.setDate(nextDate.getDate() + (neg ? -2: 1));} // Sunday
    if(nextDOW == 6) {nextDate.setDate(nextDate.getDate() + (neg ? -1: 2)); } // Sat
    // alert("offset is " + offset + "start: " + currentDate + ", next date is " + nextDate);
    return nextDate;
    Robin

  • Substract one day form end date

       
    Hi All,
    I have requirement where I need subtract one day from end_date if the start date of next row is the same and leaving the last row_id as it is and only if the customer id is the same.
    Any suggestions
    Current Values:
    customer_id row_id start_date  end_date 
    100         1      2014-04-01    2014-05-01
    100         2      2014-05-01    2014-06-01
    100         3      2014-06-01    2014-07-01     
    Desired values:
    customer_id row_id start_date  end_date 
    100         1      2014-04-01    2014-04-30
    100         2      2014-05-01    2014-06-30
    100         3      2014-06-01    2014-07-01     
    -kccrga http://dbatrend.blogspot.com.au/

    Hi,
    Not sure if the row_id is hard coded or a function, so went with a function. Try this code, it should give you what you need.
    DECLARE @Test TABLE(customer_id INT,start_date DATETIME,end_date DATETIME)
    INSERT INTO @Test
    SELECT 100,'2014-04-01','2014-05-01' UNION
    SELECT 100,'2014-05-01','2014-06-01' UNION
    SELECT 100,'2014-06-01','2014-07-01' UNION
    SELECT 200,'2014-04-01','2014-05-01' UNION
    SELECT 200,'2014-05-01','2014-06-01' UNION
    SELECT 200,'2014-06-01','2014-07-01'
    SELECT customer_id,
    start_date,
    ROW_NUMBER() OVER (ORDER BY customer_id,start_date) RowNo,
    ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY start_date) rowByCust,
    end_date,
    ISNULL((SELECT TOP 1 DATEADD(DAY,-1,start_date) FROM @Test NextDate WHERE NextDate.customer_id=TestData.customer_id AND NextDate.start_date>TestData.start_date ORDER BY start_date ASC)),end_date) new_end_date
    FROM @Test TestData
    customer_id
          start_date
    RowNo
    rowByCust
    end_date
    new_end_date
    100
    2014-04-01
    1
    1
    2014-05-01
    2014-04-30
    100
    2014-05-01
    2
    2
    2014-06-01
    2014-05-31
    100
    2014-06-01
    3
    3
    2014-07-01
    2014-07-01
    200
    2014-04-01
    4
    1
    2014-05-01
    2014-04-30
    200
    2014-05-01
    5
    2
    2014-06-01
    2014-05-31
    200
    2014-06-01
    6
    3
    2014-07-01
    2014-07-01
    Gavin Clayton Claytabase Ltd www.claytabase.co.uk

  • How to calculate number of days from a date field

    Dear BW Experts.
    I have a field 'Create Date' in the BEx query. Now we need to create a variable which should give the number of days from the date of running the query (sy-datum) to the Create Date.
    This will help the users to get records which are say, 30 days old (Sy-datum - create date = 30) or 10 days old etc.
    Could you suggest as to how to create this variable.
    Thanks,
    Sai

    Hi,
    Step 1: Create variable on "Create Date" with User entry processing type
    Step 2: Create a restricted KF for Sales & restrict it on "Create Date" to get "Sales on day"
    Step 3: Manipulate  the values of "Create Date" on which you could restrict  "Sales" again and again to get other values
    Step 4: Create one variable (ZPUTMNTH) for u201CMonth to Dateu201D with processing by u201CCustomer Exitu201D. This variable was created  on u201CDateu201D characteristics.
    Step 5 : Goto C-mod t-code and use EXIT_SAPLRRS0_001
    to calculate "month to date" user input is "Calday" Key Date
    WHEN 'ZPUTMNTH'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZPDATE'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(6). "low value, e.g.YYYYMM (200606) part of key date (20060625)
    L_S_RANGE-LOW+6(2) = '01'. u201C low value e..g. YYYYMM01 (20060601)
    L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    Assign if helps.....
    Regards,
    Suman

  • Trying to subtract one image from another

    I am a graduate student in a biology laboratory and I have been given the task to remove autofluorescence from our fluorescent microscopy images and I have found a way to do it, but I would like to improve it.  Unfortunately, I know very little about photoshop (mostly learned by playing around with things).
    What I need to do is take two pictures which show the same section of tissue but with different wavelengths of light (one picure in green, one in red) and subtract one image from the other.  So far I have converted the two images to greyscale then did "Apply Image" to subtract image 2 from image 1.  Then I convert Image 1 back to RGB and adjust the channels so I only have one color showing (green).  It has been effective but I would like to adjust things a bit.
    First, is there an easy way that I can adjust the brightness/contrast/levels of the image 2 to match the images levels to image 1--both images have certain parts of the image that are conserved.  Can I get photoshop to look at a specific area on image 1 and allow me to adjust that same area in image 2 to the same brightness/intesity?
    Second, I tried to make an action for this process, so I can give it to the other people in the lab so they can quickly do the same technique.  When I get to the Apply Image step it asks for the name of the image that I am working with which should change each time I do this technique.  Is there another approach other than using the Apply Image feature which will allow me to subtract image 2 from image 1 that would work in an action.
    If you need anymore clarification or an example of the pictures let me know.

    Put both images on individulal layers, and set the blending mode of the topmost one to "Difference". Adjust layer transprency as desired.
    If you add an adjustment layer, you can link it as a clipping mask to one layer. You can then paint on the associated layer mask to make it only affect certain areas.

  • Pricing conditions for the articles are getting triggered one day before the actual activation date to 3rd party systems through job WPMU.

    Hi SAP Guru´s,
    Currently we are sending the pricing, promotions & article master data delta load to 3rd party system from SAP ECC via SAP XI through IDOCS using daily scheduled batch jobs WPMU. IDOC segment - WP_PLU.
    Here the issue is the promotion & pricing data are sent to 3rd party system one day before the actual start date.
    Eg: Promotion 123456 which has start date as 15/05/2014 & ending on 30/05/2014 & was created & activated on 13/05/2014.
    This promotion 123456 is getting triggered from SAP ECC through batch job on 14/05/2014 morning & 3rd party system receives the data on 14/05/2014 & the promotion are getting activated at 3rd party system end on 14/05/2014 itself which actually gets active from 15/05/2014.
    Same in the case for Standard Pricing data which needs to be active from 31/05/2014 once the promotion 123456 ends on 30/05/2014.
    The standard pricing data gets triggered from SAP ECC on 30/05/2014 through batch job & reaching 3rd party system on 30/05/2014 & getting activate on 30/05/2014 itself.
    This creates more issues at the store end as well as affecting business.
    We checked at 3rd party system end & they replied that their system considers the updated time stamp & date to activate the prices & it does not considers the actual active from & active to date. They need the data to be sent from SAP ECC on the effective date of the pricing & promotions.
    Can any one help me how to change the pricing conditions beign triggered through batch job in SAP ECC based on the actual promotion & pricing conditons start date or is there any other process to trigger the data through the batch job on the actual promotion & pricing data activation date.
    Thanks in Advance.
    Thanks & Regards,
    P.P.Shankar

    Hello Shankar,
    Change the lead time in the POS Outbound Profile. You can't put less than 2 days there so data for today and tomorrow will be transferred which also means you need to adjust your batch timing accordingly.
    Sales and Distribution -> POS Interface -> Outbound -> Maintain Profile for POS Outbound.
    See if it helps. The best option would still be that the 3rd part system considers the activtion date.
    Kind Regards
    Kaizad

  • I need to be able to export the data from health kit and read it in something.  Anything.

    I've tried pretty much everything from Excel to downloaded and online apps.  I'm done downloading crap to my brand new computer.  My problem is that I need to be able to export the data into a readable format so that I can give it to my dr(s).  Is there ANY WAY that this is possible?  I'm kind of at my wits end here.  All help/suggestions are appreciated.
    What I've done:
    1.  Exported data.  It creates an xml file that can be opened in excel but gives raw data that no one but egghead developers can read (and I use that term in the best possible way.)
    2. Tried to download an excel add on.  Didn't work.
    3.  Tried several online applications.  Same result as Excel.
    Somehow this data has to be able to be read by someone other than myself, on my phone.
    Thanks to one and all for the many, many suggestions that I'm about to get.

    sam.loomis1234
    The only way out of Premiere Elements 11 is via export in video format (except for jpegs or audio under Publish+Share/Computer/Image or audio).
    The video is whole, not in a project file (project.prel).
    And, the Premiere Elements 11 project.prel does not appear to be an After Effects supported project format
    http://helpx.adobe.com/after-effects/kb/supported-file-formats-effects-cs4.html#main_head1
    Have you asked this question in the Adobe After Effects Forum regarding supported formats?
    http://forums.adobe.com/community/aftereffects_general_discussion
    ATR

  • Add one day to the current date

    Hi all,
    A stupid question...
    How can I add one day to the current date in a select. I want something similar to add one month to current date, but with days:
    something like:
    select TO_CHAR (ADD_MONTHS (SYSDATE, -1), 'DD-MM-YYYY')
    from dual
    Thanks

    select sysdate+1 "add one day" from dual;

  • How to set SPD workflow to send email one day before the Due Date? ?

    I need to add a step in workflow for a item tracking list: send reminder email one day before the due date.
    I thought there is an Action in SPD: wait for [Due Date] to equal [Today]minus one day
    But there is no way to do that.
    I figured may be I need to create a calculated field [cal-date] that set to: =[today] plus one day.
    Then in workflow -
    wait till [Due Date] is equal to [cal-date], and send an email
    What is the formula for the above calculated field [Today] plus one day?

    Hi,
    You can add an approval action( such as Start Approval Process) -> click "Approval" -> go to “Change the behavior of a single task” . Then you will
    see the "When Task expires" stage.
    You can have a look at the blog:
    https://www.nothingbutsharepoint.com/sites/eusp/Pages/5-Steps-to-Enhance-SharePoint-2010-Approval-Workflow.aspx 
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers
    if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
    Eric Tao
    TechNet Community Support

  • Trying to subtract days from a date

    Im trying to subtract days from a date.
    When i use this query:
    select sysdate-:p21_DAYS_OLD from dual;
    it displays the correct date but not in the correct format. It is displaying 12-AUG-09 instead of 08/12/2009.
    I tried this query but i get the ORA-01722: invalid number error.
    select to_char(sysdate,'MM/DD/YYYY')-(:p21_DAYS_OLD) from dual;
    Can someone help me please?
    Deanna

    Dclipse03 wrote:
    Im trying to subtract days from a date.
    When i use this query:
    select sysdate-:p21_DAYS_OLD from dual;Just set the NLS_DATE_FORMAT parameter for your session and execute the above query.
    ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY'
    /

Maybe you are looking for

  • Sims 2 Mac OS X 10.8 Powerpc applications no longer supported

    I have recently purchased the entire Sims 2 collection for use on my fairly new MacBook Pro, Version OS X Mountain Lion 10.8.4 However, I am unable to install the game due to 'Powerpc applications to longer being supported' being displayed when I cli

  • Example Basicresponse: HTTP Error 403 - Forbidden

    Hi, i installed the developer edition of ocms. The eclipse plugin works fine. I was able to deploy the "thirdpartycallcontrol" and to access it via http://localhost:8888/tpcc. BUT the basicresponse example does not work. I can deploy it but on http:/

  • IMovie 11 picture box layouts

    Can you alter, or create your own photo box layouts in iMovie 11. If so how, or where can you do this. I can't find that option. I don't want to use the canned, preset photo layouts. Any options available?

  • New hard drive - Ccleaner still preferred registry cleaner?

    Folks, Turning chicken **** here into chicken salad.  I ordered two WD Caviar Black drives to set up in a simple two-disk RAID 0 array and found out after purchase these drives are firmware disabled by WD for RAIDing by some gremlin called WDTLER. We

  • Ghost links and strange caracters

    Okay, I have been lurking through the discussions trying to find the answers without bugging anyone, but have reached wit's end. My website is at: nenana.schoolaccess.net/~cronnander I switched to Fetch to upload my pages and corrected the necessary