How to use a regural expression to get all digit from a string.

Hi All,
Do you know how to use regural expression to get all digits from the following string via ABAP program?
"'Log Attributes                 0 (  0 )     (   10 % Available  )"
Thanks,
Andrew

Hi,
Try the code mentioned below:
  DATA: STR_LEN  LIKE SY-FDPOS,
        RSTR_LEN LIKE SY-FDPOS,
        OFF      LIKE SY-FDPOS.
  DATA: IDX      LIKE SY-FDPOS,        "mn B20K054003
        CL       LIKE SY-FDPOS.        "mn B20K054003
  DATA: RSTRING(40).
  DATA: STRING(40).   " value 'A,N,I,L'.
  FIELD-SYMBOLS: <NLS_CHAR>.           "mn B20K054003
MOVE I_REGUH-ZNME1 TO STRING.
  MOVE SPACE TO RSTRING.
  STR_LEN = STRLEN( STRING ).
  DESCRIBE FIELD RSTRING LENGTH RSTR_LEN.
  IF RSTR_LEN < STR_LEN. RAISE TOO_SMALL. ENDIF.
  WHILE IDX < STR_LEN.                 "mn B20K054003
    ASSIGN STRING+IDX(*) TO <NLS_CHAR>.   "mn B20K054003
    IF SY-LANGU EQ '2'.                "mn B20K054003
      CALL FUNCTION 'NLS_THAI_CHARLEN' "mn B20K054003
           EXPORTING                   "mn B20K054003
                THAI_STRING  = <NLS_CHAR>       "mn B20K054003
           CHANGING                    "mn B20K054003
                THAI_CHARLEN = CL.     "mn B20K054003
    ELSE.                              "mn B20K054003
      CL = CHARLEN( <NLS_CHAR> ).      "mn B20K054003
    ENDIF.                             "mn B20K054003
    IF IDX NE 0.                       "mn B20K054003
      SHIFT RSTRING RIGHT BY CL PLACES."mn B20K054003
    ENDIF.                             "mn B20K054003
    RSTRING+0(CL) = STRING+IDX(CL).    "mn B20K054003
    IDX = IDX + CL.                    "mn B20K054003
  ENDWHILE.                            "mn B20K054003
Regds,
Anil
Edited by: Matt on Jul 1, 2009 9:36 AM -added code tags

Similar Messages

  • Can i use my airport express to get wi fi access for my samsung mobile?

    can i use my airport express to get wi fi access for my samsung mobile..if yes, how?

    If your Samsung mobile phone is Wi-Fi ready, you can use the AirPort Express or any other wireless router or wireless access point to provide a Wi-Fi network for it to connect to.

  • How do i use my apple express speakers as the sound from apple tv?

    how do i use my apple express speakers as the sound from apple tv?

    Welcome to the Apple Community.
    You can't with the Apple TV 2 or 3, with the Apple TV 1, you can choose them from the Airtunes option in the settings menu.

  • I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten.

    I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten. I need to download the product and I can't figure out where to begin.

    Ask someone at your school... Do you have a Cloud redemption code, or a CS6 serial number?
    If Cloud, Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html and
    http://www.adobe.com/products/creativecloud/faq.html
    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall
    http://forums.adobe.com/community/download_install_setup/creative_cloud_faq
    What it is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html
    Cloud Getting Started https://helpx.adobe.com/creative-cloud.html
    If CS6, download at Other downloads and enter your serial number when prompted
    Again... your 1st resource is your school

  • How to use the Dynamic Expression in BRFplus

    Hi Experts
                   I am new to BRFplus. Can you give any document on BRFplus how to use the Dynamic Expression.
    Thankyou
    Venkat

    OK I tried it and worked but for one condition:
    WHERE DECODE (E.qualification_sid, 1104,
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1))
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR')
    But how to put two conditions for the same Expression:
    WHERE DECODE ((E.qualification_sid, 1104) AND (E.RANK_SID, 8),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1))
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR')
    The previous code gives me this error: missing right parenthesis

  • Get all groups from a regular expression match

    Please help me understand how to use Java regular expressions:
    I have an expression similar to this:
    {noformat}"([^X]+)(X[^X]*)+"{noformat}This should match stuff like "asaasaXdfdfdfXXsdsfd".
    How does one access all the matches for the second group (the second groups has a Kleene operator
    added so it is not really just one group --- but match.groupCount() is always 2)
    Here is roughly the code:
    {noformat}java.util.regex.Pattern pattern = {noformat}{noformat}java.util.regex.Pattern.compile({noformat}{noformat}"([^X]+)(X[^X]*)+",{noformat}{noformat}java.util.regex.Pattern.MULTILINE{noformat}{noformat});{noformat}{noformat}java.util.regex.Matcher matcher = pattern.matcher(text);{noformat}{noformat}matcher.find();{noformat}{noformat}int groupcount = matcher.groupCount();{noformat}
    Also, without matcher.find() I get an illegalStateException .. which I also get if I use matcher.matches() instead
    of matcher.find().
    I am obviously missing something here. There is always at least one "X" in the string so shouldn't that pattern always
    match the whole string? Since there are often multiple X, shouldnt I get a group for each occurrence of X, followed
    by 0 or more other characters?
    {noformat}But when I try to match everything by using "^([^X]+)(X[^X]*)+$" I get an "IllegalStateException: No match available" again.{noformat}
    What is the correct way to do this?
    Edited by: johann_p on May 16, 2008 10:39 AM

    I am sorry I messed this up. Here is a SSCCE:
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    class RegExp1 {
        public static void main(String[] args) {
          String testString = "first|aaaa | bbbb\n|cccc|ddddd";
          Pattern pattern = Pattern.compile("^([^|]+)(\\|[^|]*)+$");
          Matcher matcher = pattern.matcher(testString);
          matcher.find();
          int groupcount = matcher.groupCount();
          System.out.println("Found "+groupcount+" groups");
          System.out.println("Matcher: "+matcher);
          for (int i = 1; i <= groupcount; i++) {
            System.out.println("Match "+i+": "+testString.substring(matcher.start(i),matcher.end(i)));
    }I figured out a small bug in my first code that explains some of the exception oddities, but my principal question remains:
    how do I access all the matches that correspond to the second capturing group?
    In the example I would get "first" for Match 1 and "|ddddd" for Match 2, but how do I access all the matches??
    Thank you for your help!

  • How get all sAMAccountName from LDAP?

    Good day ... i'm find this ...
    declare
    -- Adjust as necessary.
    l_ldap_host VARCHAR2(256) := &&;
    l_ldap_port VARCHAR2(256) := &&;
    l_ldap_user VARCHAR2(256) := &&;
    l_ldap_passwd VARCHAR2(256) := &&;
    l_ldap_base VARCHAR2(256) := 'dc=&&,dc=&&,dc=&&';
    l_filter varchar2(100) := '(&(sAMAccountName=*))';
    l_retval pls_integer;
    l_session dbms_ldap.session;
    l_attrs dbms_ldap.string_collection;
    l_message dbms_ldap.message;
    l_entry dbms_ldap.message;
    l_attr_name varchar2(256);
    l_ber_element dbms_ldap.ber_element;
    l_vals dbms_ldap.string_collection;
    l_raw dbms_ldap.binval_collection;
    l_result varchar2(100);
    begin
    -- Choose to raise exceptions.
    dbms_ldap.use_exception := true;
    dbms_ldap.utf8_conversion := false;
    -- Connect to the LDAP server.
    l_session := dbms_ldap.init(hostname => l_ldap_host, portnum => l_ldap_port);
    l_retval := dbms_ldap.simple_bind_s(ld => l_session, dn => l_ldap_user, passwd => l_ldap_passwd);
    -- Get all attributes
    l_attrs(1) := 'sAMAccountName'; -- retrieve all attributes
    l_retval := dbms_ldap.search_s(ld => l_session
    ,base => l_ldap_base
    ,scope => dbms_ldap.scope_subtree
    ,filter => l_filter
    ,attrs => l_attrs
    ,attronly => 0
    ,res => l_message);
    if dbms_ldap.count_entries(ld => l_session, msg => l_message) > 0
    then
    -- Get all the entries returned by our search.
    l_entry := dbms_ldap.first_entry(ld => l_session, msg => l_message);
    <<entry_loop>>
    while l_entry is not null
    loop
    -- Get all the attributes for this entry.
    dbms_output.put_line('---------------------------------------');
    l_attr_name := dbms_ldap.first_attribute(ld => l_session
    ,ldapentry => l_entry
    ,ber_elem => l_ber_element);
    <<attributes_loop>>
    while l_attr_name is not null
    loop
    -- Get all the values for this attribute.
    l_vals := dbms_ldap.get_values(ld => l_session, ldapentry => l_entry, attr => l_attr_name);
    <<values_loop>>
    for i in l_vals.first .. l_vals.last
    loop
    dbms_output.put_line('ATTIBUTE_NAME: ' || l_attr_name || ' = ' || substr(l_vals(i), 1, 200));
    end loop values_loop;
    l_attr_name := dbms_ldap.next_attribute(ld => l_session
    ,ldapentry => l_entry
    ,ber_elem => l_ber_element);
    end loop attibutes_loop;
    l_entry := dbms_ldap.next_entry(ld => l_session, msg => l_entry);
    end loop entry_loop;
    end if;
    -- Disconnect from the LDAP server.
    l_retval := dbms_ldap.unbind_s(ld => l_session);
    dbms_output.put_line('L_RETVAL: ' || l_retval);
    end;
    If i use filter '(&(sAMAccountName=*))' (me need get all 'sAMAccountName')
    ERROR at line 1:
    ORA-31202: DBMS_LDAP: LDAP client/server error: Sizelimit exceeded
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.DBMS_LDAP", line 1457
    ORA-06512: at "SYS.DBMS_LDAP", line 234
    ORA-06512: at line 28
    How fix it ?
    Thanks all.
    p.s. I'm beginner Developer Oracle 10g

    Probably some workaround needed. Hopefully this one works: http://www.freelists.org/archives/oracle-l/04-2006/msg01100.html

  • How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    You can't.  iCloud is not for general file backup from a Mac. It's for backup up and syncing data between mobile devices and and Macs and  The following is from this Apple document: iCloud: Backup and restore overview.
    iCloud automatically backs up the most important data on your (mobile) device using iOS 5 or later. Once you have enabled Backup on your iPhone, iPad, or iPod touch .....
    What is backed up
    You get unlimited free storage for:
    Purchased music, movies, TV shows, apps, and books
    Notes: Backup of purchased music is not available in all countries. Backups of purchased movies and TV shows are U.S. only. Previous purchases may not be restored if they are no longer in the iTunes Store, App Store, or iBookstore.
    Some previously purchased movies may not be available in iTunes in the Cloud. These movies will indicate that they are not available in iTunes in the Cloud on their product details page in the iTunes Store. Previous purchases may be unavailable if they have been refunded or are no longer available in the iTunes Store, App Store, or iBookstore.
    You get 5 GB of free iCloud storage for:
    Photos and videos in the Camera Roll
    Device settings (for example: Phone Favorites, Wallpaper, and Mail, Contacts, Calendar accounts)
    App data
    Home screen and app organization
    Messages (iMessage, SMS, and MMS)
    Ringtones
    Visual Voicemails
    But not from a Mac.  If you want to backup your photos and other important files I suggest you get an external hard drive and use  it with Time Machine.
    OT

  • How to get a char from a String Class?

    How to get a char from a String Class?

    Use charAt(int index), like this for example:
    String s = "Java";
    char c = s.charAt(2);
    System.out.println(c);

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

  • How do I get all contacts from my iphone 4 to icloud?

    how do I get all contacts from my iphone 4 to icloud? I've just got some of them.

    All you have to do is enable iCloud on your phone and turn notes on.  They should automatically appear on your phone.

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • How to get all data from nokia to i5s

    how to get all data from nokia E71 to i5s???

    if you can put those data in your computer then add it in iTunes. your iPhone 5s should get it thru syncing.

  • How get all record from master and matching record from detail

    hi master
    sir i have master detail table
    i have many record in master table but some record in detail table how i get
    all record from master and matching record from detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
    this query not work that get only related record i need all record from master
    please give me idea
    thanking you
    aamir

    hi master
    sir i have master detail table
    i have many record in master table but some record in
    detail table how i get
    all record from master and matching record from
    detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m,
    detail d where m.accid=d.accid
    this query not work that get only related record i
    need all record from master
    please give me idea
    thanking you
    aamir
    select m.accid,m.title,d.dr,d.cr
    from master m, detail d
    where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
    Note: Oracle 10g now supports ANSI standard outer joins as in:
    select m.accid,m.title,d.dr,d.cr
    from master m LEFT OUTER JOIN detail d on m.accid=d.accid

  • How can I get all photos from the camera roll onto the photo stream so they will share between iphone and ipad?

    How can I get all photos from the camera roll, and all new pictures taken, to get on the photostream so they can share between iphone and ipad?

    When turning PhotoStream on with photos available in the Camera Roll, only photos captured by the iPhone or saved on the iPhone are placed in the PhotoStream.
    For all photos that were in the Camera Roll prior to turning PhotoStream on, import the photos with your computer and add the photos to your PhotoStream on your computer.

Maybe you are looking for

  • Can't access login page in IE

    Hi, Some of my participants/customers, from the same organization, can't access the login page when they are going to participate in a meeting. They can access the login screen for Connect Pro Central but not for the meeting. For example the can acce

  • Strange behaviour network?

    I don't know if I have to be concerned about this, but here it goes: My pb language is Dutch.....and you know when you open the Macintosh HD icon on your dock.....you see this menu on your left in finder..... This menu should contain: -Network -Macin

  • Oracle Express will not start

    When I click on Go To Database Homepage I get the browser with "Cannot find server" in the title. It worked yesterday. Please help. Thanks, Tom T.

  • JPDA and J2EE server

    Hi, The document says: The Java Platform Debugger Architecture (JPDA) consists of three interfaces designed for use by debuggers in development environments for desktop systems. So, it is for desktop systems only. Why it can not be used in J2EE envir

  • QT Player 7.6.6 doesn't start up anymore (mac)

    Using MacOS X 10.7.2 on a MacBookPro 2,2 GHz, Intel Core i7, 8 GB RAM. My problem on this machine: the QT Player 7.6.6 doesn't start up anymore. It "tries", then close down. Anyone any idea what I could do? (other machines (iMacs) in my office work f