Any F.Module is there to get  'Month and day '  from the given input number

Hi experts,
    I am working on Inventory withdrawl report and in the selection screen, If i enter the CHARG (Batch number) then  I need to display the posting date by default in the next selection input based on the Batch number.
In the selection screen :
Batch : 7111WF0211.
Posting Date :  (I need to display by default based on batch number).
My requirement is,  in the above Batch first digit '7' is the year.
And  from 2nd to 4th digit. i.e., 111. I need to find out month and day from 111.
I mean from  1 to 365 days, In which day and which month '111' will come ?
Please send me the code or suitable Function Module. Your help will be appreciated.
Thanks,
Ranji.

Use FM ADD_TIME_TO_DATE
Do this
days = batch+1(3).
days = days - 1.
Call Function 'ADD_TIME_TO_DATE'
exporting
i_idate = '01.01.2008'
i_time = days
i_iprkz = 'D'
importing
o_idate = date_p_d
You will get the date in date_p_d.
But what about Leap years? IS the first number the year?
IF so pass in i_idate the first of january of that year so you get the correct day depending if it is a leap year or not
Edited by: Ramiro Escamilla on Feb 26, 2008 9:56 PM

Similar Messages

  • Get month and year from date type

    Hi all,
    I need to get the month and year from the date type.
    For example select to_date('2011-01-17', 'yyyy-mm-dd') from dual;Result needed:
    01-2011Any ideas?
    thanks in advance,
    Bahchevanov.

    Hello Bahchevanov,
    if you need the date to compute something, then you can
    TRUNC(SYSDATE,'mm')This will give you a date with the days removed -> 01.01.2011
    Regards
    Marcus

  • Subtract   two dates to get   months and days

    I havew to subtract two dates and get the differnce ,
              Date issuedDate= myobj.getIssueDate();
              Date expirationDate=DateUtils.addMonths(issuedDate, 6);
              long timeDiff=expirationDate.getTime()-new Date().getTime();
              long daysRemaning=timeDiff/86400000;this is code I get the number of days between the issue date and todays date.now my client wants not just days but months and days , i need suggestions on how to get days and months between any two given dates

    I have read that it is best to use java.util.Calendar for almost any time related issue.
    With some switch statements and a for loop, I think the Calendar class could solve the problem.

  • Get Months and Days -- Problem with months_between

    Hi,
    For a report, I need to convert days as months and days for eg 370 days as 12 months 5 days.
    I tried below query
    with t as (
    select
    maturity_date - value_date tenor
    from account_master)
    select
    trunc(mod(months_between(trunc(sysdate,'YYYY')+ tenor,trunc(sysdate,'YYYY')),30)) month,
    (trunc(sysdate,'YYYY')+tenor)-add_months(trunc(sysdate,'YYYY'),trunc(months_between(trunc(sysdate,'YYYY')+ tenor,trunc(sysdate,'YYYY')))) "day"
    from t
    And i am getting output as
    MONTH day
    11 30
    23 30
    11 30
    1 5
    11 30
    11 30
    11 30
    0 6
    11 30
    for Number of days
    TENOR
    365
    730
    365
    36
    365
    365
    365
    6
    365
    As you can see for 365 days i am getting Months as 11 and days as 30
    and for 730 days i am getting months as 23 and days as 30.
    I want 365 days as 12 months and 0 days.
    I think it is months_between function that is creating this problem.
    Can anyone suggest another way of accomplishing this?
    Thanks and Regards
    Amit Trivedi

    2008 is a leap year! so it's 366 days long. therefore, 365 days is really only 11 months and 30 days (if you start counting from Jan 01, which is what you are doing).
    so the number of months and days between is dependent on the starting date (consider a range of 30 days starting on Jan 01, Feb 01 (leap year), Feb 01 (non-leap year) and Apr 01).
    so:
    with t as (
    select maturity_date - value_date tenor, value_date d1 from account_master
    select
    trunc(months_between(d1+ tenor,d1)) months,
    d1+tenor - add_months(d1,trunc(months_between(d1+ tenor,d1),30)) days
    from t
    or better yet:
    select
    trunc(months_between(maturity_date,value_date)) months,
    maturity_date - add_months(value_date,trunc(months_between(maturity_date,value_Date))) days
    from account_master
    /

  • Getting Tag and value from the selected Xml element value

    Hi All,
    I have an xml file which i import to the Indesign CS3 .From the structure view , i drag and drop the root node on to the page. Now i select an xml value from the page. Now i need to get the element tag and value from the selected value.
    For example
    File Name : sample1.xml
    <Root>
    <employeeName> A</employeeName>
    <employeeEmail>[email protected]</employeeEmail>
    </Root>
    Now i import this sample.xml in my indesign CS3 and from the structure view i drag the Root  tag and drop it on the page.Now the values of the element tag are displayed.
    Now i select "[email protected]" from the page and i have a menu "Get Selected XML" on clicking which  i should get element tag with value.(i.e <employeeEmail>[email protected]</employeeEmail>)
    How to go about it.?
    Thanks
    Sakthi

    Hi Steve,
    If you haven't already done so, I recommend posting this question in the LivCycle Forms forum.
    Jared

  • Function module for getting month and year of the previous month (say -6)

    Hi,
    Is there a function module that will get you the month and year of say, a month before, and as far as 11 months ago.
    For example, say today is 6/2007. I want 7 months ago.
    How do i get this value?
    What function module or method is available?
    Points will be rewarded and responses will be appreciated.
    Thank You,
    John

    Hi
    lv_period gives the month and year which is two months earlier now as we have specified lv_months as -2.
        DATA: LV_PERIOD LIKE S001-SPMON,
              LV_MONTHS(2) TYPE C VALUE '2-',
              LV_DATUM LIKE SY-DATUM,
              LV_NEWDT LIKE SY-DATUM,
            P_SPMON LIKE S001-SPMON VALUE '200601'.
        CONCATENATE P_SPMON '01' INTO LV_DATUM.
        LV_PERIOD = P_SPMON+0(6).
        CALL FUNCTION 'MONTH_PLUS_DETERMINE'
             EXPORTING
                  MONTHS  = LV_MONTHS
                  OLDDATE = LV_DATUM
            IMPORTING
                 NEWDATE = LV_NEWDT
             EXCEPTIONS
                  OTHERS  = 1.
         IF SY-SUBRC = 0.
           LV_PERIOD = LV_NEWDT+0(6).
         ENDIF.
    WRITE :/ LV_PERIOD.
    OR
    Use the following FM for getting the year and the month based on date
    CACS_DATE_GET_YEAR_MONTH
    or
    Call Function 'CCM_GO_BACK_MONTHS '.
    Funny module: 03/31/2002 - 1 month = 02/31/2002
    OR
    RE_ADD_MONTH_TO_DATE ( Add / substract month to/from date )
    Need ur reward points.
    Best regards,
    Ravi

  • Get Nexr working day for the given calendar id

    Hello,
    My requirenment is I have a  date.If that date falls on friday then I have to get the next working day date i.e.Monday for the given Calender iD

    DATA:wk_dat TYPE scal-indicator.
    PARAMETERS:pa_dat TYPE sy-datum.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
      EXPORTING
        date = pa_dat
      IMPORTING
        day  = wk_dat.
    CHECK wk_dat = 5.
    pa_dat = pa_dat + 3.
    WRITE pa_dat.
    here if u want to get the next working day
    Use FM DATE_CHECK_WORKINGDAY after the check statement.
    add the date until u find a working day.

  • IPhone has WEIRD letters for the months and days of the year !

    Hi !
    One morning I woke up to find that the DAYS and MONTHS of my year are in WEIRD letters ! Here is an image to clarify my problem:
    http://sphotos-g.ak.fbcdn.net/hphotos-ak-ash4/480863_10200219386720818_166986027 2_n.jpg
    Oh, I understand that I'm using the iStudiez app to demonstrate the problem, but the flaw applies all over my phone.
    Thank you all in advance for your time and help !
    -eXtremity.

    Thank you SO MUCH !!! I can not begin to explain how annoying it is trying to figure out when my classes begin with these weird letters. Problem has been solved. You good sir are a legend. Thanks again !

  • Difference between 2 dates in form of years,months and days.

    Hi friends,
      i need one function module for finding difference between 2 dates and the output is
    no. of years
    no.of months
    no. of days.
    it means the input is begin date and end date
    output is no.of years,no.of months and no.of days.
    for example begin date is today i.e., 08/02/2008 (dd/mm/yyyy) and end date is 07/03/2008 then the output is
    no.of years -
      0,
    no.of months----
      1,
    no.of days----
      0.
    and one more example if begin date 08/02/2008
    (dd/mm/yyyy) and end date is 01/02/2008 then the output is
    no.of years -
    0,
    no.of months----
      0,
    no.of days----
    -7..
    Please help me it's very urgent

    Hi,
    Use FM HR_AUPBS_MONTH_DAY.
    It Calculate the years, months, days & cal days between 2 dates.
    Hi,
    The FM is 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    Check the following example:
    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.
    Also You can write your own function module for this..
    just extract day and month and year from the two dates and then get the difference.
    suppose date 1 - y1m1d1
    date 2 = y2m2d2
    data : y1(2) type n,
    m1(2) type n,
    d1(2) type n,
    y2(2) type n,
    m2(2) type n,
    d2(2) type n,
    y1 = date1(4).
    m1 = date1+4(2).
    d1 = date1+6(2).
    y2 = date2(4).
    m2 = date2+4(2).
    d2 = date2+6(2).
    then get the differnce between years and days and months and store them in ur variables
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • If you decide to move up to an iPad with greater storage, is there a way to transfer all of your apps and information from the old to the new.

    If you decide to move up to an iPad with greater storage, is there any way to transfer all of your apps and information from the old to the new.

    Transferring from old to new
    http://support.apple.com/kb/HT2109

  • Any function module or bapi to get sales order number and invoice number?

    hi all,
    with delivery order number provided, do we have any function module or bapi to get sales order number
    and invoice number?
    thanks.

    Hi,
    Check
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_REMUREQSLISTA_CREATEMULT  Agency Business: BAPI Create Invoice Lists from Vendor Billing Documents
    BAPI_REMUREQSLISTB_CREATEMULT  Agency Business: BAPI Create Invoice Lists from Payment Documents
    BAPI_REMUREQSLISTC_CREATEMULT  Agency Business: BAPI Create Invoice Lists from Posting Lists
    BAPI_REMUREQSLIST_CHANGEMULT   Agency Business: Change Invoice List Documents BAPI
    BAPI_REMUREQSLIST_GETLIST      Agency Business: BAPI Determine Detailed Data for Invoice List Documents
    BAPI_REMUREQSLIST_RELEASE      Agency Business: BAPI Release Invoice List Documents to FI
    Edited by: Neenu Jose on Nov 26, 2008 8:53 AM

  • After installinf ios6 I lost all contacts, I could not get them back so I hit restore. This restored the phone to 4 months back. The phone did not give me the option to restore from the cloud. is there anyway I can now restore from the cloud?

    How many backups are in the cloud? When I installed ios6 it backed up to the cloud, since then I restored the phone trying to regain my contacts. At this point the used the last backup I performed on the computer 5 months ago. I never had the oppertunity to restore from the cloud. Is there anyway I can now restoe from the cloud and would it have the backup that was performed when I installed ios6?

    http://support.apple.com/kb/HT1766?viewlocale=en_US&locale=en_US
    Go to Settings>General>Reset and tap Erase All Content and Settings.  This will erase your phone.  Then you will go through the setup screens again as you did when your phone is new, and when given the option, select Restore from iCloud Backup.

  • FM to get start and end date when given month

    Hi all,
       can anybody help me if there a FM to get start and end date when given month like 01 for jan.
    Thanks in advance
    Sahitya

    Hi,
    Check this Function Module
    HR_JP_MONTH_BEGIN_END_DATE
    here if you r giving the month u wil get the start date and the end date.
    Hope this helps you.
    Thanks & regards,
    Y.R.Prem Kumar

  • Provide steps to send Root CA certificate to the Lync client, getting error" There was a problem verifying certificate from the server"

    Hi,
      I Build an Lync 2013 set up with FEpool, Director pool and Exchange server is integrated. I have windows 8 client machine, with Lync client installed. When I try to login to the lync client, I am getting error like"There was a problem verifying
    certificate from the server".
    When I installed ROOT CA cert  manually on client machine I am able to login to the lync client. similarly if I add my client machine in my domain, I am able to login to the Lync client.
    Now is there any other way to send the certificate automatically to the client machine (Which are NOT part of the DOMAIN) from the server, instead of manual installation process.
    Please help me troubleshoot this problem

    Agree with S Guna, there is no easy way to push a certificate automatically to a client that you don't control other than building an installer package and asking them to run it.  In this situation, if there are a lot of non-domain joined machines
    a third party certificate is the way you need to go.
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications

  • My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    Do you have a backup of your iPhone which contains these messages?
    If so, you can restore a new iPhone from that backup during setup.
    If not, the messages are gone.

Maybe you are looking for