What is function module get previous date by enteing no of days

FM should take : 7 days
and should return : 4.12.2007
as output.
Thanx,
Naveen

Hi,
Apart from function module, you can write as follows.
data : date1 type datum,
       date2 type datum.
date1 = sy-datum.
date2 = date1 - 7 .
write date2.

Similar Messages

  • Date Function to get Previous week

    Is there a date function to get
    Let us say today is 23rd of Jun 2009
    I want a date function to get previous Thursday 18 Jun 2009
    and another function which get 7 days before which is Friday 12 Jun 2009.
    FYI: For the current week, I was able to use:
    select next_day(case to_char(sysdate,'Day') when 'Thursday' then trunc(sysdate-1) else trunc(sysdate) end, 'Thursday')
    from dual;
    select next_day(trunc(sysdate-7), 'Friday') from dual;
    I want something similar to that.
    Thanks

    No, not separate functions, but you can tweak next_day to get what you want:
    select trunc(sysdate) today,
           next_day(trunc(sysdate)-1, 'THURSDAY')-7 last_thursday,
           next_day(trunc(sysdate)-1, 'FRIDAY')-14 prev_2nd_friday
    from   dual;
    TODAY     LAST_THUR PREV_2ND_
    23-JUN-09 18-JUN-09 12-JUN-09

  • 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

  • Function Module Get Conf by PO number

    Dear Expert,
    I would like to get Confirmation number by PO Number. Please let me know what the Function module should I use in SRM
    example : I have a PO number, I want to know the confirmations number related for these PO number
    Many Thanks

    Hello,
    please find the code below:
    DATA : lv_po                  TYPE CRMD_ORDERADM_H-OBJECT_ID,
                  lv_conf               TYPE CRMD_ORDERADM_H-OBJECT_ID,
                  lt_pdlist               TYPE TABLE OF BBP_PDS_PDLIST,
                  ls_pdlist              TYPE BBP_PDS_PDLIST,
                  lt_messages       TYPE TABLE OF BBP_PDS_MESSAGES,
    lv_po  = po num ber
    *Get the confirmation number for given po number
      CALL FUNCTION 'BBP_PD_CONF_GETLIST'
        EXPORTING
          I_FOR_PO_ID = lv_po
        TABLES
          E_PDLIST    = lt_pdlist
          E_MESSAGES  = lt_messages.
    LOOP AT lt_pdlist into ls_pdlist WHERE OBJECT_TYPE = 'BUS2203'.
                lv_conf = ls_pdlist-object_id 
    ENDLOOP.
    Regards,
    Neelima

  • 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

  • What are function modules used in alv,and its explanation

    what are function modules used in alv,and its explanation

    hi..
    The important function modules are
    Reuse_alv_fieldcatalog_merge
    Reuse_alv_list_display
    Reuse_alv_events_get
    Reuse_alv_grid_display
    Reuse_alv_commentary_write.
    <b>REUSE_ALV_FIELDCATALOG_MERGE</b>
          This function module is used to populate a field catalog which is essential to display the data in ALV.
          If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter (I_structure_name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    Note : Fieldcatalog can be filled manually also by filling up all the required details into the internal table     
    The important parameters are:
       1. Export:
            a. I_program_name     : report id
            b. I_internal_tabname     : the internal output table     
            c. I_inclname     : include or the report name where all  
                                                 the dynamic forms are handled.
        2. Changing
           ct_fieldcat     :    an internal table with the type 
                                      SLIS_T_FIELDCAT_ALV which is declared in the
                                      type pool SLIS.
    <b>REUSE_ALV_LIST_DISPLAY</b>
    This is the function module which prints the data.
    The important parameters are:
    1. Export:
          I_callback_program            : report id
          I_bypassing_buffer             : ‘X’
          I_buffer_active                    : ‘ ‘
          I_callback_pf_status_set     : routine where a user can set
                                                             his own pf status or change the
                                                             functionality of the existing pf status.
          I_callback_user_command : routine where the function codes are
                                                               handled.
          I_structure name     : name of the dictionary table
          Is_Layout          : structure to set the layout of the report
          It_fieldcat          : internal table with the list of all fields and their
                                                 attributes which are to be printed (this table
                                                 can be populated automatically by the function
                                                 REUSE_ALV_FIELDCATALOG_MERGE
          It_events          : internal table with a list of all possible events
                                                 of ALV and their corresponding form names.
    2.  Tables:
         a. t_outtab     : internal table with the data to be output
    <b>REUSE_ALV_EVENTS_GET: </b>
          Returns table of possible events for a a list type
    1. Import:
          Et_Events      :
          The event table is returned with all possible CALLBACK events for the specified list type (column ‘NAME’). For events to be processed by the Callback, their ‘FORM’ field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field ‘FORM’ filled and the entry modified using constants from the type pool SLIS.
    2. Export:
        I_list_type:
              0 = simple list REUSE_ALV_LIST_DISPLAY
              1 = hierarchical-sequential list                                           
                    REUSE_ALV_HIERSEQ_LIST_DISPLAY
              2 = simple block list                                                        REUSE_ALV_BLOCK_LIST_APPEND
              3 = hierarchical-sequential block list
                    REUSE_ALV_BLOCK_LIST_HS_APPEND
    <b>REUSE_ALV_GRID_DISPLAY</b>
      A new function from 4.6 version, to display the results in grid rather than a
      preview.
      Parameters : same as reuse_alv_list_display
    <b>REUSE_ALV_COMMENTARY_WRITE</b>
    This is used in the Top-of-page event  to print the headings and other
    comments for the list.
    It_list_commentary : Internal table with the headings of the type
                                             slis_t_listheader.
        This internal table has three fields:
        Typ : ‘H’ - header, ‘S’ - selection, ‘A’ - action
        Key : only when typ is ‘S’.
        Info : the text to be printed
    <b>plz reward pts if helpful.</b>
    regards
    vijay.

  • What is function module?wn we use it in "generic extractor"

    hi  friends
    i dont know what is function module?wn we,and how we will creat it? whats tha use of it? send me notes with some real time examples
    i  will waiting for ur replays

    What is FM extractor and when we are using :
    Sometimes, if your application or requirement makes it necessary, you have to create your own function module to extract the data from whatever sap system to bw.
    Therefore you normally make a copy of the standard fm 'RSAX_BIW_GET_DATA_SIMPLE'. To make this new function work for you, you have to realize the following.
    Generic Extraction via Function Module
    Generic Extraction via Function Module
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm

  • Function to get starting date of financial year ??

    Hi,
       what is the Function to get starting date of financial year. I am developing a inventory report, for that i need; start of the factory opening date. Is that factory n financial year are in the same date.
    Thanks,
    Senthil

    SEE THIS FMS.
    TSTR_PERIODS_FACTORYCALENDAR
    FACTORY_CALENDAR_GET
    RH_READ_CALENDAR

  • Lists of Standard Function Modules to Download data into Excellsheet format

    Dear Guru,
    i want to know what are the Lists of Standard Function Modules to Upload data in to Excellsheet format other than WS_DOWNLOAD or GUI_DOWNLOAD.
    Thanks & regards
    SAifur Rahaman

    Hi,
    Check this out,
    Download & upload of an excel file

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

Maybe you are looking for

  • Need power schematics for a 20" cinema display a1038 (four pronged cord)

    need power schematics for a 20" cinema display a1038 missing the power adapter for the cinema display,need to know what the leads are for the power cord. There is a Edison power cord that plugs into a little square box, then a 4 pronged cord plugs in

  • Mac freeze during the night sleep.

    After system upgrade from 10.9.5 to 10.10 frequently I encontering computer lock with blank screen after resume from sleeping in the morning. Everyday I leave computer to sleep with all my apps open (Oracle Virtual Box 4.3.18 ,Java IDE, Finder , Mozi

  • Forwarding just stopped working

    I have ports 80 and 443 forwarded through my Actiontec router. Until last week, everything worked fine. Suddenly, port 80 stopped sending traffic to the host that I have configured but 443 still works without a problem. Both ports are forwarded to th

  • Adobe PDF Pack UPDATE

    Hi, My name is Mateus and I speak from Brazil. I just bought my signature of the Adobe PDF Pack. Today I tried to used and received a message saying that I couldn't, I have to UPDATE and pay another $89 for it. Doing it I would receive my money back

  • IPhoto 05 Files are Self-Corrupting

    My oldest iPhoto files have become corrupted. These are files that I imported in 2004. (I later upgraded to iPhoto '05.) I can see the thumbnails but when I try to open a picture I get white space where the picture should be and, of course, the endle