Routine to convert the date into month/year

Hi friends,
I have requirement like I have 0billdate, but i want only month and year in that.  So i have created a z object  for that taking reference as 0calmonth.  I think the format is yyyymm.
So now I want to write a routine which converts the date to month/year.  If anybody know this please let me know.
Regards
San Reddy

Hi
in the trnasfer rule or in the update rule select the Zinfo object to which you need to do conversion
in details select formula and create.
Select all functions and follow the steps below.
use the conversion function DATE_MONTH( )
Short Text
Function: Date -> Month
Functionality
Calculates the month from a specified date.
Requirements
The date must appear in the format yyyymmdd.
Parameters
DATE_MONTH (date)
Result
The result is calculated in the format yyyymm.
Regards
RaM

Similar Messages

  • Convert the date into user default date formate

    I am wrinting a bdc and i want to convert the date into user default date farmate ..please suggust the functiom module should i use...

    actually by using dats or d type you can get the user specific date itself.
    but if u have different dates format that need to be converted to the user specific date then you can follow below procedure
    1. retrieve the user format from usr01
        SELECT SINGLE datfm
          INTO w_datfm
          FROM usr01
         WHERE bname EQ sy-uname.
    pass w_datfm to the below FM (4th import parameter)
    2. create Z - FM and retrieve the user secific date
    FUNCTION ZFXX_USER_SPECIFIC_DATE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IW_DAY) TYPE  CHAR2
    *"     VALUE(IW_MONTH) TYPE  CHAR2
    *"     VALUE(IW_YEAR) TYPE  CHAR4
    *"     VALUE(IW_DATFM) TYPE  USR01-DATFM
    *"  EXPORTING
    *"     VALUE(EW_USER_DATE) TYPE  CHAR0008
    *1  DD.MM.YYYY
    *2  MM/DD/YYYY
    *3  MM-DD-YYYY
    *4  YYYY.MM.DD
    *5  YYYY/MM/DD
    *6  YYYY-MM-DD
    CASE iw_datfm.
      when '1'.
        concatenate iw_day iw_month iw_year
               into ew_user_date.
      when '2'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '3'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '4'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '5'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '6'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when others.
        clear ew_user_date.
    endcase.
    ENDFUNCTION.

  • Convert the 0CALQUARTER into previous year same quarter

    Hi All,
    How to conver the 0CALQURTER to Previous year same quarter in User exit (CMOD).
    Please give a sample code.
    Thanks

    Hi Chakri,
    The Sample code is:
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    Data: v_loc_year(4) TYPE n.
    Data: v_pre_year(4) TYPE n.
    Data: v_month(2) TYPE c.
    CASE I_VNAM.
    to calculate "Year to Last month" from fiscal year/period with user entry
      WHEN 'ZCAL_QUAR'.
        IF I_STEP = 2. "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
        WHERE VNAM = 'ZCAL_QUAR1'.
            CLEAR L_S_RANGE.
            v_month = LOC_VAR_RANGE-LOW+4(2).
            v_loc_year = LOC_VAR_RANGE-LOW+0(4).
            v_pre_year = v_loc_year - 1.
           CONCATENATE v_pre_year v_month INTO result.
          ENDLOOP.
        ENDIF.
    ENDCASE.
    **ZCAL_QUAR is your User Exit Variable, ZCAL_QUAR1 is your normal selection variable where user enter the value.
    Hope this helps.
    Let me know if it doesnt work.
    Regards,
    Ravi Kanth
    Edited by: Ravi kanth on Apr 27, 2009 10:08 AM

  • Calander Date format(month year)

    Hi All,
      I am using the Date format (month year, 'January 2009') to  QaaWs as a input. But when i go into Xcelsius calendar i am trying to give the same format but its not taking  as same as mentioned above( I customize the cell in xcelsius spread sheet as month year). Is there any thing to change?
    Please help me.
    Thanks in advance.
    Muvva

    The month in words datatype is FCLTX.
    If you have the date field, you can convert to your required format.
    data : out_date(20) type c.
    DATA : ws_fcmnr TYPE fcmnr,
           ws_month TYPE fcltx.
    parameter   date like sy-datum.
    ws_fcmnr = date+4(2).
    SELECT SINGLE ltx
    INTO ws_month
    FROM t247
    WHERE mnr = ws_fcmnr
    and spras = 'EN'.
    concatenate ws_month date6(2) date0(4) into out_date separated by space.
    write out_date.
    Thanks,
    Susmitha
    Dont forget to reward points for useful answers.

  • How to convert the data decoded by MJPEG Decoder MFT into RGB32

    I try to play .avi file(Motion JPEG) with MJPEG Decoder MFT and
    My ColorConverter MFT to convert into RGB32 by using the Media Foundation.
    The output format of MJPEG Decoder MFT is YUY2.
    So, I implemented My ColorConverter MFT to convert YUY2 into RGB32.
    I set the  topology to play .avi file and  to convert into RGB32.
    But I got a MEError event with ME_ARITHMETIC_OVERFLOW in
    IMFMediaEvent->GetStatus(&hrStatus)); after the event MESessionTopologyStatus.
    So,the file isn't started to play.
    The created topology is follow.
      Source-> MJPEG Decoder MFT -> My ColorConverter MFT -> EVR
               Format:                    YUY2                                         
    RGB32
    Why do the error occur in processing to convert the data decoded by MJPEG Decoder MFT
    into RGB32?
    Please tell me a appropriate way to convert the data decoded by MJPEG Decoder MFT
    into RGB32.

    You've got the High Speed Data Reader.vi as a starting point. That will retrieve the binary data and plot it on a chart. From the array of sgl's created, you could then use the Write to Spreadsheet File.vi to create a comma or tab separated file. The other option is to write the data straight to Excel using ActiveX. There's a shipping example that shows how that's done as well.

  • When I look up the creation date for files on my Macbook I get the date and month in brackets, but not the year.  Why is this and how can I look up the year?

    When I look up the creation date for files on my Macbook (using "get info", or the information window in Iphoto) I get the date and month in brackets, but not the year.  Why is this and how can I look up the year? 

    Does the Date Modified column in a window set to List view show the date correctly, or does it also display it incorrectly?
    To add additional columns to a Finder (folder) window, with that window open and active open the View Options for it. You can do that by pressing Command-J or by selecting View Options from the View menu in the main menubar.

  • Date into month

    Hi All,
    I calculated  opening stock,closing stock based on the date,now I need to calculate based on month also,
    Is any functionmodule is there to convert date into month.
    Thanks@regds,
    Sree.

    hi
    list of FM try
    A
    CALCULATE_DATE : Calculates the future date based on the input .
    v  DATE_TO_DAY : Returns the Day for the entered date.
    v  DATE_COMPUTE_DAY : Returns weekday for a date
    v  DATE_GET_WEEK : Returns week for a date
    v  RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    v  DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
    v  MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    v  END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    v  HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    v  FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    v  MONTH_NAMES_GET : Get the names of the month
    hope this willl solv ut problem
    Amit

  • Convert the date

    Hi Experts,
            Is there any FM to Convert the date from 04/01/2009 to 4/1/2009?
    i want to remove the zero before the date and month.
    Regards.

    Hi,
    Test the following Sample Code it will solve out your problem,
    PARAMETERS: date like sy-datum.
    data: day(2),
          month(2),
          year(4),
          cdate(10).
    day = date+6(2).
    month = date+4(2).
    year = date+0(4).
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input         = day
    IMPORTING
       OUTPUT        = day
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input         = month
    IMPORTING
       OUTPUT        = month
    CONCATENATE: day '/' month '/' year into cdate.
    WRITE: cdate.
    Best Regards,
    Faisal

  • ABAP code in update rules to convert the date

    Hi,
    Could any one send me the ABAP code that is written in the update rules to convert the date (DD/MM/YYYY  -- lenght 10) to YYYYMMDD ---  length 8  format.
    Also please let me know where I should write this code; while creating update rules or while creating infosource.
    Thanks,

    Hi Bharath,
    Hi Bharath,
    I suggest you do the conversion of dates in the transfer rules. Here is the correct code you need:
    * Assuming the source data field is called MYDATE
    * Place the ff. in the routine in the transfer rules:
    concatenate tran_structure-mydate+6(4) tran_structure-mydate+3(2) tran_structure-mydate(2) into result.
    replace MYDATE with the name of the source field (10 chars) in the transfer structure. Hope this helps.

  • I need a formula to convert a date into an integer (for use in Lookout)

    I have a DATA logger with the following:
    40001 = 4 (2004)
    40002 = 2 (February)
    40003 = 5 (5th)
    40004 = 13 (1:00pm)
    40005 = 12 (12 minutes)
    Lookout requires a date that it understands (eg. January 1, 1900).
    All I need is a basic formula to convert the date and time.
    This formula does not need to be specifically written for Lookout. Just a basic formula that I can do on paper or a calculator.
    I can integrate that formula into the Lookout software myself.

    Hello Smigman,
    First of all, I apologize in advance for not giving you "just the formula." And for the lengthy explanation (had to wait till after work hours), which you are very likely aware of already. I am writing this response in much detail so that it may benefit others.. hopefully And so that we understand the underlying principle involved, which will hopefully help us in building the formula the best way that suits us.
    As you have figured out, the data and time in Lookout is represented as a real number. This real number's integer portion represents days, and the decimal portion denotes time. The integer portion is basically the number of days since 01/01/1900. And the decimal portion is the number of seconds since midnight.
    So, for instance, if you insert the today() Expression in Lookout, you'll get a integer 38022 (which corresponds to today, Feb. 5th, 2004). In other words, today is the 38022nd day since 01/01/1900. Tomorrow, Feb. 6th 2004, will be 38023 and so on.
    The decimal part denotes time. A day has 24*60*60 = 86400 seconds, obviously. So, 1/86400 = 1.15741E-5 roughly represents one second. For instance, 38022.00001157 will give 02/05/2004 00:00:01.
    Coming to the formula now, for Time, first convert it to total seconds from midnight. E.g., 5:15:07pm would be (17*60*60) + (15*60) + 7 = 62107 seconds total since midnight. To get the Lookout's decimal part, divide this by 86400.
    62107/86400 = 0.71883102
    Therefore, 38022.71883102 would now give 02/05/2004 17:15:07. Computing Time is relatively easy.
    For the Date -- which is more complicated-- you could keep track of the total number of days either from 01/01/1900, or better still, a more recent day, like say 12/31/2003, which corresponds to 37986. To this reference you will keep adding 1 for each additional day to get the number for the current day. Note, you will have to accomodate leap years (Feb. 29th of this year, for instance).
    It's very helpful to have the reference day as the last day of the past year. That can be derived by counting the number of days since 01/01/1900 as follows:
    104 years * 365 days = 37960;
    + 1 day for each leap year
    A leap year is a year divisible by 4 (and 400 if the year ends with two zeros). There were 26 leap years from 1900 till 2003.
    So, 37960 + 26 = 37986. 12/31/2003 is thus represented by 37986.
    To get the integer for the Current Date we would first find what day of the year it is. Then add it to the reference day. Feb 5th, is the 36th day of the year. Adding this to 37986, gets us 38022.
    In your case you will have to come up with the correct day of the year using registers 40002 and 40003. Not sure if this helped or confused you more.
    I tried
    Khalid

  • Report for converting the documents into the PDF format.

    Hello Experts,
    I need to know if any report/ T-code is available in SAP to convert the files into  PDF format.
    We are processsong these PDF's then into IXOS system.
    Regards,
    Anna.

    Hello ,
    You may check with the below programs:
    Program name                   Report title
    RSTXCPDF                       Routines for Converting OTF Format to PDF Format
    RSTXPDF2                       Administration/Upload of type 1 and TrueType font files
    RSTXPDF3                       Customizing for OTF-PDF Conversion
    RSTXPDF4                       Help Report from CONVERT_OTFSPOOLJOB_2_PDF
    RSTXPDF5                       Help Report from CONVERT_ABAPSPOOLJOB_2_PDF
    RSTXPDFT                       Test report for PDF conversion - converting standard texts to PDF
    RSTXPDFT2
    RSTXPDFT3                      Test
    RSTXPDFT4                      Convert SAPscript (OTF) or ABAP Lists Spool Job by PDF
    RSTXPDFT5                      Test: GUI Download of Spool Request
    Regards
    Ramesh Ch

  • How can i convert the date from M to MM ?

    Dear Guru ,
    I need to upload my list to SAP table , and in the list , we are using YYYY/M/D format ( Eg. 2010/5/20 , 2010/10/1 ) .
    And now i want to convert all date format to YYYY/MM/DD , Is it possibile to do that ?
    Here is my code , but it doesn't work . It returned "2009//3//5" format .
    data: ld_date_int type datum.
    data : test(10) type c.
    test = '2009/3/5' .
    ld_date_int = test .
    WRITE : SY-SUBRC , LD_DATE_int .
    Does SAP provide a standard function can convert the date format ?
    Thanks .
    Best Regards,
    Carlos Zhang

    Hi Dear
    You can try in this way :::
    data: ld_date_int type string.
    DATA : ld_string TYPE string.
    data : test(10) type c,
           ld_res1(4) TYPE c,
           ld_res2(2) TYPE c,
           ld_res3(2) TYPE c.
    DATA : ll_res2 TYPE i,
           ll_res3 TYPE i.
    test = '2009/03/5' .
    ld_date_int = test .
    ld_string = strlen( ld_date_int ).
    CASE ld_string.
      WHEN 10.
       WRITE : SY-SUBRC , LD_DATE_int.
      WHEN OTHERS.
        SPLIT ld_date_int at '/' INTO ld_res1 ld_res2 ld_res3 in CHARACTER MODE.
        ll_res2 = strlen( ld_res2 ).
        ll_res3 = strlen( ld_res3 ).
        IF NOT ll_res2 eq 2 and not ll_res3 eq 2.
          CONCATENATE: '0' ld_res2 INTO ld_res2.
          CONCATENATE: '0' ld_res3 INTO ld_res3.
          CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
          WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
        IF ll_res2 eq 2 and not ll_res3 eq 2.
          CONCATENATE '0' ld_res3 INTO ld_res3.
          CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
          WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
        IF NOT ll_res2 eq 2 and ll_res3 eq 2.
           CONCATENATE: '0' ld_res2 INTO ld_res2.
            CONCATENATE ld_res1 '/' ld_res2 '/' ld_res3 INTO ld_date_int.
             WRITE : SY-SUBRC , LD_DATE_int.
        ENDIF.
    ENDCASE.

  • How to create a procedure in oracle to write the data into file

    Hi All,
    I am just wondered on how to create a procedure which will do following tasks:
    1. Concat the field names
    2. Union all the particular fields
    3. Convert the date field into IST
    4. Prepare the statement
    5. write the data into a file
    Basically what I am trying to achieve is to convert one mysql proc to oracle. MySQL Proc is as follows:
    DELIMITER $$
    USE `jioworld`$$
    DROP PROCEDURE IF EXISTS `usersReport`$$
    CREATE DEFINER=`root`@`%` PROCEDURE `usersReport`(IN pathFile VARCHAR(255),IN startDate TIMESTAMP,IN endDate TIMESTAMP )
    BEGIN
    SET @a= CONCAT("(SELECT 'User ID','Account ID','Gender','Birthdate','Account Registered On') UNION ALL (SELECT IFNULL(a.riluid,''),IFNULL(a.rilaccountid,''),IFNULL(a.gender,''),IFNULL(a.birthdate,''),IFNULL(CONVERT_TZ(a.creationDate,'+0:00','+5:30'),'') INTO OUTFILE '",pathFile,"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' FROM account_ a where a.creationDate>='",startDate,"' and a.creationdate <='",endDate,"')");
    PREPARE stmt FROM @a;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt ;
    END$$
    DELIMITER ;
    Regards,
    Vishal G

    1. Concat the field names
    Double Pipe (||) is the concatenation operator in Oracle. There is also a function CONCAT for this purpose
    2. Union all the particular fields
    Not sure what do you mean by UNION ALL particular fields? UNION ALL is a set operation applied on two different result sets that have the same projection.
    3. Convert the date field into IST
    SQL> select systimestamp "Default Time"
      2       , systimestamp at time zone 'Asia/Calcutta' "IST Time"
      3    from dual;
    Default Time                                       IST Time
    05-05-15 03:14:52.346099 AM -04:00                 05-05-15 12:44:52.346099 PM ASIA/CALCUTTA
    4. Prepare the statement
    What do you mean by prepare the statement?
    5. write the data into a file
    You can use the API UTL_FILE to write to a file.

  • How to convert the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:M'

    How can i convert a the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:MI:SS AM' in Oracle
    I have a query
    select UPPER(t.val_10) "TYPE", count(val_3) "Number of Transfers"
    from table1 t
    where t.is_active = 1
    and t.val_4 = 'INBOUND'
    and to_date(to_date(val_5,'MM/DD/YYYY HH:MI:SS AM'), 'DD/MM/YY') between to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY') and add_months(to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY'),1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)
    I get the error [ORA-01861: literal does not match format string which i think is because
    val_5 has the values in the following format:
    8/29/2008 6:31:10 PM
    Does anyone have an answer?
    Thanks in advance
    Edited by: user2360027 on 26-Mar-2009 03:50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    first off, you've got to_date(to_date(...)) - NEVER do this - you're forcing an implicit to_char which can cause all sorts of problems!
    What is the data type of your column val_5? If it's DATE then your query is simply:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    val_5 between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)If it's a varchar2 (why, oh why, oh why, ...?!), then your query should be:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    to_date(val_5, 'mm/dd/yyyy hh:mi:ss AM') between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)Remember that dates in DATE format are stored in an internal Oracle format - in order for you to tell Oracle that your string is a date, you need to use to_date. When you want to retrieve a date, you need to use to_char to put it into the format you want to see it in.
    Remember also that your nls_date_format defines the default format that you'll see a date, which is what is used in the implicit conversion that oracle does when you select a date:
    SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    26/03/2009 11:01:53
    1 row selected.
    SQL> alter session set nls_date_format='mm/dd/yy hh12:mi:ss AM';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    03/26/09 11:02:24 AM
    1 row selected.It doesn't make sense to convert something that's already in a DATE format into a DATE format - in order to do that, oracle has to first change the date into a string, and it does that by using the nls_date_format parameter setting - if you're working with dates-in-strings that are in a different format, then all sorts of problems arise, as you have found out!

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

Maybe you are looking for

  • JTree and selected node question

    Hello Is it possible to convert the selected node to an int? I guess I'm looking for something llike this. int nodeNumber = node.getSelectedIndex(); There is nothing like that in the API, and it would help greatly if I could find a way do this. Thank

  • Exch2010: User mailbox changed to Shared Mailbox

    [apologies for posting in the Exch 2013 section - the drop down did not show legacy exchange forum categories!] I recently migrated from Exchange 2003 to 2010. Mailboxes were moved and showing in EMC as 'User Mailbox'. All good.  Now, two weeks later

  • SAPScript 4.6 - Include image on one page

    Hello, I need help with a custom SAPScript form I recently created.  I would like to include an image (employee photo) on the first page of my form, but it continues to show on every page.  I've read multiple forums on this site, but nothing seems to

  • License type: Limited Financial User

    Has anybody successfully applied for and received license keys for the new license type 'Limited Financial User'? I've tried twice and I keep getting back Pro Users instead, along with a scolding that I am exceding my contractual licenses.

  • Connecting Case Microphone/Headphone Jacks To The Sound Blas

    I just got a new computer with a Foxconn TLA-776 case that has microphone/headphone jacks on the front. There are 7 seperate plugs that come from these jacks. Ground, Right Out, Right Return, Left Out, Left Return, Mic Power, and Mic In. I tried plug