How to find no. of days,subtract date -- need help 04/21/2008 - 11/05/2007

ADAT is internally YYYYMMDD format in table.
Should i move this field before computation ? IF SO WHAT IS THE FORMAT ,statement pls;
G_days = ITAB10-ADAT - ITAB11-ADAT.
04/21/2008 - 11/05/2007 ouput is 54.   ---THIS OUTPUT IS WRONG.
Any better way of doing this.
second value 11/05/2007 - 09/10/2007 ouput is 86
SORT ITAB9 BY ADAT DESCENDING.
APPEND LINES OF ITAB9 FROM 1 TO 7 TO ITAB10.
DELETE ITAB9 INDEX 1.
APPEND LINES OF ITAB9 FROM 1 TO 7 TO ITAB11.
For eg. : if  02/30/2008 - 02/10/2008 -
ouput should be 20 days..
Edited by: Sona on Feb 21, 2008 1:36 AM
Edited by: Sona on Feb 21, 2008 5:45 AM

Hi,
Check the following code:
REPORT ZDATEDIFF.
DATA: EDAYS   LIKE VTBBEWE-ATAGE,
      EMONTHS LIKE VTBBEWE-ATAGE,
      EYEARS  LIKE VTBBEWE-ATAGE.
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
            TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
  exporting
    i_date_from          = FROMDATE
    i_date_to            = TODATE
  I_FLG_SEPARATE       = ' '
  IMPORTING
    E_DAYS               = EDAYS
    E_MONTHS             = EMONTHS
    E_YEARS              = EYEARS.
WRITE:/ 'Difference in Days   ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years  ', EYEARS.
INITIALIZATION.
FROMDATE = SY-DATUM - 60.
Regards,
Bhaskar

Similar Messages

  • How to find my emaillnand pass in apple need help

    how to find my email and pass in apple

    Welcome to the user to User Technical Support Forum provided by Apple.
    Clearly state your Issue and the Troubleshooting Steps you have tried to Resolve it.

  • New to Fios - So confused how to find anything on!!! - Need help with search

    Been with Comcast for years and years and just switched to Fios.  With all the channels and various buttons on the remote I'm overwhelmed with trying to figure out what's actually on.
    I understand how to use the search feature to find a show or theme, but what I can't figure out is how do you see a list of results for just programs that are currently on?? 
    It seems the search results are listed in order of channel name and there is nothing on the list that I see that shows which ones are currently on.  I find myself going thru the list, constantly pushing the right arrow key on the remote just to then find out the show is on later in the day or another day.
    Please help!
    Thanks,
    Vince

    The best way to see what's on now is simply to press Up on the remote to bring up the half-screen guide, then use the Ch + and - buttons to quickly scan through it.
    Not the solution you wanted. Perhaps you should suggest it in the Ideas forum.

  • How to find the table in which data from a structure sits

    Hi,
    I want to know how to find the exact table where data sitting in various structures during runtime are stored.
    For instance,in ME23N we have various tabs and data in those are held in various structures. This we can see by checking the technical setting of each field.
    I want to know in which table the data is actually stored for each field and how to find them.
    Any other means other than using "WHERE USED" option?
    Thanks
    CM

    After checking for technical field from the screen, when you reach out to structure, you can dbl click on the particular field's data element. From this data-element you can get to know in which tables it is used. Also if the data element refers to some master data field then you can check out its domain and in the domain you can refer the<b> value table</b> for that domain. This is what i will do if i am not sure about anything.
    Hope it will help a little.
    Jignesh.

  • How to find out each Cell having Data or Not in Excel File by Using WDJ

    Hi Friends,
    I have one doubt on WDJ.
    I have to Upload Excel File. Click on Upload Button in Excel file Data will move to One Bapi. This is I was done. But my Requirement is if any empty Cell in Excel That File not uploaded it display one error message Please upload Correct Excel File
    How to find out each Cell having Data or Not in Excel File by Using WDJ. Please tell me.
    By Using this Code I have Upload Excel File
    InputStream text = null;
         int temp = 0;
         //wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::");
         try
                   File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());     
    FileOutputStream op = new FileOutputStream(file);
                   if (wdContext.currentContextElement().getResource()!= null)
                          text = wdContext.currentContextElement().getResource().read(false);
                             while((temp=text.read())!= -1)
                                  op.write(temp);
                                  op.flush();
                                  op.close();
                                  path = file.getAbsolutePath();
                                  //wdComponentAPI.getMessageManager().reportSuccess("Path Name :::::"+path);
         catch(Exception ex)               
                   ex.printStackTrace();
    But my Requirement is If excel having any Empty Cell that excel file not uploaded.How to do this...
    Regards
    Vijay Kalluri

    Hi my friend
    I would like to share you some APACHE APi´s that i use when i have to read excel files in Web Dynpro.
    JAR = poi-3.2-FINAL-20081019.jar
    Some Example:
    POIFSFileSystem fs;
    HSSFWorkbook wb;
    HSSFSheet sheet;
    String myMexican_ValueFromExcelis = "";
    try {
             fs = new POIFSFileSystem(new FileInputStream();
             // and select the cell "y"
            cell = row.getCell( 0 );
            myMexican_ValueFromExcelis = cell.getCellValue();  
    }cach(Exception e){
    REgargds

  • How to find unsued Transfer Rules and Data Sources for a Master Table...??

    How to find unsued Transfer Rules and Data Sources for a Master Table...?? My requirement is i need to delete those Transfer rules and Data Sources which are not in use

    Hi
    Go to manage of the Text or attirbute of the master data object, see what are being loaded daily from there and delete the remaining.
    Cheer
    Ans as expected, Please reward

  • After upgrading my software i have seem to have lost all my contacts and photos, i did a back up but i have no idea how to get them back on? maybe im illiterate but i dont know how to find it in my itunes? please help!!

    After upgrading my software i have seem to have lost all my contacts and photos, i did a back up but i have no idea how to get them back on? maybe im illiterate but i dont know how to find it in my itunes? please help!!

    http://support.apple.com/kb/HT5824?viewlocale=en_US&locale=en_US

  • MY phone is using large amounts of data, when i then go to system services, it s my mapping services thats causing it. what are mapping services and how do i swithch them off. i really need help.

    MY phone is using large amounts of data, when i then go to system services, it s my mapping services thats causing it. what are mapping services and how do i swithch them off. i really need help.

    I Have the same problem, I switched off location services, maps in data, whatever else maps could be involved in nd then just last nite it chewed 100mb... I'm also on vodacom so I'm seeing a pattern here somehow. Siri was switched on however so I switched it off now nd will see what happens. but I'm gonna go into both apple and vodacom this afternoon because this must be sorted out its a serious issue we have on our hands and some uproar needs to be made against those responsible!

  • I Forgot My Rescue Email , But I Don't Know How To Find The Rescue Email Address! Please Help!

    I Forgot My Rescue Email , But I Don't Know How To Find The Rescue Email Address! Please Help!

    See the "more like this" section on the right side of this page

  • Brand new/never been used iPod nano 2nd gen keeps on charging and won't turn on when removed connection to pc/charger. how can i fix this? pls i need help

    brand new/never been used iPod nano 2nd gen keeps on charging and won't turn on when removed connection to pc/charger. how can i fix this? pls i need help
    i did that middle button and top button for 6-10 seconds, hold play button, that hold button and got it right back and still it won't on but it is detected on my pc and itunes. i've already even put on some songs but it keeps on charging and charging for how many hours and if i remove it, it shuts off and won't turn on again.

    brand new/never been used iPod nano
    Call Apple Care.   You are still under warranty.  You also have 14 days from the date of purchase to return your iPod with no questions asked. 
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired. 

  • I made a new apple account but every time i download a new app it says i need to put in my old accounts password and every time I do it says incorrect  how do I fix this?! I need help!

    I made a new apple account but every time i download a new app it says i need to put in my old accounts password and every time I do it says incorrect  how do I fix this?! I need help!

    As rex already mentioned, Apps and other content are forever tied to the Apple ID that was used to purchase them. No transfers. No combining Apple IDs. Forever means forever.
    In practice, this means any apps you currently have - free or paid - will need to be either repurchased using your new Apple ID or downloaded again if free. Until you refresh all of your apps, your iPad will ask for credentials to the old Apple ID any time one of the apps is updated.
    Why did you feel it was necessary to create a new Apple ID?

  • Hello, my ipad mini doent work i charged it till the next day and it didn't work i charged it again till the next day and it didn't work what should i do i didn't use my ipad for three days please i need help????

    hello, my ipad mini doent work i charged it till the next day and it didn't work i charged it again till the next day and it didn't work what should i do i didn't use my ipad for three days please i need help????

    Didn't work in what way.  Are you unable to start it up?  Does it start but then freezes?  Does the screen stay black when you turn it on?
    Try this - press the home and power buttons and keep pressing them until the apple logo appears.

  • How to find a specific day in a range of dates

    Hi !
    Can someone help me with this
    I would like to find if there is a Saturday in a range of dates:
    ex: OpenDate:2012-01-19 to CurrentDate,  should return  2012-01-21
          OpenDate 2012-01-23 to CurrentDate, should return null field
    Thank you

    Hi Diane,
    You can use this formula to find a Saturday in a date range:
    numbervar days := datediff("d",{Date_Field}, currentdate)+1;
    numbervar x;
    datevar array dates;
    redim dates[days];
    datevar sat;
    for x := 1 to days do
        dates[x] := {Date_Field}+(x-1);
        if weekday(dates[x]) = 7 then
        datevar sat := dates[x];
    sat;
    Hope this helps!
    -Abhilash

  • How to display an "All Day Event" date correctly in an integrated SSRS Report?

    I have two event items in a calendar list in SharePoint 2010. Both items have the same start time and end time. One of them, however, has the "All Day Event" checkbox checked. If I access them through a REST service, this is how the data is
    returned:
    <!-- item 1 -->
    <d:StartTime m:type="Edm.DateTime">2014-03-21T00:00:00</d:StartTime>
    <d:EndTime m:type="Edm.DateTime">2014-03-25T23:55:00</d:EndTime>
    <d:AllDayEvent m:type="Edm.Boolean">false</d:AllDayEvent>
    <!-- item 2 -->
    <d:StartTime m:type="Edm.DateTime">2014-03-21T00:00:00</d:StartTime>
    <d:EndTime m:type="Edm.DateTime">2014-03-25T23:59:00</d:EndTime>
    <d:AllDayEvent m:type="Edm.Boolean">true</d:AllDayEvent>
    I have a report in the same SharePoint 2010 site that uses SSRS in integrated mode. The data source is the calendar list mentioned above.  The date fields are not formatted, just displayed as them come from the list/database.
    My locale is set to en-US. When I run the report, the start date for item 1 is displayed as "3/21/2014" ('all day' set to false) but the start date for item 2 is displayed as "3/20/2014" which is incorrect ('all day' set to true).
    I did some research online and found out that SharePoint stores all date fields as UTC except for 'All Day Events', which are stored in local time (our servers are in Central Time, but I'm running the report fom Pacific Time, in the US).
    I coudn't find a solution to display the date correctly in the integrated SSRS report. Is there a way, maybe some straightforward formatting, to show All Day Event dates correctly? I tried adding hours but this is inconsistent with daylight saving hour changes.
    I would appreciate any help.
    C#, Sharepoint

    Hi SharpBud,
    The date for all day event stored in SQL in GMT time, the start time for an all day event returns the start time in GMT time, which is not the current time most likely.
    This is a confirmed issue, as a workaround, I would suggest you to use a calculate column for the event for the column, using the following format:
    IF(TEXT(([End Time]-[Start Time])-TRUNC(([End Time]-[Start Time]),0),"0.000000000")="0.999305556",IF([Start Time]=ROUND([Start Time],0),[Start Time],DATE(YEAR([Start Time]),MONTH([Start
    Time]),DAY([Start Time])+1)),[Start Time])
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Find no. of days between dates

    Hi guys,
    I have 5 dates with me, 2 of which are Key Figures and 3 are of Char. date type. Now, I have to find no. of days between these dates using various permutation and combination i.e. it can be between 2 KF's or 2 Char. types or 1 KF and 1 Char. type as well.
    1) I think finding no. of days between 2 KFs can be done using Cumulative KF.
    2) I tried to find no. of days between 2 Charac. by creating a Formula (2 variables with Replacement Path) and then finding the difference. But the output seems to be wrong.
    eg. 27.02.2009     -    19.01.2009  = 108 days, which is wrong!
         (Posting date)      (clearing date)
    3) I also have to do it between 1 KF and 1 Char. date type, tried creating 1 variable for Char. and then subtracting with KF, but Report shows 'X' in the output!
    Any suggestions?
    Thanks.

    Hi,
    You can do it by using Customer Exits and Replacement path Variables..
    see teh floowing thread.
    Difference in days
    Thanks
    Reddy

Maybe you are looking for

  • How to export a video with 32 bits ?

    Hello everyone First of all, I'm french so I'm sorry if there are mistakes in my sentences. I'm experiencing some difficulties with exporting my first short film with Premiere Pro properly. I want the output to be a .avi file in 32 bits. Unfortunatel

  • How do I stop the codec performer pop up page from coming up?

    It continues to pop up. I tried the suggestions but it still comes up.

  • Delete with where clause?

    Hallo, the normal way to delete an row in my adf-application is using the following method from a backing bean: public String onDelete() { BindingContainer bindings = getBindings(); OperationBinding operationBinding = bindings.getOperationBinding("De

  • Dates in Excel output

    I'm having problems with dates in excel. I create a query wizard report with a date field. I then change the output format to Excel. My date formatting is ignored, but that's a known issue. But the SYLK (.SHOW) file tells excel to treat the date as a

  • Joint Venture Activation

    Hi Experts, There is a radio button in IMG to Activate Joint Venture Accounting in SAP. I need to know if we activate this it will be activated in a single client or all the clients in the server. Please help Pratiksha