Convert CRMT_ALV_DATES_UI-DURATION to duration in months

Hi Folks,
Can you please help me in finding class/Function module which can be used to convert time duration from any unit type to months?
This is with reference to the unit types maintain for date profiles.
Value can be of following Unit types,
Day
Hour
Minute
Month
Quarter
Second
Week
Year
This value has to be converted to value in months.
Please let us know if you find such modules.
Thanks and Regards,
Amit

Hi Amit,
You can use this class CL_TIMEUNITCALC_MONTH to do month calaculation.
Reward points if helpful.
Regards
Siddhartha Sengupta

Similar Messages

  • Find the Duration in Months between the contents in an Iterator

        Iterator<String> termIncomeKeys = termIncome.keySet().iterator();
        while(termIncomeKeys.hasNext()){
            String month = termIncomeKeys.next();
            System.out.println(month);
        } The above code is printing month as
    Jan(2012) - Jan(2012)
    Feb(2012) - Mar(2012)
    Apr(2012) - May(2012)
    Jun(2012) - Jun(2012)
    Jul(2012) - Oct(2012)What I want to achieve is I want to print the duration in terms of months between each of the entries. That is, Duration between first entry is 1 month, duration between second is 2 and so on.

    What you print is a string. You can't do calculations on a string. You have first to disassemble the string into parts and interpret what each part contains. There is nothing out of the box in java to do this. On the other side it's not too difficult to do it yourself.
    Timo

  • How to count the duration by month

    Hi,
    Here in BI reporting im facing the problem . the senario is like this .
    i have to count the duration in time for a perticular period .
    for example from may26-aug 20 then how can i count the duration between those in reporting . please help me as soon as possible .
    thanks
    stephen

    Create two formula variables type replacement path on these two dates say zdate1 and zdate2 and in formula or CKF do zdate2 - zdate1.
    Hope this helps.
    Edited by: Praveen G on Oct 21, 2008 1:09 AM

  • How to convert date dd.mm.yyyy TO Month ddth YYYY?

    hi friends,
    how to convert date into this format.
    ex:
    date : 04.11.2008
    has to convert as
    October 04th, 2008
    th has to be set SUPERSCRIPT.
    Plz any helps....
    Regards,
    Shankar.

    check this..FM
    CONVERT_DATE_TO_EXTERNAL
    or we can do this using split or concatenate functions like below
    *CALCULATING THE MONTH FOR THE BODY OF THE EMAIL MSG
      IF GD_EBODY_BB = '01' .
        GD_EBODY_BB = 'January' .
      ELSEIF GD_EBODY_BB = '02' .
        GD_EBODY_BB = 'February' .
      ELSEIF GD_EBODY_BB = '03' .
        GD_EBODY_BB = 'March' .
      ELSEIF GD_EBODY_BB = '04' .
        GD_EBODY_BB = 'April' .
      ELSEIF GD_EBODY_BB = '05' .
        GD_EBODY_BB = 'May' .
      ELSEIF GD_EBODY_BB = '06' .
        GD_EBODY_BB = 'June' .
      ELSEIF GD_EBODY_BB = '07' .
        GD_EBODY_BB = 'July' .
      ELSEIF GD_EBODY_BB = '08' .
        GD_EBODY_BB = 'August' .
      ELSEIF GD_EBODY_BB = '09' .
        GD_EBODY_BB = 'September' .
      ELSEIF GD_EBODY_BB = '10' .
        GD_EBODY_BB = 'October' .
      ELSEIF GD_EBODY_BB = '11' .
        GD_EBODY_BB = 'November' .
      ELSEIF GD_EBODY_BB = '12' .
        GD_EBODY_BB = 'December' .
      ENDIF .
    *ATTACHMENT SUBJECT LINE MODIFICATION
      IF GD_EBODY_CC = '01'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '02' .
        CONCATENATE GD_EBODY_CC 'nd' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '03' .
        CONCATENATE GD_EBODY_CC 'rd' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '31'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSEIF GD_EBODY_CC = '21'.
        CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
      ELSE .
        CONCATENATE GD_EBODY_CC 'th' INTO GD_EBODY_CC .
      ENDIF .
    regards
    ansumesh
    Edited by: Ansumesh Kumar Samal on Nov 4, 2008 9:02 AM

  • Convert Date (MM/DD/YYYY) to (Month DD, YYYY)

    Hi,
    I am looking for a Function Module that converts MM/DD/YYYY to Month DD, YYYY format. For example, 07/27/2009 is to be converted to July 27, 2009. Is there any standard FM that works for this purpose? Please advice.
    Appreciate Your Help.
    Thanks,
    Kannan.

    Read this.
    https://wiki.sdn.sap.com/wiki/display/Snippets/FUNCTIONMODULEFORCONVERTINGDATEINTOTHEGIVENFORMAT
    Arti

  • Blue triangle says "Duration Units were removed" How to..?

    I used a formula (the formula is  =MAX(K21-8, 0)  if that helps) to calculate OT hours worked from a shift. I wanted it to show 0 if none, and the # of hours over 8 if more than 8 were worked. I needed it to show 0 for the total weekly calculations each week and YTD. This works perfectly fine. But it has a blue triangle in the corner and when I hover over it, it says "Duration units were removed". This is also ok, doesn't cause any problems...yet.
    I am trying to have another box show total regular hours worked that day. There are some days where employee will work 5 hours, or 7 hours, and others will be 10 hours or 12 hours.
    I am using the "IF" formula, trying to say IF(the amount of hours in a particular cell are less than 8, then just copy the same time/number/duration from that particular cell, if not just write 8)
    NONE of the several ways I have tried have worked. I am not very numbers friendly..... Dont understand too much.
    This is what I am using =IF(K21<8, K21, "8") - but I have also tried with=IF(K21=<8, "K21", "8hrs") and just about every combo possible.
    Not only do none of them work, all coming up with a red error, I think I may be able to get them to work if I can 'remove the duration units' like the other cells automatically did.
    HELP?

    Hi pw,
    K21 contains a duration value, from which the formula subtracts a number. Since the number is NOT a duration, and no units are specified for it, Numbers makes an assumption regarding the unit value associate with this number, strips the duration from the value in K21, and presents the result of the subtraction. That result is a number, not a duration, and could be wrong if Numbers made a wrong assumption, hence the warning.
    One way to get rid of the warnng triangle (and to ensure that the subtraction result is what you want it to be) is to convert the duration to the equivalent number of hours:
    =MAX(DUR2HOURS(K21)-8, 0)
    With this conversion, the formula is subtracting a number ( 8 ) from a number ( DUR2HOURS(K21) ), and no warning is generated.
    "I am trying to have another box show total regular hours worked that day."
    You can pull these out of the total using a similar formula to the one above. Any hours worked, to a maximum of 8, is regular time. Anything over 8 is OT. To determine OT hours, you subtracted 8 from total hours, and used the result if it was greater than zero, and zero if that was greater than the (negative) result. Here's the other side of that:
    =MIN(DUR2HOURS(K21),8)
    If the number of hours worked that day ( DUR2HOURS(K21) ) is less than 8, then that's the number of regular hours that day. If it's greater than 8, then the number of regular hours worked is 8.
    Here's a table showing the results for several durations of work day:
    Formulas in C and D as shown above, with B2, etc. replacing K21.
    Regards,
    Barry

  • Cell Calculation that references a Duration formats to duration instead of Currency

    Hi-
    I'm totally new to numbers (converting from Excel).  I have a formula where I'm trying to caluclate the price of something:
    Item Quantity * Item Cost * Duration (number of days)=Price
    The problem I'm having is that the price cell will not format to a currency.  I think this is due to the fact that the Duration cell is just that, a duration, so instead of displaying $200.00, it displays 200d. 
    What am I missing here?
    Thanks
    Matt

    Matt,
    I suggest converting the duration back to a number using the function DUR2DAYS().
    There is a whole family of functions DUR2x() available and listed in the Numbers function reference.  You can open the reference by selecting the menu item "View > Show Function Browser":
    E2=DUR2DAYS(D2)*C2*B2

  • Function module to convert character value of month into numeric value?

    Hi Experts,
                     I need to convert a character value of a month in three alphabets to its numeric value.
    e.g. 'jun' should be converted into '06' and 'jan' into '01' using a function module.Can anybody please provide me a similar function module?
    TIA
    Abhishek

    try this code:
    DATA: text(20) TYPE c,
    date TYPE sy-datum.
    text = '06. Jul 06'.
    TRANSLATE text TO UPPER CASE.
    TRANSLATE text USING '. '.
    CONDENSE text NO-GAPS.
    CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
    EXPORTING
    input = text
    IMPORTING
    output = date.
    WRITE date USING EDIT MASK '__.__.____'.
    Regards,
    Dara.

  • Convert days to months and days?

    Hi,
    I need to take a a numeric value like 280 (which is really the number of days) and convert it to the number of months and days (eg 9 months and 10 days). Is this possible with PowerShell?
    Thanks
    Adam

    $ht = @{Months=$days/30;Days=$days%30}
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    G
              ... rubbishell code ( from #2 ).
    I tested your rubbishell code, and got bad result:
    PS Q:\> $days=299 ; $ht = @{Months=$days/30;Days=$days%30} ; $ht
    Name                           Value                                                                                        
    Days                           29                                                                                           
    Months                         9,96666666666667                                                                             
    Do you really think 9,9666... is an integral number?
    No, it's not.
    If you wanna know the correct values, just look above at my last reply.
    I didn't realize you don't know how to truncate decimal.
    $ht = @{Months=[int](($days/30)-.5);Days=$days%30}
    But you did put together that convoluted mess to get the equivalent of a simple modulo operation, so that probably should have been a clue.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    GREAT!
              ... rubbishell code ( from #2 ).
    I tested your rubbishell code ONCE MORE(!), and got bad result
    ONCE MORE(!):
    PS Q:\> $days=300 ; $ht = @{Months=[int](($days/30)-.5);Days=$days%30} ; $ht
    Name                           Value                                                                                        
    Days                           0                                                                                            
    Months                         10                                                                              
    Do you really think 10 is equal to 11?
    Don't you think the correct answer is 11?
    If you wanna know the correct values, just look above at my last reply.
    Give it up dude, you'd better copy and paste my PowerShell code.  :)
    No, I'm pretty sure 300 days at 30 days/month is 10 months.  
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Converting Date Strings to Months

    I need to know how I can convert a Date String to a Month.
    For example, my Date String is 2/19/09, I need this converted to return February.   I need one formula which will take in account for all months.
    I am currently using the following to convert to a date, but I'm not sure how to then convert this to return a month... January - December.
    CStr({?EndDate},"yyyy-MM-dd")
    Thank you in advance for your assistance.

    Thank you so much, this does give me the month.
    How can I use this to group my report by month and then under it by received date?
    For example...
    February
        2/1/09     Ticket information.....
        2/2/09     Ticket information.....
        2/18/09   Ticket information....
    March
        3/1/09     Ticket information.....
        3/2/09     Ticket information.....
        3/18/09   Ticket information....
    And so on....
    Thanks again in advance.
    Edited by: Gary Timm on Feb 19, 2009 6:02 PM

  • How to convert number field into time

    Hi
    I have made a form for storing of private dialed calls from different extensions. To store call duration i have assigned a number field which is storing following type of data
    1.34
    1.19
    37.29
    1.47
    In above mentioned data decimals are seconds and left side is minutes.
    Now the requirement is that if second is > 30 then 1 minute should be added in minutes else 30 seconds should appear instead of original seconds.
    Please Help!

    >
    To store call duration i have assigned a number field which is storing following type of data
    In above mentioned data decimals are seconds and left side is minutes.
    >
    Please provide info about the form in which you RECEIVE the data. Do you receive the data in MM.SS format like you say you are storing it?
    If not, why are you storing it this way?
    Unless you have some reason to STORE the data differently just store it the way you got it. That way you won't lose any precision and you can manipulate it any way you need to for display purposes.
    If you receive START_TIME and END_TIME then store both of those. Don't calculate and store duration; you will lose END_TIME and if you later need to calculate duration to a different precision you won't be able to.
    Where is the data being stored? Oracle?
    Write a simple function to convert a duration to minutes and seconds using the '>30' rule you have. Then if the rule changes you can write a new function or modify the existing one and the data itself doesn't have to change.

  • How to convert minutes into centiminutes

    In Excell I can use (time)*24 and get the value as centiminutes is there a simular way to do et in Numbers?

    "The data in cell D2 is 7h44m45s and the result is 7.245833 centiminutes
    so I belive it works"
    Assuming the "." is the decimal separator, that result says that a duration of more than seven hours is the same as a duration of approximately seven centiminutes.
    Seven centiminutes is seven hundredths of a minute, which is less than five seconds.
    Let's look at the math on 'paper':
    7 hours = 420 minutes (7x60)
    44 minutes = 44 minutes
    45 seconds = 0.75 minutes
    Total: 464.75 minutes
    which is 46475 centiminutes
    See Row 2.
    The closest I can get to your numerical result is by using =DUR2DAYS(B2)*24, or STRIPDURATION(B2)*24  both of which give the result 7.74583333... (hours). See the yellow filled rows above.
    DUR2DAYS converts a duration value to the equivalent number of days and decimal fraction of days. Multiplying that by 24, the number of hours in a day, gives the number of hours and decimal fraction of hours represented by that value.
    Regards,
    Barry
    PS: must have been in a hurry earlier.
    I notice I said "centiseconds" in my reply to Bressen above—should have been "centiminutes".
    And in my reply to my own earlier message, I said the duration value was in F5, while the formula clearly required it to be in B2.
    My bad!
    B
    EDIT
    PPS:
    I was able to get 7.2458333... after all. That is the correct value for the conversion of 7h 14m 45s to hours.
    B
    Message was edited by: Barry

  • Function module to conver date to last of month

    HI
    I need a function module which can convert date to last of current month. ( RULE 31 from TABLE TVRG )
    please suggest some a fm for the same
    regards
    arora

    Hi Nishant,
    plz check these FM.
    SD_VEDA_CHECK_START_END_DATE
    SD_VEDA_CREATE
    SD_VEDA_DATUM_ERMITTELN
    SD_VEDA_GET_DATA
    SD_VEDA_GET_DATE
    SD_VEDA_GET_DATE_RULE
    Thanks.
    Anurag.

  • Converting a Date format

    Hi All,
    We have a 'Date' field in the report, the format is "10/25/1999 5:23:56 PM"
    we need to convert the field into:
    1. Month Name: Oct
    2. Year: 1999
    3. MonthID: 199910
    This has to be done only on the webcat. Does anybody has the idea how to do the same?
    Regrads,
    Apoorv

    Hi.
    Year:
    YEAR(your_date_column)
    Month Name:
    EVALUATE('to_char(to_date(%1, %2), %3)' as varchar(3), *'10/25/1999 5:23:56 PM'*, 'mm/dd/yyyy hh:mi:ss pm', 'Mon')
    Month Id:
    EVALUATE('to_char(to_date(%1, %2), %3)' as varchar(20), *'10/25/1999 5:23:56 PM'*, 'mm/dd/yyyy hh:mi:ss pm', 'yyyymm')
    instead of *'10/25/1999 5:23:56 PM'* put your date column.
    or
    cast(year(your_date_column) as varchar(4))||cast(month(your_date_column) as varchar(2))
    Regards
    Goran
    http://108obiee.blogspot.com

  • The date on which PR is converted to PO

    Hello SAP Experts,
    I want to create one report in which i can found the PO created in the same month in which PR is created
    OR
    the date on which PR is converted to PO ( edited date)  in the PR table
    regards,
    Anisha

    Hi,
    EBAN table will sovle your issue.
    I want a report in which I can find the no. PR getting converted to PO & no. of PR that is not getting converted to PO in the same month.
    I think there is no such std. report.
    I just want the table with which I can create such report.
    It can't be done only by eban,ekko,ekpo.
    1) You want to find out the PR number which are converted to PO
    2) PR numbers which are not converted to PO in same month.
    use these fields BANFN,BNFPO,BADAT,STATUS, EBELN and BEDAT.
    Take    EKORG, STATU  and period in selection screen.
    In output screen  take remaining fields.
    If you want to display converted PO's
    Selection screen enter Purhcase org, select the status B  and enter period e.g 09/01/2008 to 09/30/2008.
    Status(STATU) :  B - PO created   N : PO not created
    Regards,
    Chandra

Maybe you are looking for

  • Capturing dv from camcorder on powerbook internal drive then moving to exte

    I plan on installing FCE HD in an OS 10.4.6 Sandbox partition on my 667MHz Powerbook G4 Ti DVI w/ a 60 GB 7200 rpm HD w/ a 13GB Scratch partition. Since the PB has a single Firewire port, can I capture video from my camera through that FW port to the

  • ABAP WebDynpro - ArchiveLink - PDF Error: "File does not start with..."

    Hey community, I have a WebDynpro application in which I want to show a Archive document. I'm using FM 'ARCHIV_GET_TABLE' and then FM 'SCMS_BINARY_TO_XSTRING'. But I only get the error message: (see also attached) File does not open with "%PDF-". Loc

  • Compatibility of Oracle 8.1.7(please Help)

    Hi all, We are currently on Oracle 8.1.7 on NT with 1gb ram. We are going for a server upgrade. But we are not planning to currently upgrade Oracle. Server: Dual processor XEON with 4gb ram and Windows 2000 Professional Server Will Oracle 8.1.7 work

  • Getting mobile screen dimensions

    Hi all, I'm developing a game which is to be played on two mobiles. I use the Canvas class to display the playing field. Both mobiles need to decide on the screen size that both mobiles can use, e.g. find the smallest size displayable in both mobiles

  • ESKN-PACKNO should link to ESLH-PACKNO, but data is ESSR-LBLNI ?

    Dear All, I check ESKN-PACKNO with SE11 and find out that ESKN-PACKNO has a check table which is ESLH-PACKNO But !!!! ESKN-PACKNO data is filled with ESSR-LBLNI, which is not consistent between what I see in SE11 and what I browse with SE16 Yes, I do