How to Get the numeric equivalent of Year and Month with this format....

Hi Experts!
I just would like to know how to get the numeric equivalent of the Year and Month if the given format is like this....
   31-May-07
where:
31 is the Day
May is the Month
07 is the Year
Is there a function in ABAP to do this? I wouldn't mind hardcoding for the Month, but what I'm after is the year.... they only gave me 2 digits for the year... and I would like to extract 4 digits from it... do ABAP still recognize it as '1907'? I think not...
Please help me on this experts and Thank you in Advance!!!
More Power!

Hi Jayson,
You can require 2007 or 2017 or 2027..
or 1937 . or 1947 .. so on,
so just put a logic based on this. Just hard code as
lets say value is 31-May-07 (9 char field)
Case field+7(1).
WHEn 0.
concatenate '200' field+8(1) into year.
WHEN 1.
WHEN 2.
WHEN 3.
jsut code like this and check the syntaxes.
Reward points if useful.
Regards,
Atish

Similar Messages

  • How to get the values of all elements and sub elements from  following xml

    how to get the values of all elements and sub elements from following xml...
    <?xml version="1.0" encoding="UTF-8" ?>
    <List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
    <TransactionID>TransactionID</TransactionID>
    <Match>
    <Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
    <List_Matched_Field>
    <FSFM_Matches>
    <NUMBER>NUMBER</NUMBER>
    <TERROR>TERROR</TERROR>
    <TU>TU</TU>
    <NAMEU>NAMEU</NAMEU>
    <DESCRIPT>DESCRIPT</DESCRIPT>
    <KODCR>KODCR</KODCR>
    <KODCN>KODCN</KODCN>
    <AMR>AMR</AMR>
    <ADDRESS>ADDRESS</ADDRESS>
    <SD>SD</SD>
    <RG>RG</RG>
    <ND>ND</ND>
    <VD>VD</VD>
    <GR>GR</GR>
    <YR>YR</YR>
    <MR>MR</MR>
    <CB_DATE>CB_DATE</CB_DATE>
    <CE_DATE>CE_DATE</CE_DATE>
    <DIRECTOR>DIRECTOR</DIRECTOR>
    <FOUNDER>FOUNDER</FOUNDER>
    <TERRTYPE>TERRTYPE</TERRTYPE>
    </FSFM_Matches>
    <OfacMatchDetails>
    <UID>UID</UID>
    <TITLE>TITLE</TITLE>
    <SDNTYPE>SDNTYPE</SDNTYPE>
    <REMARKS>REMARKS</REMARKS>
    <ID_UID>ID_UID</ID_UID>
    <IDTYPE>IDTYPE</IDTYPE>
    <IDNUMBER>IDNUMBER</IDNUMBER>
    <IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
    <ISSUEDATE>ISSUEDATE</ISSUEDATE>
    <EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
    <ADDRESS1>ADDRESS1</ADDRESS1>
    <ADDRESS2>ADDRESS2</ADDRESS2>
    <ADDRESS3>ADDRESS3</ADDRESS3>
    <CITY>CITY</CITY>
    <STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
    <POSTALCODE>POSTALCODE</POSTALCODE>
    <COUNTRY>COUNTRY</COUNTRY>
    </OfacMatchDetails>
    </List_Matched_Field>
    </Match>
    </List_AML_Finacle>

    avoid multi post
    http://forum.java.sun.com/thread.jspa?threadID=5249519

  • HT1926 when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?

    when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?

    Repair your Apple software update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you don't find ASU, go to Control Panel:
    START/CONTROL PANEL/Programs n Features/highlight ASU and click REPAIR,

  • How to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK?

    I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.

    I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.

  • When installing itunes 10 uding windows xp I get the following error: "There is a problem with this Windows Installerpackage. A program run as part of the setup did not finish as expected. Contact your sipport personnel or package vendor." - any ideas?

    When downloading itunes 10 in windows xp, I get the following error "There is a problem with this Windoes Installer package. Aprogram run as part of the setup did not finish as expected. Contact your support personnel or package vendor." - any ideas on how to proceed?

    using MSICUU2.exe didn't help me.  But,  the new replacement app did:
      http://support.microsoft.com/mats/Program_Install_and_Uninstall
    I fixed my problem like this:
    Here's the deal - 
    1.  can you install itunes via the APPLE SOFTWARE updater?
    I couldn't  so I downloaded ITUNES and tried to install it that way.   Hence  I got the same error hang as you.  Nothing worked,  (Multiple attempts at uninstall reinstall,  stopping of Services,  Reg cleaners  etc..)
    2.  If answer is NO to #1 you must fixe the APPLE SOFTWARE UPDATE Program. 
    OK  so I couldn't find a Download for this.   But:  if you have WINRAR,  open the ITUNES.EXE and extract the APPLESOFTWAREUPDATE.MSI file.  Execute the APPLESOFTWAREUPDATE.MSI separately.   And you will not be able to install it and have a similar issue as per your Itunes install.   This of course leads you to believe that the Itunes.exe  install is also installing all of these components including the applesoftwareupdate silently.   It must BOMB at that portion of the install and you are done. 
    3.  Your goal now is to get the applesoftwareupdate installed.   How do you do this.  Well -  here is what I did.
      a.  downloaded and RUN a PC  Installer FIX it tool from Microsoft.  This is a replacement for the older MSI fixer they used to use.
      http://support.microsoft.com/mats/Program_Install_and_Uninstall
    b. It will list programs to attempt to fix.
      choose  AppleSoftwareUpdate.msi
    c. Once it is done,  then reinstall apple program updater using
    AppleSoftwareUpdate.msi
    Finally it should install since the Microsoft tool appraently fixed corrupted installation files in your registry for this application.
    (Please note:  that I also disabled any apple related services such as BONJOUR or IPOD DEvice RUN:  services.msc to get there -  although this man not be necesarry.)
    Hence Launch this APPLE UPDATE SOFTWARE (Click the ICON in your Start menu)  it should list ITUNES
    select ITUNES from here and it will update.
    KEY HERE is to ONLY UPDATE APPLE Stuff via the APPLE SOFTWARE UPDATE program.  If that program is not working fix it.  Then Bingo.
    I am sorry to see folks having this problem for weeks.  
    APPLE,   Spread the word.  PC's can get corruption in the registry on your product should the update be stopped or computer shut off during an update.  etc...   Please improve your software updater program to check for invalid registry upon launching the app.  This will prevent people thinking it is an APPLE issue.  It appears to be a problem on your PC's registry settings for the APPLE Software update.
    Bruno Ricci

  • I get the errer message "There is a problem with this windows installer package. A program required for this install to complete could not be run."

    I have Wondows Vista... I tried to upgrade to Itunes 10.5, and received an error orginially stating that I was trying to install a version older than the one I had.  I uninstalled all of itunes, and now I'm getting the error  message "there is a problem with this windows installer package.  Aprogram required for this install to complete could not be run.
    Help!  I have an IPhone, and I would like to get my Itunes upgraded so I can download the new Iphone software...
    Thanks!

    I have been in touch with Apple support in reference to my problem. We went through every solution available, and found no fix. The tech then suggested I contact Microsoft concerning this issue. I thought that suggestion was just to get me pointed somewhere but Apple. Boy was I wrong!! I contacted Microsoft, and was directed to a free download called Microsoft Fix. This program fixed something in the regisitor, and wala everything was fixed!! I now have I-Cloud and I-Tunes loaded and working well. So, if you can't install Apple Software and are running Window 7 you might give Microsoft Fix a try, it fixed my problem.....

  • Why do I get the mesasge, default printer is not compatible with this version of photoshop elements

    When I print from photoshop elements 13, I get the message, default printer is not compatible with this version of photoshop elements

    Hi ,
    Please update to PSE 13.1
    13.1 has solved this problem.
    Refer to this link.
    Photoshop Elements Help | Printer errors with Photoshop Elements 13

  • How to get the week number of year from a Date object?

    Hi!
    I would like to know the week number of the year from a specified Date.
    I dont know how to set the first day of week, and set the minimum days of a week.
    I want to use Monday for first day of week, and at least 4 days of month in a week.
    For example if its 1st, January is Friday, then the first week starts on 4th, Monday.
    Anyone can help?

    Sorry. I should think before I move.
         public static int getWeekOfYear(Date date) {
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(date);
             calendar.setFirstDayOfWeek(Calendar.MONDAY);
             calendar.setMinimalDaysInFirstWeek(4);
             return calendar.get(Calendar.WEEK_OF_YEAR);
         }

  • How to get the numeric value of DocTotal from UI API

    When I hit the ADD button I need to get the DocTotal from the UI API !
    All I have is the EditText which gives it in string and the problem is to double.Parse it
    it's a pain to do it while there is CultureInfo related issue with it.
    So It would be wise to get the numeric value directly from the UI API instead of getting the DocTotal by string and trying to convert it.  So is there any way to get the numrci value of DocTotal from UI API ?

    Hello Marc,
    Here is a function which considering the Culture Info and always working. You can speed it up by using extending admininfo to global vairables, and loading the values at startup of the addon.
    Use the oEditText.value.ToString() to convert into into the doulbe number:
    Public Function _string2double(ByVal s As String) As Double
            Dim d As Double
    ' This part is fast, when regional settings equal to sap B1 settings:
            Try
                d = Convert.ToDouble(s)
                d = Math.Round(d, 6)
                Return d
            Catch
            End Try
    ' Speed up performance: extend CompaneService variables to global variables and query them at addon startup.
            Try
                Dim nfi As System.Globalization.NumberFormatInfo = System.Globalization.CultureInfo.CurrentCulture.NumberFormat
                Dim oCompanyService As SAPbobsCOM.CompanyService = oCompany.GetCompanyService()
                Dim oAdminInfo As SAPbobsCOM.AdminInfo = oCompanyService.GetAdminInfo()
                Dim sbodsep As String = oAdminInfo.DecimalSeparator
                Dim sbotsep As String = oAdminInfo.ThousandsSeparator
                If s.IndexOf(Space(1)) > 0 Then
                    If oAdminInfo.DisplayCurrencyontheRight = BoYesNoEnum.tYES Then
                        s = s.Substring(0, s.IndexOf(Space(1)))
                    Else
                        s = s.Substring(s.IndexOf(Space(1)), s.Length - s.IndexOf(Space(1)))
                    End If
                End If
                Dim s1 As String = s.Replace(sbotsep, nfi.NumberGroupSeparator)
                s1 = s1.Replace(sbodsep, nfi.NumberDecimalSeparator)
                d = Convert.ToDouble(s)
                d = Math.Round(d, 6)
                Return d
            Catch
                Return 0
            End Try
        End Function
    Regards,
    J.
    Edited by: János Nagy on Oct 7, 2009 8:55 AM

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the data of Open Opportunities and Closed Opportunities

    Hi Guys,
      i'm studying about Sales Opportunities in SAP BusinessOne.
    i'm able to get the data about Sales Opportunities(i enterd), Opportunities Report and Lost Opportunities.
    But i dont know how to get information about Open Opportunities Reports and Closed Opportunitiesn Reports.i'm unable to find even their names of tables.
    plz send a reply.................
       with regards,
    santh

    Thanq Alexey for ur Helpful Answer,
       i'm aware about execution of a query in the Query Analyzer of SQL Server.but i dont know how to move to ShowDebugInformation Menu.
       can i find it in  the SAP Business One Tool. or do i need
    to check any data base help given by B1(Ex:- REFDB2004).
        plz give answer for  this also............
      with regards,
    santh

  • How to get the co-ordinates(X-axis and y-axis) for irregular static map

    hi all,
    i am trying to get the co-ordinates like latitude and longitude which are used in google map in an irrregular Static Maps,and i also want to know how can i Get perfect location Depending on Coordinates which i given using Page items.
    can any help me pls
    I AM USING APEX 4.1.1
    thanks,
    Pavan
    Edited by: Pavan on May 29, 2012 7:58 AM

    hi VC,
    Thanks for your reply,,
    I Just want to Develop a static map that is not using any Google api or Google Maps,Its like Google maps but not totally a Map which resembles Google map. But i want to have an access of coordinates in an static regular Map where with the help of coordinates we can find any point on that static map's .
    Thanks & Regards:
    Pavan

  • How to get the children of a TreeTableModel and how to sort them?

    Hi all,
    I used a JXTreeTable in my application; this JXTreeTable has a TreeTableModel in it.
    I 'd need to get the children of a node and sort them.....how could i do it ?
    Cheers.
    Stefano

    Smigh wrote:
    ..How can I get the title of the O.S. window with focus? Not necessarily the java application window but any window like the internet browser or Windows Explorer. Do I need the windows API for that?Probably.
    How can I send keystrokes to that window? Let's say I want to send "ctrl+w" to Firefox to close the current tab, how can I send those keys?The Robot (http://download.oracle.com/javase/6/docs/api/java/awt/Robot.html#method_summary).

  • I went to update my itunes and I get the following message:  there is a problem with this windows installer package, a program required for this install to complete could not be run.  I uninstalled the old itune and reinstalled the new one and i get the s

    I went to upgrade itunes and when it finally downloaded, i got the following message:  There is a problem with this windows installer. A program required for this install to complete could not be run.
    I was advised to unistall the old itune, which i did and then loaded the latest itune 10.5 i think.  It dowloaded fine to a point and before finishing, it came up with the same message.
    Is the problem with the itune installer or my windows installer on my laptop?

    Repair your Apple software update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you don't find ASU, go to Control Panel:
    START/CONTROL PANEL/Programs n Features/highlight ASU and click REPAIR,

  • How to get the numeric character in a string

    Hi Experts,
    I have the following requirement.
    I am double clicking on the number of a string and I need to get the number as the output.
    I have string  like
    String1 : "Account Number 19292 is closed"  I am double clicking on 19292
    I want the output as 19292
    String2 : "AccountNumber19292isclosed"   I am double clicking on 19292
    I want the output as 19292
    String3: "Account Number1929 2 isclosed"  I am double clicking on 1929
    I want the output as 1929 and not 19292
    String4 :"Account Number 1929 2is closed" I am double clicking on 2
    I want the output as 2.
    Thanks in Advance,
    Raju

    Hi Raju,
    All possible solutions should more or less do the following two steps:
    <ol>
    <li>Check if at the given offset is a number: If yes, retain all consecutive numeric characters from the offset; otherwise stop.</li>
    <li>Retain any consecutive numeric characters preceding the number at the given offset and remove all other characters</li>
    </ol>
    Pretty trivial stuff, but the interesting challenge is actually to come up with the solution with least amount of coding (and ideally still understandable). I have a solution that is pretty short, though not really obvious for people not knowing about regular expressions...
    So here's the coding (relevant part in the form) and a quick test harness to check out what it does:
    data:
    TXT type STRING,
    NUM type STRING,
    OFF type I,
    LEN type I.
    TXT = '0Account12 Number 345 6 78isclosed9.9'.
    LEN = strlen( TXT ).
    do LEN times.
      OFF = SY-INDEX - 1.
      perform EXTRACT_NUMBER using    TXT
                                      OFF
                             changing NUM.
      write: /(3) OFF, ':', (5) NUM, TXT(OFF) inverse no-gap, TXT+OFF.
    enddo.
    * Return number at given offset in string (empty if no number present)
    form EXTRACT_NUMBER using    TXT        type STRING
                                 VALUE(OFF) type I
                        changing NUM        type STRING.
      NUM = TXT.
      replace regex '^(\d+).*$' in section offset OFF of NUM with '$1'.
      if SY-SUBRC = 0.
        replace regex '^.*[^\d](\d*)$' in NUM with '$1'.
      else.
        NUM = ''.
      endif.
    endform.
    I think this should match your requirements. Let's see if somebody comes up with a solution with less lines...
    Cheers, harald

Maybe you are looking for