Replace characters between with single * in variable

Hi Experts ,
I want to replace all characters between <  > with *. Data is stored in variable type char255.
Example ,
Suppose variable contains : Wage Type <Wage Type> Not Valid For Interface ID <ID>
I want output as Wage Type * Not Valid For Interface ID *.
Thanks & Regards ,
Jigar Thakkar

Hi Jigar,
Find the length of the string and use DO...ENDDO statement. Inside the loop, didnt consider the text between < and > and move to another string and add * when  > is encountered in the string.
data:
  gv_len type i,
  gv_str type string value 'Wage Type <Wage Type> Not Valid For Interface ID <ID>',
  gv_rep_str type string,
  gv_flag type char1,
  gv_index type sy-index.
gv_len = strlen( gv_str ).
do gv_len times.
gv_index = sy-index - 1.
if gv_str+gv_index(1) = '<'.
gv_flag = 'X'.
continue.
elseif gv_str+gv_index(1) = '>'.
clear gv_flag.
concatenate gv_rep_str '*' into gv_rep_str.
continue.
elseif gv_flag is initial.
concatenate gv_rep_str gv_str+gv_index(1) into gv_rep_str.
endif.
enddo.
write:/ gv_rep_str.
Thanks,
Vinay
Edited by: Vinaykumar G on May 29, 2009 8:04 PM

Similar Messages

  • Firefox is replacing double quotes with single quotes.

    In WordPress and at other sites where I input and save text, Firefox is replacing double quotes with single quotes when I save. It's also showing double quotes as single quotes on websites. I tried uninstalling and reinstalling, and it's still happening.

    Do you have the needed font installed?
    *http://en.wikipedia.org/wiki/Punctuation

  • Replacing characters between specific characters

    Hello,
    I need to replace commas in a string with &#44; but only
    between " ".
    Does anyone know how to do this. I have looked high and low
    and tried many things, like trying to find where the first " starts
    and the last " but not being able to loop through the rest of the
    string to find other occurences.
    I would be extremly grateful for someones help/advice
    Chris

    I would do it in a Java class. Then use Coldfusion to create
    an object from that, for any given string. Equip the object with
    the following functionality.
    Function 1: For any given string s, create the corresponding
    String object,
    new String(s). Use a loop and the function indexOf("\"",
    fromIndex) to iteratively pick out the indices of all the quotes.
    If a quote occurs at index N, the next iteration starts with the
    value fromIndex=N+1. Store the quotes' indices in pairs (opening
    and closing quotes), for example, in a 2D array.
    Function 2: Given the original string object and an array of
    (beginIndex, endIndex) integer pairs, use the function charAt(n) to
    find where a comma occurs in the quoted parts of the string, and
    replace each such occurrence with &#44; . Here n is a dummy
    integer variable that ranges from beginIndex-1 to endIndex-1 for
    each pair of indices.
    The following snippet is an attempt I made with Coldfusion.
    However, it mistakenly fails to see indexOf as a function of the
    String object. And I, alas, am too busy with other things to pursue
    this line of interrogation with Coldfusion at the moment. I hope
    the snippet conveys enough of the flavour of Function 1 to inspire
    you to a solution.

  • Replacing " (double quote) with ' (single quote)

    Hi there,
    I have the following method to manipulate user input. All I want to do is, to replace the double quote with a single quote. The implementation I tried was,
    this.replace(desc, "\"", "'");
    This does not work for me. It jsut removes the double quote and does not introduces the single quote. Could any one please advise?
    Thanks,
    Des
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
         }

    Bad luck.. I am unable to get it still.
    This is the code I am using (implemetation is in a JSP. I am using this code to test it).
    public class Test{
    public static void main(String args[]){
         String s = args[0];
         Test t = new Test();
         String doubleQuote = "\"";
         System.out.println(" output :"+ t.replace(s,doubleQuote,"'"));
         //System.out.println(" output :"+ t.replace(s,"\"","'"));
         //System.out.println(" output :"+ t.replace('"', '\''));
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                             System.out.println(" line count :");
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
    }mshn02
    The main problem is I am stuck with the server's version of Java (which I have no control on it). I could not use 1.4.2

  • Replacing inconsistant spacing with single space in a string

    is it possible to replace multiple spaces within a string with one space only. Number of spaces is different all the time.
    say one field contains strings with imbedded spaces
    I need to replace all these values so that there will be only one space between words.
    For Eg.
    Input                             Expected Result
    aaa    bbb                       aaa bbb
    ww                vv             ww vv
    ww ss      kk                    ww ss kk
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    user11253970 wrote:
    I am in Oracle 9i :( I can not use reg exp
    Assuming strings do not contain CHR(0) (character with ascii code 0):
    SQL> SELECT  'aaa          bbb  aaa bbb' str,
      2          replace(replace(replace('aaa          bbb  aaa bbb',' ',' ' || CHR(0)),CHR(0) || ' '),CHR(0)) new_str
      3    FROM  dual
      4  /
    STR                                 NEW_STR
    aaa          bbb  aaa bbb           aaa bbb aaa bbb
    SQL> SY.

  • ACS - Replace IP Subnet with Single IP's

    Hi Everyone,
    I have been charged with a task to create individual entries in our ACS for each of our network devices. I am new to the ACS and the documentation does not seem to cover this scenario. Right now we have all our devices fall under a single subnet.
    When I try to create a device within the subnet, it tells me IP subnets overlap with those defined for device.
    If I try to change the existing IP Subnet to an IP range so I can exclude some devices from the IP Subnet, it tells me I cannot switch from IP Mask mode to IP Range mode.
    I am guessing I need to delete the the record for the IP subnet and add each device back individually. My concern is that none of my devices will work until I add each one back.
    Is this correct or is there a better way to go about this?
    Thanks,
    DC

    You can configure the default network device with the same settings ad your subnet, remove the subnet definition and re-add the hosts one by one. You can also use file import to reduce time.
    Sent from Cisco Technical Support Android App

  • Replacing multiple nodes with single node in OSB

    Hi,
    I have a case where I will get a xml like below:
    <LINEITEMS>
         <LINE_ITEM>
              <LINE_ITEMNO>1</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE1</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>3</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE3</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>1</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE2</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>3</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE4</MESSAGE>
         </LINE_ITEM>
    <LINE_ITEM>
              <LINE_ITEMNO>2</LINE_ITEMNO>
              <STATUS_CODE>1</STATUS_CODE>
              <MESSAGE>MESSAGE5</MESSAGE>
         </LINE_ITEM>
    </LINEITEMS>
    I need to make this as below:
    <LINEITEMS>
         <LINE_ITEM>
              <LINE_ITEMNO>1</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE1;MESSAGE2</MESSAGE>
         </LINE_ITEM>
         <LINE_ITEM>
              <LINE_ITEMNO>3</LINE_ITEMNO>
              <STATUS_CODE>0</STATUS_CODE>
              <MESSAGE>MESSAGE3;MESSAGE4</MESSAGE>
         </LINE_ITEM>
    <LINE_ITEM>
              <LINE_ITEMNO>2</LINE_ITEMNO>
              <STATUS_CODE>1</STATUS_CODE>
              <MESSAGE>MESSAGE5</MESSAGE>
         </LINE_ITEM>
    </LINEITEMS>
    I need to have only one entry for each line Item.
    Please let me know on the approach on how to do it in OSB.
    Thanks

    You can try this :-
    let $out:= <LINEITEMS>{ for $x in 1 to count($input/LINE_ITEM)
                                  let $LineItme := $input/LINE_ITEM[$x]/LINE_ITEMNO
                             let $match:= for $y in $x to count($input/LINE_ITEM)
                                  where $input/LINE_ITEM[$y]/LINE_ITEMNO= $LineItme
                                  return $input/LINE_ITEM[$y]/MESSAGE
                                  return
                                  <LINE_ITEM>
                                       <LINE_ITEMNO>{$LineItme/text()}</LINE_ITEMNO>
                                       <STATUS_CODE>{data($input/LINE_ITEM[$x]/STATUS_CODE)}</STATUS_CODE>
                                       <MESSAGE>{fn:data($match)}</MESSAGE>
                                  </LINE_ITEM>
    }</LINEITEMS>
    return $out
    You many then have to remove duplicates with line items. use fn:distinct() and then loop through.

  • Replacing many spaces with single space in a string

    Hi!
    I have the following strings:
    "Eric       B"
    "John                 A"
    "Mary Anne   C"But I want them to be like this:
    "Eric B"
    "John A"
    "Mary Anne C"Do anyone have an idea how to do this?
    Edited by: suladna on Aug 2, 2008 5:42 AM

    Use this:
    String s = "Mary    Anne   C";
    System.out.println(s.replaceAll("\\s+", " "));Edited by: prigas on Aug 2, 2008 6:15 AM

  • Creation of Variable with single values in BPS

    Dear All,
    I have a very basic requirement in creating variables that would accept single values from the user in BPS.
    Could anyone pls provide me the steps in doing so?
    I am able to create and use varibles with value ranges but could not find the option to create variables with  single values.
    Regards,
    Srini.

    Hi Raj,
    I have already been  thru SAP help file but,  though it says we can create variables with single values, it does not  provide any steps in creating it.
    Any suggestions?
    Regards,
    Srinivas Kamireddy.
    Edited by: Srinivas Kamireddy on Apr 25, 2008 7:59 PM

  • Replace multiple whitespaces in a string with single one

    Hi,
    I'm using Oracle 9.2.0 and I have a query on string manipulation.
    Can I replace multiple whitespaces within a string with single one. I tried with regexp_replace function but it is not supporting Oracle 9i.
    Can someone help me out?
    Regards,
    Pramod

    Just playing around:
    WITH
         Strings
    AS
          SELECT 'Can  I   replace      multiple  whitespaces   within    a     string    with single one' Text FROM Dual
    SELECT
         REPLACE
          REPLACE
           XMLAGG
            XMLElement
             "A",
             SubStr(Text, Level, 1)
           '</A>'
          '<A>'
         ) Text
    FROM
         Strings
    WHERE
         NOT
              Level > 1
          AND     SubStr(Text, Level, 1)          = ' '
          AND     SubStr(Text, Level - 1, 1)     = ' '
    CONNECT BY
         Level <= LENGTH(Text);

  • A formula with a formula variable with a replacement path delivers X

    A formula with a formula variable with a replacement path delivers X as a result if the characteristic of the replacement is not in the drilldown
    I have Created on ( date ) on which I have a Formula variable . I have used that Formula Variable in my calculated Key figure .
    Now the Problem is If I use Created on in ROW , The calculated key figure works . But if I don't use in Row , The calculated Key figure shows X . Situation is Users don't want to see Created on in ROW .
    If I use in row and hide also , then number of Records  will be same .
    Pls guide me what shoud I do .
    Is this problem related to support pack .

    hi
    i would like to know how to create the replacement path and authorisation variables.
    what are the steps we need to follow in rsa1.
    Edited by: vasu reddy on Apr 9, 2008 11:28 AM

  • How to avoid SYSTEM_NO_TASK_STORAGE  with multiple single values variable

    Hi experts,
    I am trying to do a distribution with reference data standart SAP function.
    Fields to be changed:
    ZPDHIER2 (Economic Group II)
    ZPDHIER3 (Economic Group III)
    ZPDCLIENT (Client)
    Fields for condition:
    KEY FIGURE NAME
    Fields for reference:
    KEY FIGURE NAME
    ZPDSTATUS (Status)
    FISCPER3 (Fiscal Period)
    The parameters group is like:
    Fields for condition:
    Key figure: ZM_070 (one of the key figures)
    Fields for reference:
    Key figure: ZMONT_TN
    FISCPER3: 001
    Status: DE
    - "Only distribute not assigned" is checked
    I do not want the data to be distributed by any ZPDHIER2, ZPDHIER3 and ZPDCLIENT so I have restricted these characteristics in the planning level by some variables. These variables are user exit type and return multiple single values.
    The issue regarding this message is that when I execute this function, depending on the size of the data brought by ZPDCLIENT user exit variable, this dump might or might not occur. As for the testing I've done, i realize that if the number of clients exceed 500, dump will occur.
    This multiple single values variable (or any other solution) must be prepared for 3900 clients, and this number is expected to increase.
    Anyone have faced same problem?
    Hope you can provide me some help regarding this issue.
    Tanks in advance,
    André Oliveira

    Hi Wadih saad,
    I think the memory is not suffcient to hold the load. Check your swap space and memory during the client export and also check whether there is sufficient space in the hard disk to hold the export files.
    You must have calculated the client size by using the test run. This size must be available as free space in hard disk to do the export.
    Make the available space and do the export it will work.
    Regards,
    Maheswaran J

  • Find and replace a single global variable

    Hello,
    I have a GUI which needs to be replicated 10 times. the variables in the global file also needs to be replicated ten times. ex: if GUI1 is using global variables GUI1_TestMode, GUI1_Result etc,  GUI2 should use GUI2_TestMode, GUI2_Result and GUI3 should use GUI31_TestMode, GUI3_Result etc.  So, once I have saved GUI1 as GUI2, I need a way to select all GUI1_TestMode in GUI2 and replace it with with GUI2_TestMode.
    I tried find and replace in the edit menu, but it finds all the global variables together. 
    there are about 40 such global variables associated with each GUI and I dont think it will be sane to sit down, rename all of them in the global file, click on each variable and change them.  I really hope I dont have to do that.
    I am using Labview 8.6
    Thanks.

    Hi pcs,
    instead of using 40 globals per GUI with upto 10 different GUIs you really should redesign your program.
    I would suggest a FGV/AE handling those global data for all of those GUIs…
    The quick & dirty way would be to use LabVIEW's VI linking scheme:
    - Create your global VI with all needed variables. Create your "GUI" and connect it with that global VI.
    - Now you copy your GUI to create a new one, this will still be linked to your "global VI".
    - Then copy the global VI to create a new instance with a different name ("global2.vi") and ZIP (and remove) the original one.
    - When you now open the global2.vi it will search for your orginal "global.vi". Then you simply direct it to use "global2.vi" instead…
    - Repeat those steps for all other GUI-VIs…
    As said before: QUICK & DIRTY!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Replace Site for Completed Event with Single Page

    I created a Muse site for an event that is now over. I want to replace the site with a simple single page that says something like "thanks for participating" but I want to keep the site intact for a future use. What's the best way to handle this?

    Hi
    You can create a new page with the message and no menu options for surfing the site and then drag the page to replace home page and then upload the site again.
    Thanks,
    Sanjit

  • Dynamic SQL and Data with Single Quotes in it.

    Hi There,
    I have a problem in that I am using dynamic SQL and it happens that one of the columns does contain single quotes (') in it as part of the data. This causes the resultant dynamic SQL to get confused as the single quote that is part of the data is taken to mean end of sting, when in fact its part of the data. This leaves out a dangling single quote that was meant to enclose the string. Here is my dynamic SQL and the result of the parsed SQL that I have captured:
    ****Dynamic SQL*****
    l_sql:='select NOTE_TEMPLATE_ID '||
    'FROM TMP_NOTE_TEMPLATE_VALUES '||
    'where TRIM(LEGACY_NOTE_CODE)='''||trim(fp_note_code)||''' '||
    'and TRIM(DISPLAY_VALUE)='''||trim(fp_note_text)||''' ';
    execute immediate l_sql INTO l_note_template_id;
    Because the column DISPLAY_VALUE contains data with single quotes, the resultant SQL is:
    ******PARSED SQL************
    select NOTE_TEMPLATE_ID
    FROM TMP_NOTE_TEMPLATE_VALUES
    where TRIM(LEGACY_NOTE_CODE)='INQ' and TRIM(DISPLAY_VALUE)='Cont'd'
    And the problem lies with the single quote between teh characters t and d in the data field for DISPLAY_ITEM. How can I handle this?
    Many thanks,

    I have been reliably informed that if one doesn't enclose char/varchar2 data items in quotes, the right indices may not be usedI am into oracle for past 4 years and for the first time i am hearing this.
    Your reliable source is just wrong. Bind variables are variables that store your value and which are used in SQL. They are the proper way to use values in your SQL. By default all variables in PL/SQL is bind variable.
    When you can do some thing in just straight SQL just do it. Dynamic SQL does not make any sense to me here.
    Thanks,
    Karthick.

Maybe you are looking for

  • If I turn on Adobe File Sync will that duplicate files in my Dropbox? (Unnecessary and I can't afford the bandwidth).

    I have gigabytes of Adobe CC files arranged in appropriate client folders in Dropbox (and mirrored on my local hard drive). It looks like if I turn File Sync on (needed to access Assets) some or all of this will be duplicated and separated from non-A

  • Authorization for cost centers in KSV8  allocation T-code

    Hi all, I know it is possible to set an authorization in allocation T-code KSV8 based on the cost center. In the KSV8 transaction, there is a sender, a receiver and obviously in my case the sender is different to the receiver. The following step for

  • Subtitles can I use text from FCP?

    Hey, Can I use text I created in FCP and use it in DVD SP? Also, if I have a feature film that needs translation, what should I ask for? I mean is there EDL or OMF kind of file that DVD SP need? a

  • Applet TV Shares - Does NOT HOME Share

    Computers can 'HOME share' computer iTunes libraries with other computers signed in on other iTune account. Apple TV can not do this HOME share. Apple TV only 'shares' libraries from computers which have signed in using the same iTunes account. How d

  • Attached disk missing after VM upgrade

    Tonight I upgraded my Linux VM from A6 to D13. I then restarted the machine. Afterwards the attached disk (which happened to hold my entire web directory and document storage folders) was no longer attached. Unfortunately I'm not certain of the name