Reg Function module for getting date

Hi,
My requirement is, If I entered some date I need to get past three months number of days.
Eg: if I entered 26thDec,2007
I need to get number of days form October 1st to 26th Dec.
Regards,
sarath.

try this code
REPORT ztest .
DATA : lv_date TYPE syst-datum ,
       lv_tmp  TYPE i          .
PARAMETERS : p_date TYPE syst-datum OBLIGATORY .
CALL FUNCTION 'ADD_TIME_TO_DATE'
  EXPORTING
    i_idate = p_date
    i_time  = '3'
    i_iprkz = '2' "Month
  IMPORTING
    o_idate = lv_date.
lv_tmp = lv_date - p_date .
WRITE : 'Diff in days ' , lv_tmp .

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

  • Any function module for getting fiscal year week numbers

    can any one provide me function module for getting fiscal year week numbers ? if no function module please let me know work around.
    Thanks!
    Lakshmikandh

    hi,
    Use FM <b>'DATE_GET_WEEK'</b>...
    parameter D1 LIKE SCAL-DATE.
    Data w like scal-week.
    CALL FUNCTION <b>'DATE_GET_WEEK'</b>
    EXPORTING
    date = D1
    IMPORTING
    WEEK = W
    EXCEPTIONS
    DATE_INVALID = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write W+4(2).
    Regards,
    Santosh

  • Function Module for getting address from address number

    Hi all,
    Is there any function module for getting address from address number. kindly reply.
    regards,
    siya

    HI,
    just try this function module:
    CALL FUNCTION 'HR_GET_ADDRESS'
        EXPORTING
          ankey          = ankey
          anart          = anart
          molga          = '01'
        IMPORTING
          address_detail = adr_data
        EXCEPTIONS
          not_found      = 1
          OTHERS         = 2.
    HOPE IT WILL HELP YOU
    regards
    rahul

  • Is there any function module for getting distribution list name

    Hi all,
    Is there any function module for getting distribution list name when there is same description for two distribution list name.
    or
    help me how to fetch the correct distribution name when there is same description.
    In order to send mails.
    Tell me ASAP.
    thanks
    sagar.

    http://www.sapbrainsonline.com/REFERENCES/FunctionModules/SAP_function_modules_list.html
    list of Fms

  • Any Function Module For getting Shipment Details

    Hi All,
    I want to get all details of shipment. i tired , but unable to get any function? I was able to find the creation or change shipment function modules, but not able to find the function module for getting the details for Shipment.
    like BAPI_SHIPMENT_CHANGE           Change Shipment
    BAPI_SHIPMENT_CREATE           Create Shipment
    similary
    Do you have any idea for getting (display)the details of Shipments?
    Regards,
    Raju

    hi,
    you can use
    VTTP,VTTK
    or
    RV_SHIPMENT_READ

  • Function module to get 'Date one year in the past' in APO

    Hi,
    Required function module to get date one year in the past in APO.
    Thanks and regards,
    M.R.Reddy.

    Hi Reddy,
    Try these function modules
    /SAPAPO/DATE
    /SAPAPO/FISCAL_BDATE
    /SAPPO/MAPI_MAP_CREATDATE
    /SAPPO/MAPI_MAP_POSTDATE
    /SAPAPO/LCP_CALC_DATE
    /SAPAPO/VS_ORDER_GET_DATES
    /SAPAPO/PERIOD_CONVERT_DATE
    /SAPAPO/PERIOD_DATE_GET_FROMTO
    /SAPAPO/PERIOD_GET_DATE_RANGE
    /SAPAPO/PERIOD_GET_FOR_DATE
    /SAPAPO/PERIOD_GET_FROM_TODATE
    Regards
    R. Senthil Mareeswaran.

  • Required function module to get date one year in the past.

    Hi,
    Required function module to get date one year in the past.
    Thanks and regards,
    M.R.Reddy.

    Hello,
    You can check this:
    DATA:
    V_DATE1 TYPE D,
    V_DATE2 TYPE D.
    V_DATE1 = SY-DATUM.
    TRY.
        CALL METHOD CL_HRPAD_DATE_COMPUTATIONS=>SUBTRACT_YEARS_FROM_DATE
          EXPORTING
            START_DATE = V_DATE1
            YEARS      = 1
          RECEIVING
            DATE       = V_DATE2.
      CATCH CX_HRPA_VIOLATED_POSTCONDITION .
    ENDTRY.
    WRITE:
    / V_DATE1, / V_DATE2.
    Hope this helps.
    Br,
    Suhas

  • ALV FUNCTION MODLE FOR GETTING DATA IN EXCEL SHEET

    HI ,
    CAN I HAVE ALV FUNCTION MODLE FOR GETTING DATA IN EXCEL SHEET
    Regards,
    Aruna

    Standard ALV grid uses the FM <b>ALV_XXL_CALL</b> for exporting data into Excel. You can put a break-point in the FM and check it for urself.
    for ur info - the above FM takes the internal table name, internal table content and the field catalog as input.

  • Function Modules for Format Date, Month Name and Quarter value.

    Hi All,
    1. I am getting the date field from the Flatfile, so i need to format the date to YYYYMMDD. Is there any Function module for that in BW.
    2. Based on the above Formated Date i have to find out the Name of the Month like JANUARY, FEBUARY etc.
    3. Based on the same above Formated Date i need to find out the Quarter like 1, 2 etc.
    Could you please let me know if any function modules are there for the above questions in BW not in ABAP, why i mention is some Function modules are there in ABAP but not in BW.
    Thanks in advance.
    Regards,
    srinivas

    Hi ,
    1.If your input date format is MMDDYYYY then Use SDATE as conversion routine in trans strucutre to convert into YYYYMMDD.
    2.By passing year as input parameter for the following FM you would get all the months with text.Using READ statement in routine you can get month name
    MONTH_NAMES_GET
    3.For Quarters you can use the following FM:
    TSTR_PERIODS_QUARTERS
    hope it helps...
    regards,
    Raju

  • Reg function module to get  periods.

    Hi,
        can any one help me in giving the function module to get the number of months  available in between the start date and end date
    Regards.
    venkat

    Hi,
    Use the below function modules.
    HR_ECM_GET_NUMBER_OF_MONTHS
    HR_GBSXP_GET_MONTHS
    For the function module HR_GBSXP_GET_MONTHS Pass 'M'
    for MODIFY_INTERVAL.

  • Function module for getting Vendor Address details

    Hi,
    Im new to this group,and new to ABAP
    plz hep me out by solving ABAP Query...
    i want to generate a report for getting Vendor Details
    like Vendor address,Ph num and Email
    input fields are Company code,country key and Account Group.
    im Using Smart Forms for this..
    but im not getting the Exact Function module to get All Required Details..
    regards
    Smitha

    thanks for ur quick reply...
    SELECT SINGLE LIFNR
      FROM LFB1
      INTO V_LIFNR
      WHERE BUKRS EQ V_BUKRS.
      CALL FUNCTION 'VENDOR_READ'
        EXPORTING
          i_bukrs         = V_BUKRS
          i_lifnr         = V_LIFNR
        EXCEPTIONS
         NOT_FOUND       = 1
         OTHERS          = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    this is the code i have written...
    but my problem is there no table in the Function module....
    for Example...
    CALL FUNCTION 'QPAX_PLMKB_READ_FROM_PLKO'
        EXPORTING
          i_plnty            = 'Q'
          i_plnnr            = V_PLNNR
          I_PLNAL            = V_PLNAL
          i_sttag            = V_DATUV
       TABLES
        T_PLMKB_TAB        = IT_TAB
    i want the function modules with tables and proper input...

  • Function Module for Discount Date

    Hi,
         Can somebody tell me whether there is any function module for determining the Discount Date (DATS) and Payment Due Date(DATS) based on Payment Terms (ZTERM)?
    Thanks,
    John.

    FI_FIND_PAYMENT_CONDITIONS
    DETERMINE_DUE_DATE

  • Function Module for selecting date by day

    Is there any function module to choose date by day. for example if I give today's date the FM should give me next thursday's date.
    Thanks
    Tharani

    this works good........
    *& Report  YCHATEST                                                    *
    REPORT  YCHATEST
    data:day like DTRESR-WEEKDAY.
    parameters:curr_dat like sy-datum default sy-datum.
    CALL FUNCTION 'DATE_TO_DAY'
      EXPORTING
        DATE          = CURR_DAT
    IMPORTING
       WEEKDAY       = day.
    write : / day.
    case day.
    when 'Monday'.
       CURR_DAT = CURR_DAT + 3.
    when 'Tuesday'.
       CURR_DAT = CURR_DAT + 2.
    when 'Wed.'.
       CURR_DAT = CURR_DAT + 1.
    when 'Thursday'.
       CURR_DAT = CURR_DAT + 7.
    when 'Friday'.
       CURR_DAT = CURR_DAT + 6.
    when 'Sat.'.
       CURR_DAT = CURR_DAT + 5.
    when 'Sunday'.
       CURR_DAT = CURR_DAT + 4.
    endcase.
      write :/ CURR_DAT.

  • Function module for getting the open qty

    HI experts,
                      I have a PO quantity(EKPO_MENGE).against same PO and item item(EBELN and EBELP) if Goods receipt has happened (MSEG_ERFMG) then i need to calculate the open qty.and also by netting the open quantity if multiple GRs has done against the same PO and item.
    Can you suggest any function module to get this open PO quantity.

    Hello,
    Hope this link can help you.
    [Po Open Quantity;
    Thanks
    Jayant

Maybe you are looking for