Function module for finding differens in date

HI,
Friends can any one help me in finding out difference in date in select option .
i having problem when difference  became negative .My requirement is to find out monthly report for a material . so i need to find out difference of date and need to add one month from the given date to require date.
Regards,
Mahendra.

try the following fms
SD_DATETIME_DIFFERENCE
DAYS_BETWEEN_TWO_DATES
MONTHS_BETWEEN_TWO_DATES..
sample code is
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.
<u><i><b>DATE DIFF W/O FM</b></i></u>
LOOP AT itab.
  v_number_of_days = itab-date2 - itab-date1.
  IF v_number_of_days > 1.
    DELETE itab.
  ELSE.
*-- Do something else.
  ENDIF.
ENDLOOP.
regards
navjot
REWARD IF HELPFULL
Message was edited by:
        navjot sharma

Similar Messages

  • Functional module for Getting Material classification data.

    Please tell me Functional module for Getting Material classification data like class type , class, characteristics and characteristics values for material.

    Dear,
    FM:
    CLAF_CLASSIFICATION_OF_OBJECTS
    Table KLAH Class Header Data
    - KSML Characteristics of a Class
    Regards,
    R.Brahmankar

  • Function Module for getting Payroll start date and end date

    Hi Gurus,
      If I give one date then is there any function module to find the payroll period start date and enddate for that given date?
    Points will be awarded
    Thanks
    Ravi

    Hi,
      Try these FMs
    HR_PAYROLL_PERIODS_GET
    HR_BEN_PAY_GET_PAYROLL_PERIODS
    HR_PAYROLL_PERIOD_GET
    HR_P06I_GET_PAYROLL_PERIOD
    Regards,
    PRashant

  • Function Module for getting the desired date

    Hi All,
    I need a function module where in get the date value from Current date - 540 days.
    i,e System Date - 540 days = ????
    Thanks
    Suresh

    previous FM works good , this is for ur info , to give in month, date and year instead of onlly days
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          date      = sy-datum
          months    = '00'
          days      = '07'
          years     = '00'
          signum    = '-'
        IMPORTING
          calc_date = w_due_date.
    Message was edited by: chandrasekhar jagarlamudi
    Message was edited by: chandrasekhar jagarlamudi

  • Function Module for calculating hours between dates and their times.

    Hi all,
    Is there any standard function module for calculating the time difference in hours between two dates with start and end times.
    Regards,
    Sudipto.

    Sudipto,
    How're you ????????????????????
    Check out the following Function Module:
    SD_DATETIME_DIFFERENCE (Give the difference in Days and Time for 2 dates)
    Regards,
    Abir
    Don't forget to award Points *

  • Function module for finding number of records in table

    Do we have any function module to find number of records in a table?
    Thanks,
    Shweta

    use the EM_GET_NUMBER_OF_ENTRIES. You just have to write your table name into the input table IT_TABLES in the TABNAME field

  • BAPI/FUNCTION  module for the configure varient data(MRP3 -MM02)

    Hi all,
    I have  a requirenent to send the configure varient data(MRP3 -MM02) to another system.Please guide me how it can be created in receving system.ie please provide a function module or BAPI for the same.
    Thanks.
    Edited by: sanu debu on May 11, 2009 11:01 AM

    I am also looking for the same requirment . could you please let me know if you find any BAPI.

  • Function Module for Creation of classification data for a Routing

    Hi
    Can you please let me know if there are any function modules/Bapi's to create Classification data for a Routing?
    THanks
    Shekar

    For creating classification data, have a look at the function group CTMS and function module CTMS_DDB_SET_VALUE_INTERNAL.
    Not sure what you mean by "Routing".
    For BAPIs also look into the function group CLBPA, that sits in the same development package CLCL as the function group CTMS.
    Hope this helps.

  • Function Module for finding all the users in an org unit?

    Hi,
    is there a function module or a table by which we can find all the users within a purchasing group of purchasing organisatiopn unit.
    Looking for a quick response.
    Regards,
    Neha

    Please use the function module BBP_OM_STRUC_GET_USER_FROM_ORG.  You have to pass the Org Ids in the parameter START_OBJECTS. Then USER_TAB will give you all the users.
    Note:
    OTYPE = 'O'.
    OBJID = <Org Id say 50002323>.
    Regards
    Kathirvel
    Edited by: Kathirvel Balakrishnan on Sep 24, 2008 2:25 PM

  • Function Module for Info Record conditions data

    Hi, ALL
    I'm looking for a Function Modlue or Method that we can insert conditions datas of Info Record.
    Also, I'm looking for a FM that we can update them, and get these infomations.
    Plese let me know if you know these.
    Regards
    Rie

    hi,
    For reading the purchase price, use the function module BASIC_PURCHASE_PRICE_READ ...function group WVKC (development class WVKP)
    you can also check sap note 565002 for more info...
    Regards
    Priyanka.P

  • Function module for finding related IDOCs of a document

    Hi All,
    I have a requirement where the inout will be shipment numbers. The expected output is the list of all the IDOCs that are related to the shipments. I know that this is a replica of the WE09 functionality but the users will not have access to WE09 and more over WE09 takes a long time to give this result.
    My expectation is someting like the relationship in the "Services for objects2 that we have in the document which will give this detail very quickly.
    I know one function module (WFMC_PROTOCOL_GET) which will give the list of outbound IDOCs if we know the output type  and the shipment number. Also there is another function module GOS_EXECUTE_SERVICE which will do very similar to the servie for objects. But I need to know exactly the class or function module which will give me the relationship output alone so I can use this for further processing.
    Also kindly let me know if there is some other standard way of looking  at this requirement.
    regards,
    Vijay V

    Vijay,
    You can use FM  'DRB_NEIGHBOURS_GET' for the required functionality . Here is sample code :
    DATA : L_BORIDENT  TYPE  BORIDENT ,
            T_RELATIONS TYPE TABLE OF BORIDENT .
      L_BORIDENT-OBJKEY = Delivery_no .      "Document no
      L_BORIDENT-OBJTYPE = 'LIKP' .          "Object type e.g. LIKP , BUS2025 
        CALL FUNCTION 'DRB_NEIGHBOURS_GET'
          EXPORTING
            BORIDENT           = L_BORIDENT
          TABLES
            T_RELATIONS        = T_RELATIONS.
    Linked Idoc type will be in table T_RELATIONS with OBJTYPE value equal to 'IDOC' .
    - Tushar Shukla

  • Need a Function Module for fetching the prior date-Urgent!!

    Hi All,
         I need a function module which will give the prior date with respect to the no: of days days that are entered as input.
    Can anyone please help me to fing one function module which acts as the above.
    Required very urgently!!!
    Thanks and Regards,
        Neethu

    Hi Neethu,
    Please run the report 'ZRECTIFY_FM_DOCUMENTS' in your system.
    Before running the report, create the following selection texts for the parameters/select-options as given below:
    P_BUKRS:  Company code
    S_GJAHR:  Fiscal year
    S_BELNR:  FI document no.
    P_TEST:   Test run
    For More information please refer <b>SAP Note: 309619</b>
    Best Regards,
    Johnny.

  • Urjent-Any function module for finding Sales order, Delivery and Invoic

    Hi Experts,
    I am having selection screen like
    Sales order
    Delivery
    Invoice
    Customer
    If i give sales order
             Delivery and Invoice should pull
    If i give delivery
             sales order and Invoice should pull
    If i give Invoice
             sales order and delivery should pull
    If i give customer
               all customer related data should pull
    Do we have any function modules to meet this reqirement?
    If we have please provide function modules.
    Thanks,
    mahe
    Edited by: Rob Burbank on Mar 30, 2009 4:17 PM
    Edited by: mahahe on Mar 31, 2009 9:12 PM

    You can use VBFA table, right? in the FM also, you can find the same logic, like pulling from VBFA table.
    thanq

  • Function module for finding sales order GT total value(vbak-netwr)

    Can anyone tell which function module is used to find the Sales order  greater than the input parameter which is  total value(vbak-netwr).Output should be the details of sales order satisfying the condition.ie greater than the total value.

    Hi chandra
    I hope you are giving the logic to the ABAP'ers . By giving the input and the outputs. So here , VBAK-NETWR are related to functional consultants .
    Based on the requirement , SD,FI etc the give the logic but mostly it is related to SD consultants only
    Reagrds
    Srinath

  • Function Module to find the Begin Date of the Year

    Hi Experts,
    Could you let me know if there is a FM to find the "Begin Date of the Year".
    I appreciate your help.
    Thanks a lot.

    Hi,
    Do you want the Begin date of the <b>current</b> year..Try this..
    DATA: V_DATE TYPE SY-DATUM.
    V_DATE = SY-DATUM.
    V_DATE+4(4) = '0101'.
    WRITE: / 'Beginning date of the year ' , v_date.
    If you are mentioning about the Fiscal year..Then you can use the FM PERIOD_DAY_DETERMINE
    Thanks,
    Naren

Maybe you are looking for

  • A new iMac and an Old Printer HP Deskjet 648c

    We have a new iMac, intel duo running OSX10.4.7. The system only seems to see my printer as a 640C. I also cannot find the test print utility. So I have 2 questions 1. How do I get this system to recognize my Hp Deskjet 648C printer and be able to pr

  • Computer to Computer Networking Crawls

    Hi All, I have a very annoying problem. Sharing files between my iMac and Macbook take forever. 16 Minutes for a 250 MD folder. I end up having to use a flash drive just to share files back and forth. Both these computers are within 5 feet of eachoth

  • All Photos in Iphoto 8 Deleted

    I accidentally deleted all of my photos in iphoto on my mac book.  I was using iphoto 8.  Everything else is there... my slide shows, my events, but no photos.  I did back up with time machine two days ago.  I was running Leopard when I backed up wit

  • Can't debug with mac-intel, firefox and FB2

    Here is the message I get when trying to debug: <start> Failed to connect; session timed out. Ensure that: 1. You compiled your Flash application with debugging on. 2. You are running the debug version of the Flash Player. <end> I assume the flash pl

  • I can not sync my phone with this Macbook Pro

    I had a nasty suprise I paid out over £1500.00 to be told that I can not sync my phone with this Macbook Pro. the reason for buying a Mac is that the windows 7 machine is in little bits so how do I sync that.  there is no music on this Mac pro and if