Removing Duplicate Characters in a String without using a Hashset

I was wondering if anyone knew a way of removing duplicate characters in a string without using a Hashset.
I want to go from
helloworld -> helowrd

okay, here it is
1) use a loop, look through each character in the original string
2) look at the new string, if this character exist, don't add it, otherwise add it.
check out methods in java.lang.String

Similar Messages

  • Length of a string without using any built-in functions

    code that returns the length of a string without using any built-in functions.
    thanks
    Sam

    A string is internally represented by a character array.  An array of characters will reside on the stack, not the heap.  Yes, we always learned that String is a reference type, but what goes on in your memory might still surprise you...
    A struct is internally represented by only it's private properties, sequentially on the stack.
    So basically, what I thought is happening by messing with the structlayout: is only tricking our programming a bit into thinking that the top X bytes on the stack represent a chararray, while actually we put them there as a string.
    Wrong. True. And wrong.
    A string is internally represented by, in that order, an array length, a string length, the chars. None of them resides on the stack.
    An array is internally represented by, in that order, an array length and the chars. None of them resides on the stack.
    When you use the FieldOffset attribute to handle the string as a char array, you don't get anything right:
    - the Length returned is the "array length" of the string, which is equal to the string length + 1.
    - the chars returned by the array indexer are shifted by 2 chars (the length of the "string length" field).
    You can use the FieldOffset to make that work, but it needs a little bit more work.
    unsafe static int Test()
    string myString = "This string may contain many string inside this string";
    string testString = "string";
    int countResult = 0;
    fixed (char* myChars = new StringToChar { str = myString }.chr, testChar = new StringToChar { str = testString }.chr)
    // The 2 first chars of the array are actually the string length.
    int myCharsLength = myChars[1] << 16 | myChars[0];
    int testCharLength = testChar[1] << 16 | testChar[0];
    for (int i = 0; i < myCharsLength - testCharLength + 1; i++)
    if (myChars[i + 2] == testChar[2])
    for (int j = 1; j < testCharLength; j++)
    var c = testChar[7];
    if (myChars[i + 2 + j] != testChar[j + 2])
    goto endOfCharAnalyses;
    countResult++;
    endOfCharAnalyses:
    continue;
    return countResult;

  • Removes duplicates from a sorted array without having to create a new array

    Funcation removes duplicates from a sorted array without having to create a new array

    Funcation removes duplicates from a sorted array
    without having to create a new arrayIs a 'funcation' like a vacation but more fun or
    something?LMFAO. You just jumped with both feet on one of my biggest peeves. I've been outed!
    Actual words/phrases I've seen used which I hate with every fiber of my being:
    "Mrs. Freshly's"
    "McFlurry"
    "Freshissimo"
    "Spee-dee"
    "Moons Over My Hammy"
    One of my favorite SNL skits had Will Ferrell leading a panel of movie reviewers (they're the worst for this kind of junk). Each one had some cheesy pun to describe their respective movie. Ferrell topped the show off with his endorsement of "Fantasia 2000 is Fantasgreat!"
    LOL.
    "Come to Slippy Village - it's a FUNCATION!"
    &#167; (runs off, laughing maniacally, head explodes)

  • Splitting a Number String without using split()

    What is the better way of converting a number string where the numbers are seperated by a white space into an array without using the split() method or tocharArray e.g numberString = "12 13 14" numberArray[0] = 12, numberArray[1] = 13, etc

    If you know the number of elements in the string, you can create a predefined fixed array. You can also search for empty spaces.
    String text = "12 13 14";
    int COUNT = 3;
    public void doit() {
      int[] arr = new int[COUNT];
      int sub1 = 0;
      int sub2 = 0;
      for(int i=0; i<COUNT - 1; i++) {
        sub2 = text.indexOf(" ", sub2 + 1);
        arr[i] = Integer.parseInt(text.substring(sub1, sub2));
        sub1 = sub2 + 1;
      arr[COUNT - 1] = text.substring(sub1, text.length());

  • Removing special characters from a string

    Hi All,
    I have this in one my column in my table
    ABC-DEF
    ABC/DEF
    ABC,DEF
    ABC DEF
    I want to remove -, /, comma and space so i want the result like this
    ABCDEF
    ABCDEF
    ABCDEF
    ABCDEF
    How can I do this in PL/sql.
    Thanks.

    Use REGEXP_REPLACE:
    with sample_table as (
                          select 'ABC-DEF' str from dual union all
                          select 'ABC/DEF' from dual union all
                          select 'ABC,DEF' from dual union all
                          select 'ABC DEF' from dual
    -- end of on-the-fly sample table
    select  str,
            regexp_replace(str,'[-/, ]') new_str
      from  sample_table
    STR     NEW_STR
    ABC-DEF ABCDEF
    ABC/DEF ABCDEF
    ABC,DEF ABCDEF
    ABC DEF ABCDEF
    SQL> SY.

  • Removing unwanted characters from imported string

    Hello,
    I have a tab-delimited .txt file which I have to import into Indesign for further processing.
    The file is composed by a 3 columns header row at the beginning (Code, Description, price) followed by a series of 3 columns data rows.
    The problem is that sometimes, depending on the way the txt/csv file has been created, may include unwanted characters (such as spaces, double spaces, etc.).
    Is there a way to "clean" the imported strings from these unwanted characters?
    This is my starting code:
    function processImportedTxt(){
        //Open .csv file
        var csvFile = File.openDialog("Open file .csv","tab-delimited(*.csv):*.csv;");
        datafile = new File(csvFile);
        if (datafile.exists){
            datafile.open('r');
       var csvData = new Array();
       while(!datafile.eof){//read every row till the end of file
            csvData.push(datafile.readln());
        datafile.close();
        for(a=1; a<csvData.length; a++){
            var myRowData = csvData[a];//row of data
            var mySplitData = myRowData.toString().split("\t");//divide columns
            var myRowCode = mySplitData[0];
            var myRowDesc = mySplitData[1];
            var myRowPrice = mySplitData[2];
            // Here goes code for cleaning strings from unwanted characters
    processImportedTxt();
    Any help would be much appreciated
    Thanks in advance

    Hi,
    If you want to safe 1-space occurences just a small correction:
    i.e.:
    var myRowCode = mySplitData[0].replace(/\s\s+/g,'');
    Jarek

  • Reversing string without using StringBuffer

    Hello,
    I am needing some help in reversing a string like the one below:
    "go to Way" to the string "Way to go"
    I know by using a StringBuffer you can change it to "og ot yaW"
    but that is not what I am trying to do. I am just trying to change the order of the words within the string. Any help would be greatly appreciated.
    thanks

    Hi,
    I suggest that you use the BreakIterator of java.text which is better suited for natural language. I have modified the example from the javadocs to produce a method that does the job for a specified locale. You can always use Locale.getDefault() to obtain the default locale.
    String reverseWords(String sentence, Locale locale) {
        StringBuffer s = new StringBuffer();
        BreakIterator i = BreakIterator.getWordInstance(locale);
        i.setText(sentence);
        int end = i.last();
        for (int start = i.previous();
             start != BreakIterator.DONE;
             end = start, start = i.previous()) {
            s.append(sentence.substring(start, end));
        return s.toString();
    }The code:
    System.out.println(reverseWords("Way to go", Locale.getDefault()));yields the output:
    go to WayOf course, capitalization and punctuation is a much bigger problem to reverse in a meaningful way.
    Regards,
    S&oslash;ren Bak

  • Changeparticular characters in a string by using regular expressions ...

    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you

    SSU wrote:
    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you
    SQL> SELECT
      2  regexp_replace('sdfsdf Sdfdfs Sdfd','s|S','X') from dual;
    REGEXP_REPLACE('SD
    XdfXdf XdfdfX XdfdRegards,
    Achyut

  • Find the length of a String, without using any String API

    Hi All,
    I need to write an method which will accept String obj as an argument and will return its length, but method should not have any String API.
    Please help

    Simratpal wrote:
    Hi All,
    I need to write an method which will accept String obj as an argument and will return its length, but method should not have any String API.
    Please helpWell I have strongly argued against doing this, (it seems like a pointless exercise), and I have even stated that it cannot be done, even Reflection at some level will use a String method. I have not bothered to dissect wether the same is true with JNI. However, if we take the statement of the original problem exactly as stated, particularly the
    but method should not have any String API.i.e. we don't care if a String API is used 'under the covers', just so long as there is no direct usage in the new method that is written, then the answer is trivially easy:
    public class Main
        public static void main(String args[])
            Main worker = new Main();
            String str = "123456789";
            int len = worker.strLenUsingNoExplicitStringClassMethod(str);
            System.out.println("Length of string \""+str+"\""+" is "+len);
        public int strLenUsingNoExplicitStringClassMethod(String string)
            StringBuilder sb = new StringBuilder(string);
            return sb.length();
    }

  • How do you removing special characters from a string

    hi,
    i'm a novice to java, if you couldn't tell. i need to write a program to recognise palindromes (eg. madam etc.) but i can't work out how to strip or clean the input string of white space or punctuation. any help appreciated. by the way, any other ideas on how to go about it?? (i don't expect it to be done, just after guidance)
    my thanks in advance

    OK Here you are:
    protected static String removeJunk(String string)
              int i, len = string.length();
              StringBuffer dest = new StringBuffer(len);
              char c;
              for (i = (len - 1); i >= 0; i--)
                   c = string.charAt(i);
                   if (Character.isLetterOrDigit(c))
                        dest.append(c);
              return dest.toString();
    Klint

  • How to remove extra Characters in a string

    Hi,
    I have created a variable , that basically converts all the data from separate rows in one cell , but for some resons i am getting alot of commas between different values , for example
    Var_ Max concatnate  8 
    208016,,,,,207736,,,,,,205796,,,204476,204441,203521,111460,111382,110812,110504,110483,109908,,,101284, 
    but i want to show like
    i just want 1 "," after every  value , and deleting the last "," as well , like where every is more than 1 "," show just one "," and also dont show the coma after the last value
    so basically these are different values coming in on cell
    any logic of using SubString which can be used ?

    actually its coming as following
    Var_Ctegory 8 
    ,208016,,,,,207736,,,,,,205796,,,204476,204441,203521,111460,111382,110812,110504,110483,109908,,,101284, 

  • Remove Duplicates From Comma Separated String

    Hi,
    I have one Column which contains duplicates values with comma separated.
    Customer ID
    5,5,5,5,6,6,5,5,5,6,7,4,1,2,1,4,7,2
    I wrote this:
    select REGEXP_REPLACE('5,5,5,5,6,6,5,5,5,6,7,4,1,2,1,4,7,2', '(^|,)([^,]*)(,\2)+','\1\2') from dual;
    5,6,5,6,7,4,1,2,1,4,7,2
    But it eliminates only continuous elements.
    I want out put like:
    5,6,7,4,1,2
    Please help.
    Thanks.
    Amit
    Edited by: 987565 on Feb 12, 2013 4:02 AM

    Thanks Purvesh,
    While testing with real data, it is ignoring some values. I didn't understand why it happening.
    with data as
    select '5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5668,5716,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5714,5668,5716' col from dual
    select ltrim(max(sys_connect_by_path(col, ',')) keep (dense_rank last order by rn - 1), ',') col
    from (
    select col, row_number() over (order by 1) rn
    from (
    select distinct regexp_substr(col, '[^,]+', 1, level) col
    from data
    connect by level <= length(col) - length(replace(col, ','))
    start with rn = 1
    connect by prior rn = rn - 1;
    Result I got is:
    5714,5714,5716
    My Real Query is like that:
    declare
    cursor c1 is
    select o.id id
    from order o;
    v_char varchar2(200) := '';
    begin
    for a1 in c1 loop
    with data as
    select o.cust_id as col into v_char
    from order o
    where o.id = a1.id
    select ltrim(max(sys_connect_by_path(col, ',')) keep (dense_rank last order by rn - 1), ',') col
    from (
    select col, row_number() over (order by 1) rn
    from (
    select distinct regexp_substr(col, '[^,]+', 1, level) col
    from data
    connect by level <= length(col) - length(replace(col, ','))
    start with rn = 1
    connect by prior rn = rn - 1;
    SYS.dbms_output.put_line(v_char);
    end loop;
    end;
    Later, i will update same cust_id with v_char.

  • Remove duplicate photos from photos

    I upgraded to OS 10.10.3 which then allowed me to move my library of 10,000+ photos from iPhotos to the new Apple Photos program. After I moved the library I noticed I had some duplicates in my library.  These duplicates are not from the upgrade. They were there before the move.
    A year ago I used Duplicate Annihilator, a third party app, to remove the duplicates from iPhoto. It went through the iPhoto folder on my hard drive, identified the duplicates and allowed me to remove them. I cannot use this program/app now because there are no folders on my hard drive for Photos. They are all stored in iCloud.
    Any suggestions on how to identify and remove duplicates on iCloud in Photos without going through my library of 10,000+ photos individually?

    Not yet, but there should be one soon called PowerPhotos.

  • Remove regular expression from a string

    Hello,
    I have a string like this
    @1test;'"{input+
    Please help me to remove special characters from the string.

A: remove regular expression from a string

Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
            char,
            length TYPE i,
            index TYPE i.
length = STRLEN( str ).
WHILE length > index.
  char = str+index(1).
  WRITE char.
  if char CA '+-*/!`@#$%^&()_=[]{};'.               " Add/Remove here to include numbers
    REPLACE ALL OCCURRENCES OF char in str WITH ''.
    REPLACE ALL OCCURRENCES OF '"' in str WITH ''.  " characters "{}[] are not comparable
    REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
    REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
    length = STRLEN( str ).
    ENDIF.
  add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful .
Thanks,
Karthik

Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
            char,
            length TYPE i,
            index TYPE i.
length = STRLEN( str ).
WHILE length > index.
  char = str+index(1).
  WRITE char.
  if char CA '+-*/!`@#$%^&()_=[]{};'.               " Add/Remove here to include numbers
    REPLACE ALL OCCURRENCES OF char in str WITH ''.
    REPLACE ALL OCCURRENCES OF '"' in str WITH ''.  " characters "{}[] are not comparable
    REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
    REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
    length = STRLEN( str ).
    ENDIF.
  add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful .
Thanks,
Karthik

  • How to remove duplicates records from output ?

    how to remove duplicates records from output ?  i used delete adjacent but duplicates records are coming again ..suggest me

    hi shruthi,
    thanks for ur answer ..but duplicates records coming again
    here is my code >> plz check it out
    *& Report  ZCRM_TROUBLE_TICKET
    REPORT  zcrm_trouble_ticket.
    TYPES : BEGIN OF ty_qmih,
            qmnum TYPE qmnum,
            equnr TYPE equnr,
            iloan TYPE iloan,
            ausvn TYPE ausvn,
            ausbs TYPE ausbs,
            auztv TYPE auztv,
            auztb TYPE auztb,
            iwerk TYPE iwerk,
            END OF ty_qmih,
            BEGIN OF ty_qmel,
            qmnum TYPE qmnum,
            qmtxt TYPE qmtxt,
            indtx TYPE indltx,
            priok TYPE priok,
            strmn TYPE strmn,
            strur TYPE strur,
            ltrmn TYPE ltrmn,
            ltrur TYPE ltrur,
            objnr TYPE qmobjnr,
            arbpl TYPE lgwid,
            vkorg TYPE vkorg,
            vtweg TYPE vtweg,
            spart TYPE spart,
            END OF ty_qmel,
            BEGIN OF ty_ihpa,
            parnr TYPE i_parnr,
            parvw TYPE parvw,
            objnr TYPE qmobjnr,
            END OF ty_ihpa,
            BEGIN OF ty_crhd,
            arbpl TYPE arbpl,
            objid TYPE cr_objid,
            END OF ty_crhd,
            BEGIN OF ty_crtx,
            ktext TYPE cr_ktext,
            objid TYPE cr_objid,
            END OF ty_crtx,
            BEGIN OF ty_qmfe,
            fecod TYPE fecod,
            fegrp TYPE fegrp,
            qmnum TYPE qmnum,
            END OF ty_qmfe,
            BEGIN OF ty_qmur,
            urcod TYPE urcod,
            urgrp TYPE urgrp,
            urtxt TYPE urstx,
            qmnum TYPE qmnum,
            END OF ty_qmur,
            BEGIN OF ty_iloa,
            tplnr TYPE tplnr,
            iloan TYPE iloan,
            END OF ty_iloa,
            BEGIN OF ty_output,
            qmnum TYPE qmnum,
            equnr TYPE equnr,
           iloan TYPE iloan,
            ausvn TYPE ausvn,
            ausbs TYPE ausbs,
            auztv TYPE auztv,
            auztb TYPE auztb,
            iwerk TYPE iwerk,
            qmtxt TYPE qmtxt,
            indtx TYPE indltx,
            priok TYPE priok,
            strmn TYPE strmn,
            strur TYPE strur,
            ltrmn TYPE ltrmn,
            ltrur TYPE ltrur,
           objnr TYPE qmobjnr,
           arbpl TYPE lgwid,
            vkorg TYPE vkorg,
            vtweg TYPE vtweg,
            spart TYPE spart,
            parnr TYPE i_parnr,
            parvw TYPE parvw,
            arbpl TYPE arbpl,
           objid TYPE cr_objid,
           arbpl1 TYPE arbpl,
            ktext TYPE cr_ktext,
            fecod TYPE fecod,
            fegrp TYPE fegrp,
            urcod TYPE urcod,
            urgrp TYPE urgrp,
            urtxt TYPE urstx,
            tplnr TYPE tplnr,
            END OF ty_output.
    DATA : it_qmih TYPE STANDARD TABLE OF ty_qmih,
           it_qmel TYPE STANDARD TABLE OF ty_qmel,
           it_ihpa TYPE STANDARD TABLE OF ty_ihpa,
           it_crhd TYPE STANDARD TABLE OF ty_crhd,
           it_crtx TYPE STANDARD TABLE OF ty_crtx,
           it_qmfe TYPE STANDARD TABLE OF ty_qmfe,
           it_qmur TYPE STANDARD TABLE OF ty_qmur,
           it_iloa TYPE STANDARD TABLE OF ty_iloa,
           it_output TYPE STANDARD TABLE OF ty_output,
           wa_qmih TYPE ty_qmih,
           wa_qmel TYPE ty_qmel,
           wa_ihpa TYPE ty_ihpa,
           wa_crhd TYPE ty_crhd,
           wa_crtx TYPE ty_crtx,
           wa_qmfe TYPE ty_qmfe,
           wa_qmur TYPE ty_qmur,
           wa_iloa TYPE ty_iloa,
           wa_output TYPE ty_output.
    INITIALIZATION.
      REFRESH : it_qmih,
                it_qmel,
                it_ihpa,
                it_crhd,
                it_crtx,
                it_qmfe,
                it_qmur,
                it_iloa,
                it_output.
      CLEAR:     wa_qmih,
                 wa_qmel,
                 wa_ihpa,
                 wa_crhd,
                 wa_crtx,
                 wa_qmfe,
                 wa_qmur,
                 wa_iloa,
                 wa_output.
    start-of-selection.
      SELECT  qmnum
              equnr
              iloan
              ausvn
              ausbs
              auztv
              auztb
              iwerk
              FROM qmih
              INTO  TABLE it_qmih.
      SORT it_qmih BY qmnum .
      DELETE ADJACENT DUPLICATES FROM it_qmih COMPARING qmnum equnr iloan ausvn ausbs auztv auztb iwerk.
      SELECT   qmnum
               qmtxt
               indtx
               priok
               strmn
               strur
               ltrmn
               ltrur
               objnr
               arbpl
               vkorg
               vtweg
               spart
               FROM qmel
               INTO TABLE it_qmel
               FOR ALL ENTRIES IN it_qmih
               WHERE qmnum = it_qmih-qmnum.
      SORT it_qmel BY qmnum.
      DELETE ADJACENT DUPLICATES FROM it_qmel COMPARING  qmnum
                                                         qmtxt
                                                         indtx
                                                         strmn
                                                         strur
                                                         ltrmn
                                                         ltrur
                                                         objnr
                                                         arbpl
                                                         vkorg
                                                         vtweg
                                                         spart.
      IF it_qmel IS NOT INITIAL.
        SELECT parnr
               parvw
               objnr
               FROM ihpa
               INTO TABLE it_ihpa
               FOR ALL ENTRIES IN it_qmel
               WHERE objnr = it_qmel-objnr.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_ihpa COMPARING  parnr
                                                         parvw
                                                         objnr.
      IF it_qmel IS NOT INITIAL.
        SELECT arbpl
               objid
               FROM crhd
               INTO TABLE it_crhd
               FOR ALL ENTRIES IN it_qmel
               WHERE objid = it_qmel-arbpl.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_crhd COMPARING  arbpl
                                                         objid.
      IF it_qmel IS NOT INITIAL.
        SELECT ktext
               objid
               FROM crtx
               INTO TABLE it_crtx
               FOR ALL ENTRIES IN it_crhd
               WHERE objid = it_crhd-objid.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_crtx COMPARING ktext
                                                        objid.
      IF it_qmih IS NOT INITIAL.
        SELECT fecod
               fegrp
               qmnum
               FROM qmfe
               INTO TABLE it_qmfe
               FOR ALL ENTRIES IN it_qmih
               WHERE qmnum = it_qmih-qmnum.
      ENDIF.
      SORT it_qmfe BY qmnum.
      DELETE ADJACENT DUPLICATES FROM it_qmfe COMPARING fecod
               fegrp.
      IF it_qmih IS NOT INITIAL.
        SELECT urcod
               urgrp
               urtxt
               qmnum
               FROM qmur
               INTO TABLE it_qmur
               FOR ALL ENTRIES IN it_qmih
               WHERE qmnum = it_qmih-qmnum.
      ENDIF.
      SORT it_qmur BY qmnum.
      DELETE ADJACENT DUPLICATES FROM  it_qmur COMPARING urcod
                                                         urgrp
                                                         urtxt.
      IF it_qmih IS NOT INITIAL.
        SELECT  tplnr
                iloan
                FROM iloa
                INTO TABLE it_iloa
                FOR ALL ENTRIES IN it_qmih
                WHERE iloan = it_qmih-iloan.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_iloa COMPARING tplnr
                                                        iloan.
      LOOP AT it_qmih INTO wa_qmih.
        wa_output-qmnum = wa_qmih-qmnum.
        wa_output-equnr = wa_qmih-equnr.
       wa_output-iloan = wa_qmih-iloan.
        wa_output-ausvn = wa_qmih-ausvn.
        wa_output-ausbs = wa_qmih-ausbs.
        wa_output-auztv = wa_qmih-auztv.
        wa_output-auztb = wa_qmih-auztb.
        wa_output-iwerk = wa_qmih-iwerk.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_qmel INTO wa_qmel WITH KEY qmnum = wa_qmih-qmnum.
        wa_output-qmtxt = wa_qmel-qmtxt.
        wa_output-indtx = wa_qmel-indtx.
        wa_output-priok = wa_qmel-priok.
        wa_output-strmn = wa_qmel-strmn.
        wa_output-strur = wa_qmel-strur.
        wa_output-ltrmn = wa_qmel-ltrmn.
        wa_output-ltrur = wa_qmel-ltrur.
       wa_output-objnr = wa_qmel-objnr.
       wa_output-arbpl = wa_qmel-arbpl.
        wa_output-vkorg = wa_qmel-vkorg.
        wa_output-vtweg = wa_qmel-vtweg.
        wa_output-spart = wa_qmel-spart.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_ihpa INTO wa_ihpa WITH KEY objnr = wa_qmel-objnr.
        wa_output-parnr = wa_ihpa-parnr.
        wa_output-parvw = wa_ihpa-parvw.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_crhd INTO wa_crhd WITH KEY objid = wa_qmel-arbpl.
        wa_output-arbpl = wa_crhd-arbpl.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_crtx INTO wa_crtx WITH KEY objid = wa_crhd-objid.
        wa_output-ktext = wa_crtx-ktext.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_qmfe INTO wa_qmfe WITH KEY qmnum = wa_qmih-qmnum.
        wa_output-fecod = wa_qmfe-fecod.
        wa_output-fegrp = wa_qmfe-fegrp.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_qmur INTO wa_qmur WITH KEY qmnum = wa_qmih-qmnum.
        wa_output-urcod = wa_qmur-urcod.
        wa_output-urgrp = wa_qmur-urgrp.
        wa_output-urtxt = wa_qmur-urtxt.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = wa_qmih-iloan.
        wa_output-tplnr = wa_iloa-tplnr.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM it_output  COMPARING        qmnum
                                                                  equnr
                                                                  ausvn
                                                                  ausbs
                                                                  auztv
                                                                  auztb
                                                                  iwerk
                                                                  qmtxt
                                                                  indtx
                                                                  priok
                                                                  strmn
                                                                  strur
                                                                  ltrmn
                                                                  ltrur
                                                                  vkorg
                                                                  vtweg
                                                                  spart
                                                                  parnr
                                                                  parvw
                                                                  arbpl
                                                                  ktext
                                                                  fecod
                                                                  fegrp
                                                                  urcod
                                                                  urgrp
                                                                  urtxt
                                                                  tplnr.
    *CALL FUNCTION 'STATUS_TEXT_EDIT'
    EXPORTING
      CLIENT                  = SY-MANDT
      FLG_USER_STAT           = ' '
       objnr                   =
      ONLY_ACTIVE             = 'X'
       spras                   = en
      BYPASS_BUFFER           = ' '
    IMPORTING
      ANW_STAT_EXISTING       =
      E_STSMA                 =
      LINE                    =
      USER_LINE               =
      STONR                   =
    EXCEPTIONS
      OBJECT_NOT_FOUND        = 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.
    *CALL FUNCTION 'READ_TEXT'
    EXPORTING
      CLIENT                        = SY-MANDT
       id                            =
       language                      =
       name                          =
       object                        =
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
    tables
       lines                         =
    EXCEPTIONS
      ID                            = 1
      LANGUAGE                      = 2
      NAME                          = 3
      NOT_FOUND                     = 4
      OBJECT                        = 5
      REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    *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 IT_OUTPUT INTO WA_OUTPUT.
    *WRITE : / WA_OUTPUT-qmnum,
             WA_OUTPUT-equnr,
             WA_OUTPUT-iloan,
             WA_OUTPUT-ausvn,
             WA_OUTPUT-ausbs,
             WA_OUTPUT-auztv,
             WA_OUTPUT-auztb,
             WA_OUTPUT-qmtxt,
             WA_OUTPUT-indtx,
             WA_OUTPUT-strmn,
             WA_OUTPUT-strur,
             WA_OUTPUT-ltrmn,
             WA_OUTPUT-ltrur,
             WA_OUTPUT-objnr,
             WA_OUTPUT-arbpl,
             WA_OUTPUT-parnr,
             WA_OUTPUT-parvw,
             WA_OUTPUT-objid,
             WA_OUTPUT-ktext,
             WA_OUTPUT-fecod,
             WA_OUTPUT-fegrp,
             WA_OUTPUT-urcod,
             WA_OUTPUT-urgrp,
             WA_OUTPUT-urtxt,
             WA_OUTPUT-tplnr.
    *ENDLOOP.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          filename                        = 'E:\CRM1.TXT'
      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                      = ' '
      WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    IMPORTING
      FILELENGTH                      =
        TABLES
          data_tab                        = it_output
      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.

  • Maybe you are looking for

    • What the iPod touch really needs.

      So I may have missed a thread on this... But does it not seem logical that what the the iPod touch really needs bluetooth. I could care less about using bluetooth for audio, synking or anything else but 1 thing... Given that the iPhone is locked into

    • How do I get my volume to work on the 4s

      How do i get my volume to work again on my 4s it just stopped

    • IPhoto 6 need photo title or caption to display on DVD slideshow

      Is there a way to get caption or individual slide titles to appear on a slideshow for DVD? iMac G-5 Intel   Mac OS X (10.4.6)   Intel Processor

    • Ad hoc query without personnel no

      hi,     In Ad hoc query t.code S_PH0_48000510 ,infoset(/SAPQUERY/HR_ADM) when I select personnel no & issue output, system is displaying personnel name instead of personnel no. Is there any changes need to be done or is it a system bug ECC6. Regards,

    • Alt. key validation error blocks application (when attr is null) - bug?

      Hi OTN, I have an entity object on which an alternative key is defined: <Key     Name="SortingIndex_XAK2COMPONENT"     AltKey="true">     <DesignTime>       <Attr Name="_isUnique" Value="true"/>       <Attr Name="_DBObjectName" Value="COMPONENT_BA"/>