Function Module to obtain date

Hi all
Can anyone suggest me the function module which satisfies below scenario:
Suppose i enter FROM date as :18.07.2006
and TO date as :20.07.2006
I should get number of days between these two dates as 1 and value :19.07.2006.
Thanks in advance
Regards
Neha Kapoor

Hi neha,
1. just copy paste
2. It will list ALL THE DATES which fall in between,
   and also the NUM OF DAYS.
3.
report abc.
PARAMETERS : FROMDATE TYPE SY-DATUM DEFAULT '20060701'.
PARAMETERS : TODATE TYPE SY-DATUM DEFAULT SY-DATUM.
perform mydays using fromdate todate.
FORM
FORM MYDAYS USING MYFROMDATE MYTODATE.
  DATA : CURDATE TYPE SY-DATUM.
  DATA : NUMOFDAYS TYPE I.
  CURDATE = MYFROMDATE + 1.
  DO.
    IF CURDATE >= MYTODATE.
      EXIT.
    ENDIF.
    NUMOFDAYS = NUMOFDAYS  + 1.
    WRITE :/ CURDATE.
    CURDATE = CURDATE + 1.
  ENDDO.
  WRITE :/ '------- Num of days ' , numofdays .
ENDFORM.                    "MYDAYS
regards,
amit m.

Similar Messages

  • Adobe Widgets -Function module not displaying data in flex

    Hello All,
    I am using a function module to obtain the data of the tables parameter. When i run in the adobe flex its not displaying the table data. I have written even the code also in the adobe flex.
    I have set all the configurations and even set the RFC also.
    Can anybody help me out in this issue.
    I will reward you with points.
    Thanks,

    hi karan,
    I hope that you are using the REST service from the sap widget foundation.
    what type of error it displays?
    code :
    <mx:HTTPService id="sapService"
    url="http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct" method="POST"/>
    reference :
    Adobe widget :(which is created using adobe flex,also the relevant article attached)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e00ca8a3-51aa-2a10-fdaf-97858e6acd12
    thanks
    jaideep
    Edited by: Abesh Bhattacharjee on Feb 28, 2008 12:31 PM
    Please do not ask for points. You will get them if you deserve them !

  • Program or Function module to delete data from Open Hub Destination Table

    Hi All,
    Can anybody suggest me a Program or Function module to delete data from Open Hub Destination Table.
    Thanks & Regards,
    Vinay Kumar

    You can simply goto t-code SE14 mention the open hub destination table and Delete data by clicking on "Activate and Adjust database" with radio button "Delete Data".
    Regards,
    Arminder

  • Function module to read data form customer tabels

    hi,
    can anyone suggest function module to read data form customer tabels?
    Please give me reply.
    TKS,
    Dharani.P

    Hi,
    this thread is hvaing your answer.
    Is there a Function module to get customer hierarchy data?
    Regards,
    Pravin

  • Function Module to find date by passign the Planning Calendar

    Hi All,
    Can you tell me is there any function Module to find date by passign the Planning Calendar?
    The requirement is i have a planning calender assigned to the Material in the MRP2 view.
    Example: Material XXXXXX is assigned a Planning Calendar Z01.
    Z01 is defined such that Delivery is on Monday only. This calendar says that the material is received from the Vendor only on Mondays.
    So whenever i punch a Sales Order for Material XXXXXX, a PR is automatically geenrated when saving the sales order and the calculation of Delivery dates is also happening at this level.
    Basing on this PR a PO is raised to a Vendor for procuring the Material XXXXXX, now my problem is for example the PO is raised today (30.04.2008), but the Materail XXXXXX is available only on next monday in my plant (05.05.2008) basing on my Planning Calendar assigned in the Materail Master, so i have to inform this dealy to my customer at the time of punching the sales order.
    So is there any function Module to find date by passign the Planning Calendar?
    Thanks for your valuable inputs.
    Regards,
    Sudarshan

    Hi Jorge,
    Thanks for your reply.
    I am unable to open the Function module which you have mentioned below.
    I am working on 4.6 c version of SAP.
    Any ways i have found one function module which is useful to my requirement as stated below:
    DATE_GET_PERIOD
    Thanks and Regards,
    Sudarshan

  • Function Module to validate date

    Hi,
    Is there a Function module to validate date in transfer rules or update rules. I checked the forum, couldn't find an answer. Any help is appreciated
    Thanks
    Bala

    You should be able to use this FM:
    CALL FUNCTION 'RSAR_DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        i_date                          = yourdate
    EXCEPTIONS
       PLAUSIBILITY_CHECK_FAILED       = 1

  • Function Module to Compare Date within date Range

    Hi All,
            Does anyone know Function Module to Compare Date within date Range...For example i need to find whether 08/02/2006 falls in between 07/15/2006 and 09/15/2006......

    data: datum type sy-datum value '20070802',
          datum_low type sy-datum  value '20070730',
          datum_high type sy-datum value '20070930'.
    If datum between datum_low and datum_high.
    Endif.
    Regards,
    Rich Heilman

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Function module to change date format

    hi
    is there any function module to change date format from 20080318 to 18.03.2008

    Hi,
    Use this FM  CONVERT_DATE_FORMAT            Convert date from yyyymmdd to ddmmyyyy format
    Regards,
    Jyothi CH.

  • 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.

  • FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.

    HI EXPERTS,
         FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
    PLS DO HELP.....

    Hiii gita
    we have another FM SPELL_AMOUNT
    regards
    Jaipal

  • Function module to convert date format from yyyymmdd to mmddyyyy format

    function module to convert date format from yyyymmdd to mmddyyyy format

    Hi Rajitha,
    Do like this
    Data: Var1 type sy-datum,
             var2(8) type c.
    var1 = sy-datum.
    Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
    write var2.
    Reward Points if this helps,
    Satish

  • Is there any function module to convert date format?

    Is there any function module to convert date format from mm/dd/yyyy to dd.mm.yyyy or sy-datum?

    Hi,
    wirte statement converts any date fomat in system date fromat
        WRITE w_DateTO w_date_sys.
    Regards,
    Sriram

  • 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

  • Function module to conver date to internal format

    Can anybody say what is the function module used to convert the format of the date which is taken from excel sheet to the sap format. If so pls tell me how to use that function module.

    Currently my date is getting printed in format 05262005.
    I want the output as 26 May, 2005.
    I have tried using Set date mask option but it is not picking up in the output.
    Code:
    This code yields as 12 march 2006.
    DATA: ZTEMP(9). 
    CLEAR: ZTEMP, ZDD, ZMMM, ZYYYY. 
    CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT' 
    EXPORTING 
    INPUT = IS_DLV_DELNOTE-HD_GEN-CREA_DATE 
    IMPORTING 
    OUTPUT = ZTEMP. 
    ZDD = ZTEMP+3(2). 
    ZMMM = ZTEMP+0(3). 
    ZYYYY = ZTEMP+5(4).
    http://www.sap-img.com/abap/abap-program-output-of-date-format.htm

Maybe you are looking for

  • Every time I click on the iphone tab it disappears?? How do I get to see the data??

    Everytime I click on the iphone tab when I connect my iphone to my computer via USB and when I go to click on the iphone tab which would usually say jades iphone it disappears???

  • Fact Table with multi billion records.

    Hi ---> Is it advisable to build hierarchies around 3 billion record table Fact table and still growing in OBIEE..I know we can use oracle OLAP Tool and DB and other additional infrastructure will do it. But tryiing to look for a better way with the

  • StoredProcedure outParameters oracle

    Hi, I have a java project where I try to obtain a data type from a Oracle Stored Procedure. My problem is when I recive the Map (the Map is returned by execute method from StoredProcedure of Spring), the object I have received is a * $Proxy3 * Object

  • Problem in generating Holiday Calendar

    Dear All, I have created Holiday Calendar for 2009 through SCAL. After that I had generated work schedule rule through PT01. But after generating work schedule, 19th Oct,2009 which was marked as public holiday in the calendar is not coming as an OFF

  • Migraton from EIS to Essbase Studio

    Hi All, We try to migrate the existing EIS (32 bits setup) into Essbase Studio (64 bits) environment. The old EIS and SQL2000 are both installed on separate servers. In the new environment we have a seperate server for Studio and SQL2008. How to use