Find a number in a string

Hi all,
I've got a text field in my source table that can contain both numbers and characters, like any normal varchar2. The issue is with a field that should contain insurance numbers, but also thinks "hello world" will do! A change to the application will not help, nor any constraints on database level will do!
I want to determine if a record has any numbers, if it has, than i validate it to ok, if not, so only characters are in the field, than i want to validate it to not ok.
My solution so far is that I use a case statement with a translate, which translates all characters to a zero and leaves numbers untouched. When result is larger than zero it is valid
So 'ABC123 ' would return 0001230 and evaluate to true, even so '0 123 ABC' would translate 001230000 and will also evaluate to true, and ABC will evaluate to false, exactly how I like it to be.
But...the translate function has all charaters that are directly visible on my keyboard, in upper and lower case, and now i bumped into a special character. An E with two dots above (alt 137).
now to prevent me from building a solution that has all the characters in it which I could ever produce in my translate is there any smarter sollution?
Hope you guys (or girls) can help!
Cheers,
Gilles

Gilles,
What you need is a regular expression. Below is a simple example using the Oracle regexp_like function to determine if the function's input has any numeric characters in it, and returns 1 if it does, otherwise it returns 0:
create or replace function find_digit(p_string varchar2) return number is
l_ret boolean;
begin
l_ret := regexp_like(p_string, '[[:digit:]]');
if l_ret then return 1; else return 0; end if;
end;
You should be able to use something like this. you can use the regexp_like function in the WHERE clause of your SQL or wrap it in to a function like this you need it in the SELECT clause (as the return type of regexp_like is boolean which isn't supported in the SELECT clause).
hope this helps,
Borkur

Similar Messages

  • Finding number in a string

    I am trying to find a number in a string from my database to replace it.  Here is my funciton:
    function findUserID($friendsString, $userToFind){
              echo $friendsString . " " . $userToFind;
              $pos = strpos($friendsString,$userToFind);
              if($pos){
                        return true;
              return false;
    it returns "25,29 25".  How can it not find 25 in that string?

    I understand that it starts at 0.  it should still work.  i had it working before.  i must've changed something. 
    here is my code for passing to the function:
    $query = mysql_query("SELECT friends, pendingFriendRequest
    FROM members
    WHERE username = '$userID'");
    if (mysql_affected_rows() > 0) {
              $row = mysql_fetch_array($query) or die(mysql_error());
              $friends = $row['friends'];
              $pendingFriends = $row['pendingFriendRequest'];
    // If the user exists in the waiting list, then
    //continue (we must confirm that they are first by checking the DB
    $test = findUserID($pendingFriends, "25");
    if($test){
              // If they are, then continue to add them
              $test = confirmFriend($pendingFriends, "25");
              if($test) {
                        echo "<br />You have confirmed " . findUserName(24) . "as a friend.";
              } else {
                        echo "<br />Error: Please try again, or contact us.";
    } else {
              echo "<br />Error: You either have this person as a friend already, or there was an internal error.";

  • How to find the number of occurence of a string

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    here i need to find the number of occurence of the string "experience".
    how to find it out?

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    String findStr = "experience";
    int count = 0;
    int index = 0;
    while(index != -1) {
    index = str.indexOf(findStr, (count == 0 ? 0 : index + findStr.length()));
    if(index != -1) {
    count++;

  • How to find the number of occurance of a string in text field of Infopath form?

    Hi All,
    In Infopath text field, How to find the number of occurrence of a particular string in that field?
    Thanks in advance!

    You can check to see if it contains a string once by using the contains function, but there isn't a very clean way to do what you want. If you wanted to guess at the maximum number of occurrences, then you could:
    Box A has your initial. Set Box B to do a concat of string-before and string-after of Box A where it copies Box A minus the string we're looking for. Then we have Box C that does the same thing to Box B. Repeat as many times as you see necessary.
    Example:
    String: "1"
    Box A - "123451234512345"
    Box B - "23451234512345"
    Box C - "2345234512345"
    Box D - "234523452345"
    etc.
    We then have a field that has nested ifs looking backwards from Z -> A looking for a non-blank. Based on that, we return the number of occurrences. Again, this isn't clean, but it will work if you think there's a predefinable maximum.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • Find the number of consecutive numeric digits in string

    I am trying to see if a string has say 9 consecutive numeric digits in it but it will only work if the long string of numbers is the first string of numbers.
    e.g.
    This would recongnise the following string (if p_len = 9)
    Tel number 20 20 30 369 for 2nd meeting
         but would not recongnise the following
    For 2nd meeting tel 20 20 30 369
    Could anyone give guidance on how to proceed / a better way of find consecutive numbers in a string?
    Thanks
    Simon
    Code sample -
        LOOP AT TLINETAB.
    Remove blank spaces
          CONDENSE TLINETAB-TDLINE NO-GAPS.
    Find first number and its position *
          IF TLINETAB-TDLINE CA '0123456789'.
            pos = sy-fdpos.
    Does the next x characters contain only numbers?
            IF TLINETAB-TDLINE+pos(p_len) CO '0123456789'.
              append i_report.
            endif.
          ENDIF.
        ENDLOOP.

    Dear Simon,
    you want to check for consecutive numbers in a string. Then you may do the following -
    1. Get all the numbers in the given string into a table in a sequencial order, that is the order in which they appear in the string
    2. Once you have all the numbers you may find out if the numbers are consecutive or not. The following is the code which is not tested
    lv_len = 1.
    lv_pos = 1.
    lv_strlen = strlen ( lv_str ).
    do lv_strlen times.
      lv_alpha = lv_str+lv_pos(lv_len).
      if lv_alpha co '0123456789'.
       append lv_alpha to lt_number.
      endif.
      lv_pos = lv_pos + 1.
    enddo.
    loop at lt_number into ls_number.
      if lv_no is initial.
       lv_no = ls_number.
       lv_no = lv_no + 1.
      else.
       if ls_number eq lv_no and
          lv_consec is initial.
        lv_consec = c_x.
       else.
        clear lv_consec.
       endif.
      endif.
    endloop.
    if lv_consec eq c_x.
    *  !!! string has consecutive numbers
    endif.
    Hope it helps. Thank you.
    Regards,
    kartik

  • Find the Number of times a '¯'character appears in a string.

    Hi,
    In my staging table I am having data like below
    ABL¯ABL¯0¯0¯ABL¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ 
    ABL¯ABQ¯480¯825¯DLS¯AMA¯ABQ¯ ¯ ¯ ¯ ¯ ¯ ¯ 
    ABL¯ACD¯808¯1255¯DLS¯ELP¯TCS¯PHX¯ACD¯ ¯ ¯ ¯ ¯ 
    ABL¯ADE¯1256¯471¯DLS¯AMA¯ABQ¯LSV¯ADE¯ ¯ ¯ ¯ ¯ 
    ABL¯AFT¯1140¯1744¯DLS¯LAX¯FON¯AFT¯ ¯ ¯ ¯ ¯ ¯ 
    ABL¯AHM¯1178¯1637¯DLS¯LAX¯AHM¯ ¯ ¯ ¯ ¯ ¯ ¯ 
    ABL¯ALB¯1769¯1825¯DLS¯WIL¯ALB¯ ¯ ¯ ¯ ¯ ¯ ¯ 
    ABL¯ALE¯1041¯1150¯DLS¯ALE¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯
    Now I want to find the Number of times a '¯'character appears in a string.
    I should get output 14
    thanks & regards,
    Vipin Jha
    Thankx &amp; regards, Vipin jha MCP

    Hi Vipin,
    You can try below sql code also
    code:-  len(data)-len(replace(data,'¯','')) -(len(data)-len(replace(data,' ','')))
    select data,len(data)-len(replace(data,'¯','')) -(len(data)-len(replace(data,' ',''))) CountofCharacter from
    select 'ABL¯ABL¯0¯0¯ABL¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ' data
    UNION
    SELECT 'ABL¯ABQ¯480¯825¯DLS¯AMA¯ABQ¯ ¯ ¯ ¯ ¯ ¯ ¯ '
    UNION
    SELECT 'ABL¯ACD¯808¯1255¯DLS¯ELP¯TCS¯PHX¯ACD¯ ¯ ¯ ¯ ¯ '
    UNION
    SELECT 'ABL¯ADE¯1256¯471¯DLS¯AMA¯ABQ¯LSV¯ADE¯ ¯ ¯ ¯ ¯ '
    UNION
    SELECT 'ABL¯AFT¯1140¯1744¯DLS¯LAX¯FON¯AFT¯ ¯ ¯ ¯ ¯ ¯ '
    UNION
    SELECT 'ABL¯AHM¯1178¯1637¯DLS¯LAX¯AHM¯ ¯ ¯ ¯ ¯ ¯ ¯ '
    UNION
    SELECT 'ABL¯ALB¯1769¯1825¯DLS¯WIL¯ALB¯ ¯ ¯ ¯ ¯ ¯ ¯ '
    UNION
    SELECT 'ABL¯ALE¯1041¯1150¯DLS¯ALE¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯'
    ) t
    Thanks
    Prasad

  • How to find number from text string??

    Hi All,
    Can you tell me how to find/ fetch number from string?
    is there any function module  for this.?
    for example , I have string like "+++++1000000589+++"
    and I need to fetch the invoice no 1000000589 from the above string..then  How to do that? Letters may come first or number may come first and latter text...
    Regards,
    Mrunal

    You can do like this.
    The below mentioned is code separate material
        DO 18 TIMES.
          LV_C = LV_C + 1.
          LV_C1 = LV_C - 1.
          IF  GW_MATNR-MATNR+LV_C1(1) CN '0,1,2,3,4,5,6,7,8,9' .
            IF ( ( LV_MAT EQ SPACE ) ) ."  and ( lv_prefix eq space ) ) .
              LV_PREFIX = 'X'.
              CONCATENATE GW_TEMP-PREFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-PREFIX.
            ELSE.
              LV_SUFFIX = 'X'.
              CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-SUFFIX.
            ENDIF.
          ELSEIF ( ( LV_SUFFIX EQ SPACE ) ) .
            LV_MAT = 'X'.
            CONCATENATE GW_TEMP-MATNR1 GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-MATNR1.
          ELSEIF ( ( LV_MAT EQ 'X' ) ) .
            CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-SUFFIX.
          ENDIF.
        ENDDO.

  • How to find Negative number

    can any one pls tell me how to find negative number ?
    Thanks

    1. One easy method is to look for the giveaway dash in front of the number, e.g. "-1" is a negative number, given the "-" instead of the "1."
    2. Negative numbers can also sneakily be found by multiplying i by itself: i^2^ is a negative number.
    3. Negative numbers can hide in the exponent of e as complex numbers. e.g. e^i*pi^ is a negative number.
    4. If we're referring to Java here, perhaps the following could be of some use:
    final int ZERO = 0;
    public static void main(String[] args) {
    int a = 3;
    int b = -13;
    System.out.println(a + " is negative? " + lessThanZero(a));
    System.out.println(b + " is negative? " + lessThanZero(b));
    boolean lessThanZero(int n) {
    return n < 0;
    }

  • How to find the number of records per months  in cube

    Hi,
      how to find the number of records per months for my all cubes?
      Can i use the ListCube transaction to find totl number f records per cube monthwise ?
    Jimmy

    Hi,
    Here is a program to generate no of records and list of ODS and Cubes in Active version.Schedule this program in background and create a cube to load this information and schedule to the data from the file generated by the program. Schedule this all per you requirement.
    1.Copy the code into your Z<programname> from Se38.
    2.change the FILENAME in CALL FUNCTION 'GUI_DOWNLOAD' in the program to the location from where you can pick the information to load data to cube(eg Application server).
    3.Save program.
    4.Schedule the program in background as required
    5.Create cube with infoobjects to hold no of records and Infoprovider name
    6.Load this cube based on event after the program job is done.
    Hence you can report on this cube to see no of records in  CUBE or ODS in your box.
    Please find the code below.
    Cheers,
    Kavitha Kamesh.
    types: begin of itabs ,
          tabname type dd02l-tabname,
          end of itabs.
    data: itab type itabs occurs 0 with header line.
    data: counter type i.
    data: begin of itab1 occurs 0,
    tabname type dd02l-tabname,
    counter type i,
    end of itab1.
    DATA: ITABTABNAME TYPE STRING.
    DATA: LENGTH TYPE I.
    DATA: OBJECT(30).
    data: str(6) type c.
    select  tabname from dd02l into table itab where ( tabname LIKE  '/BIC/F%' or tabname LIKE  '/BIC/A%00' )
    and TABCLASS = 'TRANSP' and AS4LOCAL = 'A'.
    loop at itab.
      select count(*) from (itab-tabname) into counter.
      str = itab-tabname.
      if str = '/BIC/F'.
    LENGTH  = STRLEN( ITAB-TABNAME ).
      SHIFT  itab-tabname BY 6 PLACES LEFT.
    ELSEIf  str = '/BIC/A'.
      SHIFT  itab-tabname BY 6 PLACES LEFT.
      LENGTH  = STRLEN( ITAB-TABNAME ).
    LENGTH = LENGTH - 2.
    endif.
      itab1-tabname = itab-tabname(LENGTH).
      append itab1.
      itab1-counter = counter.
      clear itab-tabname.
      clear:  COUNTER.
    endloop.
    *********** itab1
    loop at itab1.
    write:/ itab1-tabname, itab1-counter.
    endloop.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                    =
        FILENAME                        = 'c:records.xls'
        FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
        WRITE_FIELD_SEPARATOR           = ','
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    * IMPORTING
    *   FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab1
    *   FIELDNAMES                      =
    * EXCEPTIONS
    *   FILE_WRITE_ERROR                = 1
    *   NO_BATCH                        = 2
    *   GUI_REFUSE_FILETRANSFER         = 3
    *   INVALID_TYPE                    = 4
    *   NO_AUTHORITY                    = 5
    *   UNKNOWN_ERROR                   = 6
    *   HEADER_NOT_ALLOWED              = 7
    *   SEPARATOR_NOT_ALLOWED           = 8
    *   FILESIZE_NOT_ALLOWED            = 9
    *   HEADER_TOO_LONG                 = 10
    *   DP_ERROR_CREATE                 = 11
    *   DP_ERROR_SEND                   = 12
    *   DP_ERROR_WRITE                  = 13
    *   UNKNOWN_DP_ERROR                = 14
    *   ACCESS_DENIED                   = 15
    *   DP_OUT_OF_MEMORY                = 16
    *   DISK_FULL                       = 17
    *   DP_TIMEOUT                      = 18
    *   FILE_NOT_FOUND                  = 19
    *   DATAPROVIDER_EXCEPTION          = 20
    *   CONTROL_FLUSH_ERROR             = 21
    *   OTHERS                          = 22
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to find the number of references created for a given  object ??

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please do not post the same question multiple times.
    As for your original question, there is no direct way to do it.
    Especially not the way you phrased it,
    since objects don't have "names".
    Applications also don't have "names".
    They have classes and instances.
    Also, there are 2 related issues, and I'm not sure which one is the one you asked.
    #1. Finding the number of references to the same object.
    Eg.
    Map<String,String> a = new HashMap<String,String>();
    Map<String,String> b = new HashMap<String,String>();
    Map<String,String> c = a;In this case, there are only 2 objects.
    The first object has (at least) 2 references pointing to it.
    The second object has (at least) 1 reference pointing to it.
    (There may be more, if the HashMap library keeps
    references to these things, or if the HashMap object has
    some internal cyclic references...)
    If you're asking this, then it can't be done.
    It's an active research topic in universities
    and software research labs, called "alias analysis".
    Type it in google, and you'll see people are working hard
    and having little success so far.
    #2. Finding the number of instances created from a class.
    In this case, what you have to do is to add a counter to
    the constructor of the class. Every time an object is constructed,
    you increment the counter. Like this:
       class MyClass
           public static int counter = 0;
           public MyClass( )  { counter++; }
        // Then later in your program, you can do this:
        MyClass a = new MyClass();
        MyClass b = new MyClass();
        System.out.println(MyClass.counter); // It should show 2Note: you won't be able to do this to every class in the system.
    For every class you care about, you have to modify its constructor.
    Also: when an object is deleted, you won't always know it
    (and thus you won't always be able to decrement the counter).
    Finalizers cannot always work (read Joshua Bloch's
    "Effective Java" book if you don't believe me), but basically
    (1) finalizers will not always be called, and
    (2) finalizers can sometimes cause objects to not be deleted,
    and thus the JVM will run out of memory and crash

  • How do you find the number of lines in a file?

    I need to count how many lines there are in a file, I am using a BufferedReader to read in the data, but how can I find the number of lines?
    Thanks

    That depends. How do you define a line? Is it a specific number of
    characters, a String that's terminated by a newline character or some
    combination thereof?

  • How to find out if a long String has a "subString" twice or more.

    I need to find out if a long String has the same number twice or more.
    I need to look matches for numbers running from 000, 001....999 and if a number is found twice or more, return that number and lines there were found.
    example String:
    -;000 ; 1 ; 2006-12-11 ; -; job;
    x;001 ; 2 ; 2006-12-11 ; 2006-12-12; do this
    -;002 ; 3 ; 2006-12-11 ; -; work
    -;003 ; 0 ; 2006-12-11 ; -; some
    -;004 ; 2 ; 2006-12-11 ; -; thing
    x;005 ; 1 ; 2006-12-11 ; 2006-12-11; reads
    -;003 ; 0 ; 2006-12-11 ; -; here
    Should return from example String:
    003 at lines 4 and 7
    Any ideas?

    So there are newlines in the String?
    You could use a StringTokenizer to break the String into lines, then searching on each line if it contains any of the search strings. (You need to clarify if a line can contain more than one search string).
    Probably you should use a Map<String, Integer> to record the searchcounts.
    Or an int[] Array if you are really sure that the Strings you search for really are numbers.
    Another option is to use:
    LineNumberReader lnr = new LineNumberReader(new StringReader(searchString));This will save you from explicitly having to take care for the line number.
    In any case your example looks like the individual lines are semicolon separated fields and the numbers you search for always are in column two.
    So after breaking up the original String in lines, you could use another StringTokenizer to break up the line in fields.

  • Number to fractional string not working correctly

    I am measuring some parameters from oscillsocpe. i need to write these values to text file for which i am using write to spreadsheet, but what is happening is it is always writing zero value to file, on debugging i found that while converting from number to string it is always writng zero to string indicator, then separately i used that number to fractional string indicator and it is always showing zero in string output , i dont why it is happening.
    Attached below is the code.
    Solved!
    Go to Solution.
    Attachments:
    Time meas sub.vi ‏31 KB

    Ranjeet Singh and Norbert_B
    Thanks for ther reply
    Ranjeet singh,
    number to fractional string is working correctly, there is some other problem, because inly when i am executing this code converting this rise time value to string then only it is showing zero, otherwise for any random number if i am checking this number to fractional string is working correctly.
    Norbert_B
    i dont need to convert it back to string that i am doing only to check why it is showing zero value on converting number to string , because when i was writing to spreadsheet file it was always writing zero value, so when checked that code it was observed that while converting from array of numbers to spreadsheet string it is always writing zero value that's why i am doing it here just to check why it is not converting to string, but your suggestion helped in focussing the string that i am gettong from VISA read, i can use that  in last case if i wont be able to find the solution but main problem is that why i am not able to convert it back to string, why it is showing zero because it is because of this only write to spreadsheet is always showing zero value .

  • Finding the number of Non-Blank Line in a File

    Does anyone know the command or how to find the number of non-blank lines in a text file? I have the program already reading characters, words, and total lines.
              BufferedReader FileIn = new BufferedReader( new FileReader( selectedFile ) );
                   Scanner scanWords = new Scanner (selectedFile);
                             String thisToken = "";
                             int numWords = 0;
                             while (scanWords.hasNext())
                             thisToken = scanWords.next();
                             numWords++;
         System.out.println("Total number of words: " + numWords);
         Scanner scanLines = new Scanner (selectedFile).useDelimiter("\n");
                             String thisToken2 = "";
                             int numLines = 0;
                             while (scanLines.hasNext())
                             thisToken2 = scanLines.next();
                             numLines++;
         System.out.println("Total number of lines: " + numLines);
         Scanner scanChars = new Scanner (selectedFile).useDelimiter("");
                             String thisToken3 = "";
                             int numChars = 0;
                             while (scanChars.hasNext())
                             thisToken2 = scanChars.next();
                             numChars++;
         System.out.println("Total number of characters: " + numChars);
                   FileIn.close();
              }

    Use BufferedReader#readLine() instead. Read the file once and process each line once.

  • Finding all programs having particualr string in its Text symbols...

    Hello Gurus,
    If I want to search the string in ABAP code , I know I can use program RPR_ABAP_SOURCE_SCAN.
    But I want to find all SAP programs in which the text-symbols is defined by a particular string. How can I do that ?
    Please help....

    Hello Rajesh
    A function module which provides you will all text elements of a single report is RPY_PROGRAM_READ.
    Given this fm it is quite simple to write a report for your requirement:
    *& Report  ZUS_SDN_READ_TEXT_ELEMENTS
    *& Thread: Finding all programs having particualr string in its Text symbols...
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="814207"></a>
    REPORT  zus_sdn_read_text_elements.
    TABLES: trdir.
    TYPES: BEGIN OF ty_s_outtab.
    TYPES: name   TYPE trdir-name.
    INCLUDE TYPE textpool     AS text.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                        WITH DEFAULT KEY.
    DATA: gt_outtab     TYPE ty_t_outtab,
          gs_outtab     TYPE ty_s_outtab,
          gt_fcat       TYPE lvc_t_fcat.
    DATA: gt_trdir      TYPE STANDARD TABLE OF trdir,
          gs_trdir      TYPE trdir.
    DATA: gt_textpool   TYPE STANDARD TABLE OF textpool.
    DATA: gd_count      TYPE i,
          gd_perc       TYPE i,
          gd_text(50)   TYPE c.
    SELECT-OPTIONS:
      o_report    FOR trdir-name.
    START-OF-SELECTION.
      IF ( o_report[] IS INITIAL ).
      ELSE.
        SELECT * FROM  trdir INTO TABLE gt_trdir
               WHERE  name  IN o_report.
      ENDIF.
      CHECK ( gt_trdir IS NOT INITIAL ).
      DESCRIBE TABLE gt_trdir.
      gd_count = syst-tfill.
      LOOP AT gt_trdir INTO gs_trdir.
        gd_perc = ( syst-tabix * 100 ) / gd_count.
        gd_text = gs_trdir-name.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = gd_perc
            text       = gd_text.
        REFRESH: gt_textpool.
        CALL FUNCTION 'RPY_PROGRAM_READ'
          EXPORTING
    *         LANGUAGE                  = SY-LANGU
            program_name              = gs_trdir-name
            with_includelist          = ' '
    *         ONLY_SOURCE               = ' '
            only_texts                = 'X'
    *         READ_LATEST_VERSION       = ' '
    *         WITH_LOWERCASE            = ' '
    *       IMPORTING
    *         PROG_INF                  =
          TABLES
    *         INCLUDE_TAB               =
    *         SOURCE                    =
    *         SOURCE_EXTENDED           =
            textelements              = gt_textpool
          EXCEPTIONS
            cancelled                 = 1
            not_found                 = 2
            permission_error          = 3
            OTHERS                    = 4.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        DELETE gt_textpool WHERE ( id NE 'I ' ).  " keep only text elements
        CLEAR: gs_outtab.
        gs_outtab-name = gs_trdir-name.
        LOOP AT gt_textpool INTO gs_outtab-text.
          APPEND gs_outtab TO gt_outtab.
        ENDLOOP.
      ENDLOOP.
      PERFORM build_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *       I_INTERFACE_CHECK                 = ' '
    *       I_BYPASSING_BUFFER                =
    *       I_BUFFER_ACTIVE                   =
    *       I_CALLBACK_PROGRAM                = ' '
    *       I_CALLBACK_PF_STATUS_SET          = ' '
    *       I_CALLBACK_USER_COMMAND           = ' '
    *       I_CALLBACK_TOP_OF_PAGE            = ' '
    *       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *       I_CALLBACK_HTML_END_OF_LIST       = ' '
    *       i_structure_name                  = 
    *       I_BACKGROUND_ID                   = ' '
    *       I_GRID_TITLE                      =
    *       I_GRID_SETTINGS                   =
    *       IS_LAYOUT_LVC                     =
            it_fieldcat_lvc                   = gt_fcat
    *       IT_EXCLUDING                      =
    *       IT_SPECIAL_GROUPS_LVC             =
    *       IT_SORT_LVC                       =
    *       IT_FILTER_LVC                     =
    *       IT_HYPERLINK                      =
    *       IS_SEL_HIDE                       =
    *       I_DEFAULT                         = 'X'
    *       I_SAVE                            = ' '
    *       IS_VARIANT                        =
        TABLES
          t_outtab                          = gt_outtab
        EXCEPTIONS
          program_error                     = 1
          OTHERS                            = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    END-OF-SELECTION.
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA: ls_fcat   TYPE lvc_s_fcat,
            lt_fcat   TYPE lvc_t_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'TRDIR'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DELETE gt_fcat WHERE ( fieldname NE 'NAME' ).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
    *     I_BUFFER_ACTIVE              =
        i_structure_name             = 'TEXTPOOL'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
      CHANGING
        ct_fieldcat                  = gt_fcat
      EXCEPTIONS
        inconsistent_interface       = 1
        program_error                = 2
        OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT gt_fcat INTO ls_fcat.
        ls_fcat-col_pos = syst-tabix.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG
    Regards
      Uwe

Maybe you are looking for

  • Whats a site similar to Feedburner? (and free)

    I am unable to submit my feedburner rss to the itunes store (I have a seperate topic on that, I get an error everytime) so I was wondering if there is a similar feed burning site to use for free out there just like feedburner that I can use to submit

  • HT4759 how do i free up 4 gb of space so i can download mountain lion os x

    what is the best way to free up 4 gb of space to download mountain lion os?

  • Changing Drive labels (letters)

    Hi, I partitioned the HDD on the K210 to a "C" (for Windows, programs and applications) and "D",  the next letter in the drive sequence somehow was assigned to the DVD Drive and the "E" Drive to the HDVD Drive and then the (Partitions that I created)

  • Using 'NOT IN' Within a SQL Statement

    Does anyone know why the following SQL statement does not return any values? The problem is with the SELECT statement within the 'NOT IN' clause. When explicitly typing in the part_ids returned from the select statement, everything works as expected.

  • Output list

    Hi Experts, When i am trying to Export an Output list to a local file (spreadsheet), i am getting an error message as " Table Calculations cannot be called( FATAL ERROR)" . Please help me