Complex substr issue.

'abcd def$ff>def$nsfdef$'
i have above string and need to replace 'def' with some string but only those occurance where space is not before it ..
output :-
'abcd def$ff>xyz$nsfdef$'

select regexp_replace('abcd def$ff>def$nsfdef$','([^ ])(def)','\1XXX') str
from dual;
abcd def$ff>XXX$nsfXXX$And if you need to replace only the first occurance (As your sample output says) use the below
select regexp_replace('abcd def$ff>def$nsfdef$','([^ ])(def)','\1XXX',1,1) str
from dual;
abcd def$ff>XXX$nsfdef$And without using regular expressions
--Assuming "~" will not occur in your string.
select replace(replace(replace('abcd def$ff>def$nsfdef$',' def',' ~~~'),'def','XXX'),'~~~','def') str
from dual;
abcd def$ff>XXX$nsfXXX$

Similar Messages

  • XSLT substring issue

    Hi All,
    I've got XSLT issue.
    Suppose in XML I have string like that :
    world.country.town.Moskow.SomeOtherValue
    Capitalized word/s/ is/are/ always at the end.
    Using XSLT how to get substring returning capitalized words only i.e Moskow.SomeOtherValue
    Thanks

    Hi,
    Here are two possible solutions :
    1) If you can run XSLT 2.0, then you may use a regular expression :
    Sample XML :
    <test>world.country.town.Moskow.SomeOtherValue</test>
    <?xml version="1.0"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="/">
    <xsl:analyze-string select="test" regex="\.([A-Z].*)$">
      <xsl:matching-substring>
        <result><xsl:value-of select="regex-group(1)"/></result>
      </xsl:matching-substring>
    </xsl:analyze-string>
    </xsl:template>
    </xsl:stylesheet>
    output :
    <result>Moskow.SomeOtherValue</result>2) With XSLT 1.0, you can use a recursive template to analyze the string :
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="/">
      <result>     
        <xsl:call-template name="find_cap_words">
          <xsl:with-param name="in" select="test"/>
        </xsl:call-template>
      </result>
    </xsl:template>
    <xsl:template name="find_cap_words">
      <xsl:param name="in"/>
      <xsl:variable name="rem" select="substring-after($in,'.')"/>
      <xsl:choose>
        <xsl:when test="translate(substring($rem,1,1),'_ABCDEFGHIJKLMNOPQRSTUVWXYZ','_')=''">
              <xsl:value-of select="$rem"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="find_cap_words">
            <xsl:with-param name="in" select="$rem"/>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    output :
    <result>Moskow.SomeOtherValue</result>Hope that helps.

  • .substring issues

    hi, i am learning java in class for school, and in my project i have one issue with the .substring method of strings.
    my code is
    import java.util.Scanner;
    public class Valid
         private String lastName;
         private String email;
         private boolean oneSymbol;
         private boolean nonBlankLeft;
         private boolean onePeriod;
         private boolean nonBlankBoth;
         Valid()
         public void readData(Scanner input)
              lastName = input.next();
              email = input.next();
         public void checkSymbol()
              String s = email.substring(0);
              int count = 0;
              int x;
              x = s.indexOf('@');
              while (!(x == -1))
                   s = s.substring(0,x) = s.substring(x+1);
                   count++;
                   x = s.indexOf('@');
              if (count == 1)
                   oneSymbol = true;
              else
                   oneSymbol = false;
         public void checkNonBlankLeft()
              int x = email.indexOf(" @");
              if (x == -1)
                   nonBlankLeft = true;
              else
                   nonBlankLeft = false;
         public void checkOnePeriod()
              String s = email.substring(0);
              int count = 0;
              int x;
              x = s.indexOf('.');
              while (!(x == -1))
                   s = s.substring(0,x) = s.substring(x+1);
                   count++;
                   x = s.indexOf('.');
              if (count >= 1)
                   onePeriod = true;
              else
                   onePeriod = false;
         public void checkNonBlank()
              int x = email.indexOf(" . ");
              if (x == -1)
                   nonBlankBoth = true;
              else
                   nonBlankBoth = false;
         public void writeResults(java.io.PrintWriter outputValid, java.io.PrintWriter outputInvalid)
              if (oneSymbol && nonBlankLeft && onePeriod && nonBlankBoth)
                   outputValid.printf("%-15s%-30s", lastName, email + "\n");
              else
                   outputInvalid.printf("%-15s%-30s", lastName, email + "\n");
                   if (oneSymbol == false)
                        outputInvalid.printf("%45s%-30s", " ", "@ symbol must occur once\n");
                   if (nonBlankLeft == false)
                        outputInvalid.printf("%45s%-30s", " ", "Must be a character before the @ symbol\n");
                   if (onePeriod == false)
                        outputInvalid.printf("%45s%-30s", " ", "Must contain one . (period)\n");
                   if (nonBlankBoth == false)
                        outputInvalid.printf("%45s%-30s", " ", "Both sides of . must be contain a character\n");
    } i have issues with both .substring methods and i get these errors.
    .\Valid.java:31: unexpected type
    required: variable
    found : value
    s = s.substring(0,x) = s.substring(x+1);
    ^
    .\Valid.java:58: unexpected type
    required: variable
    found : value
    s = s.substring(0,x) = s.substring(x+1);
    ^
    2 errors

    georgemc wrote:
    boulbrokdrm wrote:
    thank you, you just showed me that i am a complete idiot lol
    i ment to use + instead of =, just forgot to press the shift key i guess, but it should work now, thank youLol, easiest 10 dukes I ever made.If you made them why are they still just sitting there waiting to be awarded?
    Hint, hint - OP, YOU NEED TO AWARD THEM

  • MinimumPasswordAge and Password must meet complexity requirements issue

    Hi Experts,
    Our Setup
    Windows Server 2003 Enterprise domain
    Windows XP SP3 client boxes
    Password policy setup
    MinimumPasswordAge - 35
    MinimumPasswordLength - 8
    Password must meet complexity requirements - Enabled
    EnforcePasswordHistory - 8
    These were not enabled since beginning. We enabled the settings few days back. Now few of the users can't change the password. They get the following error "Password must meet the complexity requirements". One of the user has his username as the password
    and now he is trying to change 'Mymother1954!' and it doesn't work.
    'P@ssw0rd!' doesn't work as well.
    Tried changed the MinimumPasswordAge to 0. No help. I am unsure the older (prior to the current policy setup) would be remembered. Even if it does why wouldn't it allow the user to change a unique password?
    I need your experts suggestion to resolve the issue. Thanks for your help in advance.
    Regards,
    MPC

    gpresult /v shows that the policy is getting applied successfully. So GPO isn't an issue here I guess.
    Here is the output
            Account Policies
                GPO: Default Domain Policy
                    Policy:            MinimumPasswordAge
                    Computer Setting:  35
                GPO: Default Domain Policy
                    Policy:            PasswordHistorySize
                    Computer Setting:  8
                GPO: Default Domain Policy
                    Policy:            MinimumPasswordLength
                    Computer Setting:  8
                GPO: Default Domain Policy
                    Policy:            LockoutBadCount
                    Computer Setting:  N/A
                GPO: Default Domain Policy
                    Policy:            MaximumPasswordAge
                    Computer Setting:  45
    Regards,
    MPC

  • Complex Urgent Issue with insertRowAtRangeIndex

    Hi,
    I have an advanced table based on a VO and EO. I have a footer on that table which has an Add Row button. That Add Row button calls a method in the AM which basically inserts a new row into the VO and hence it appears in the table. The code for that method in the AM is pasted below.
    Now this table and Add Row button etc. were already existing. My job was to add a new detail table to this table. I followed the instructions in the dev guide and was able to successfully add a detail table to this table. I also had to initialize some rows in the detail table when the user clicks the above add rows button.
    In the below code, getBtvlPosSupplierPlantAddressesVO is my VO for the main table.
    getAsiSupplierAddressOpCosVO2 is my VO for the detail table. "AsiSupplierAddressOpCosVO2" is the View Instance which is connected to BtvlPosSupplierPlantAddressesVO through a View Link.
    getAsiPosSupplierOpCosVO1 is my VO from where I get the data to initialize the rows in AsiSupplierAddressOpCosVO2.
    I am getting the following error on the statement - plantAddressVO.insertRowAtRangeIndex(plantAddressVO.getFetchedRowCount(), plantAddressVORow);
    oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidParamException: JBO-25006: Invalid parameter value 3 for rangeIndex passed to method ViewRowSetIteratorImpl.insertRowAtRangeIndex. Explanation: index outside range
    Now the main table property of "Records Displayed" is 2, hence I am getting the above error when I am trying to add THIRD row using the Add Rows button.
    If I change the "Records Displayed" property to 5, then I will get this error when I try to add Row number 6.
    PLEASE PLEASE HELP. I HAVE NO CLUE WHY THIS IS HAPPENING. I AM TIRED OF DEBUGGING!
    **********Extra Info - May not be relevant to the Issue ****************
    For new rows in AsiSupplierAddressOpCosVO2, I have put status as STATUS_NEW because the detail table has a checkbox and if I don't do STATUS_NEW for the rows, then only the rows for which user clicks on the checkbox will be stored in the DB. I wanted all rows to be stored, for consistency purpose.
    **********Extra Info - May not be relevant to the Issue ****************
    public void addPlant(Number suppRegId)
    BtvlPosSupplierAddressesVOImpl plantAddressVO = getBtvlPosSupplierPlantAddressesVO();
    plantAddressVO.setMaxFetchSize(0);
    BtvlPosSupplierAddressesVORowImpl plantAddressVORow = (BtvlPosSupplierAddressesVORowImpl)plantAddressVO.createRow();
    plantAddressVORow.setAddressId(getOADBTransaction().getSequenceValue("btvl.btvl_pos_supp_address_id_SEQ"));
    plantAddressVORow.setAddressType("PLANT");
    plantAddressVORow.setSupplierRegId(suppRegId);
    plantAddressVO.insertRowAtRangeIndex(plantAddressVO.getFetchedRowCount(), plantAddressVORow);
    AsiSupplierAddressOpCosVOImpl addressOpCosVO = (AsiSupplierAddressOpCosVOImpl)this.getAsiSupplierAddressOpCosVO2();
    addressOpCosVO.executeQuery();
    AsiPosSupplierOpCosVOImpl suppOpCosVO = (AsiPosSupplierOpCosVOImpl)this.getAsiPosSupplierOpCosVO1();
    int rowCount = suppOpCosVO.getRowCount();
    RowSetIterator SupplOpCoListIter = suppOpCosVO.createRowSetIterator("SupplOpCoListIter");
    AsiPosSupplierOpCosVORowImpl OpCoRow = null;
    if(rowCount > 0)
    SupplOpCoListIter.setRangeStart(0);
    SupplOpCoListIter.setRangeSize(rowCount);
    for(int i = 0; i < rowCount; i++)
    OpCoRow = (AsiPosSupplierOpCosVORowImpl)SupplOpCoListIter.getRowAtRangeIndex(i);
    AsiSupplierAddressOpCosVORowImpl addressOpCoRow = (AsiSupplierAddressOpCosVORowImpl)addressOpCosVO.createRow();
    addressOpCoRow.setSuppAddrOpcoId(getOADBTransaction().getSequenceValue("BTVL.ASI_SUPP_ADDR_OPCO_ID_S"));
    addressOpCoRow.setAddressId(plantAddressVORow.getAddressId());
    String OpCoCode = OpCoRow.getSupplierOpcoCode();
    String OpCoName = OpCoRow.getSupplierOpcoName();
    addressOpCoRow.setSupplierOpcoCode(OpCoCode);
    addressOpCoRow.setSupplierOpcoName(OpCoName);
    addressOpCoRow.setNewRowState(Row.STATUS_NEW);
    addressOpCosVO.insertRow(addressOpCoRow);
    SupplOpCoListIter.closeRowSetIterator();
    plantAddressVORow.setNewRowState(Row.STATUS_INITIALIZED);
    }

    Hi
    Since you have added the detail table as routine customization than you also initialize the row as routine customization, as you said that the getAsiSupplierAddressOpCosVO2 is the VO for detail table than the row this VO is required to initialize, as Sumit advised already, you should go with addition of new code rather modifiying/using the existing code , you can give a try to below code after modifying it according to ur requirement
    OAViewObject vo = (OAViewObject)findViewObject("AsiSupplierAddressOpCosVO2");
    if(!vo.isPreparedForExecution())
    vo.clearCache();
    vo.executeQuery();
    vo.last();
    vo.next();
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState((byte)-1);
    // than here you can set the default values
    like row.setAttribute("ViewAttribute",vaue);
    Thanks
    Pratap

  • DBMS_LOB.Substr Issues

    Hello everyone,
    I'm trying to use dbms_lob.substr on a clob column in one of my tables. I'm searching the table for a particular phrase, which should be the first two words in this column. Any row that has that phrase should be returned. However, when I run the script, I get only rows where the ONLY words in the entire column are the two words. Here's an example
    | ID | | Name | | Information |
    | 1 | | Jorge | | Terminated for negligence |
    | 2 | | Stephanie | | Terminated for ... ? |
    I need the script to return both of those rows.
    Here's my script:
    WHERE
    dbms_loc.substr("EMPLOYEE"."COMMENTS", 15, 1)='Terminated for'
    Thanks,
    Joe

    Nevermind, fixed it by adding a space to the end of the search string.
    They really need a delete feature up here.

  • Recursive structure - complex mapping issue

    I have a recursive structure involved mapping requirement. here is the issue simplified...
    Source is a details about person which has a element called father which itself is of the type person. Target is just a list or person with n father attribute. Target has to have all the persons, father and father's father with no limitation. Below are the XSDs and XML for source and target. I know I can do this in java or abap mapping or even xslt, but is it possible to achieve this in the mapping too? Any help will be appreciated and rewarded.
    No where in the forum or blog I could find a sample mapping.
    <b>Sorry for the long post</b>
    Thanks
    <b>Source XML</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:PersonsMT xmlns:ns0="http://xyz.com/scratchpad">
       <Persons>
          <Person>
             <Name>Smith</Name>
             <Height>22</Height>
             <Father>
                <Name>Paul</Name>
                <Height>23</Height>
                <Father>
                       <Name>Sr Paul</Name>
                       <Height>23</Height>
                <Father/>
             </Father>
             </Father>
          </Person>
          <Person>
             <Name>Brad</Name>
             <Height>22</Height>
             <Father>
                <Name>Luke</Name>
                <Height>23</Height>
                <Father/>
             </Father>
          </Person>
       </Persons>
    </ns0:PersonsMT>
    <b>Expected output:</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:PersonsListOutputMT xmlns:ns0="http://xyz.com/scratchpad">
    <Persons>
         <Person>
              <Name>Smith</Name>
              <Height>22</Height>
         </Person>
         <Person>
              <Name>Paul</Name>
              <Height>23</Height>
         </Person>
         <Person>
              <Name>Sr Paul</Name>
              <Height>23</Height>
         </Person>
         <Person>
              <Name>Brad</Name>
              <Height>22</Height>
         </Person>
         <Person>
              <Name>Luke</Name>
              <Height>23</Height>
         </Person>
    </Persons>
    </ns0:PersonsListOutputMT>
    <b>Source Schema:</b>
    <i>Message Type: PersonsMT</i>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xyz.com/scratchpad" targetNamespace="http://xyz.com/scratchpad">
         <xsd:element name="PersonsMT" type="PersonsDT" />
         <xsd:complexType name="PersonDT">
              <xsd:annotation>
                   <xsd:appinfo source="http://sap.com/xi/TextID">
                   34bfd3107ba111dcc4e600188b447e47
                   </xsd:appinfo>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="Name" type="xsd:string">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             56bf53607b7d11dca285000f1ffb32b9
                             </xsd:appinfo>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:element name="Height" type="xsd:string">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             56bf53617b7d11dcc38a000f1ffb32b9
                             </xsd:appinfo>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:element name="Father" type="PersonDT">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             56bf53627b7d11dccc3d000f1ffb32b9
                             </xsd:appinfo>
                        </xsd:annotation>
                   </xsd:element>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="PersonsDT">
              <xsd:annotation>
                   <xsd:appinfo source="http://sap.com/xi/TextID">
                   34bd89227ba111dcc2fa00188b447e47
                   </xsd:appinfo>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="Persons" maxOccurs="unbounded">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             9915e6707b7d11dcadc7000f1ffb32b9
                             </xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="Person" type="PersonDT">
                                       <xsd:annotation>
                                            <xsd:appinfo source="http://sap.com/xi/TextID">
                                            9915e6717b7d11dc8f84000f1ffb32b9
                                            </xsd:appinfo>
                                       </xsd:annotation>
                                  </xsd:element>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>
    <b>Target Schema:</b>
    <i>Message Type: PersonsListOutputMT</i>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xyz.com/scratchpad" targetNamespace="http://xyz.com/scratchpad">
         <xsd:element name="PersonsListOutputMT" type="PersonListOutputDT" />
         <xsd:complexType name="PersonListOutputDT">
              <xsd:annotation>
                   <xsd:appinfo source="http://sap.com/xi/TextID">
                   380defd37ba511dcb27400188b447e47
                   </xsd:appinfo>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="Persons" maxOccurs="unbounded">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             edfc5ae07b9e11dca41b001422795f21
                             </xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="Person">
                                       <xsd:annotation>
                                            <xsd:appinfo source="http://sap.com/xi/TextID">
                                            edfc5ae17b9e11dcb186001422795f21
                                            </xsd:appinfo>
                                       </xsd:annotation>
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element name="Name">
                                                      <xsd:annotation>
                                                           <xsd:appinfo source="http://sap.com/xi/TextID">
                                                           edfc5ae27b9e11dc9e93001422795f21
                                                           </xsd:appinfo>
                                                      </xsd:annotation>
                                                 </xsd:element>
                                                 <xsd:element name="Height">
                                                      <xsd:annotation>
                                                           <xsd:appinfo source="http://sap.com/xi/TextID">
                                                           edfc5ae37b9e11dcb5e1001422795f21
                                                           </xsd:appinfo>
                                                      </xsd:annotation>
                                                 </xsd:element>
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>
    Message was edited by:
            xi_ted
    Message was edited by:
            xi_ted

    Hi,
    Can you please cheack your generated source and target WSDL. According to me, you need some modification in that. You can generate xd using xmlspy.
    context will be the problem in graphical mapping as well as xslt. So best is to go for java mapping for this.
    In graphical mapping you can generate required target provided you know max hirarchy for father. In that case its possible to use graphical mapping.
    -Kavita

  • Substr issue

    I have a column called vehicle desc
    which will have this type of info in it:
    "2007 light blue Kawasakme Eclipse"
    or
    "2006 cream Toyotwa Forerunner"
    I need to pull this data into three separate columns called YEAR, MAKE, and MODEL.
    I can pull out the year with a simple substr, but as you can see the position of the make and model varies.
    Luckily there are only about 12 makes, and the model always follows the make.
    Any ideas? Do I have to make a long "case" statement or "with" clause?

    Here if only the last word in the string is MODEL then you can start cutting the string from end and cut it till first space from end of string.
    If MODEL includes the last two words then pick up the first letters of the words after the space from the end using substr, instr.

  • SubStr Issue with Query

    I will give a great thanks for help with this. I have a table with a number field called "lotnum". Each rows "lotnum" has a value of 1000, 1001, 1002, 1003....2000, 2001, 2003, ..etc.) The parent row is always the one ending in zero (i.e.: 1000, 2000, 12000, etc....are all the parents). The children all end in 1,2,3,4...etc.. My problem is that another field (let's call it "x_dev") should have a value for not only the parent but also the child, but they do not. I need a query that will help me compare the parent's "x_dev" value with the value of all of the childrens "x_dev" values to determine if they are the same or not.
    Sample Data:
    Lotnum x_dev
    1000 20
    1001 Null
    1002 Null
    2000 20
    2001 Null
    (i.e: compare 1000 (parent) with the children (1001 & 1002) to determine if the "x_dev" value is the same and if not set it equal to the parent. I know I will have to probably use instr or substr going from right to left since the only constant is that the last three digits represent the children. The remaining digits are the parent (1, 10, 100, 1000), so the value could range from 1000 - 1000000)
    Thanks alot
    Edited by: kirkladb on Jul 14, 2012 12:09 PM

    select  t1.lotnum,
            t2.lotnum parent_lotnum,
            t1.dev_x,
            t2.dev_x parent_dev_x
      from  tbl t1,
            tbl t2
      where mod(t1.lotnum,1000) != 0
        and t2.lotnum = trunc(t1.lotnum / 1000) * 1000
        and lnnvl(t2.dev_x = t1.dev_x)
        LOTNUM PARENT_LOTNUM      DEV_X PARENT_DEV_X
          1002          1000                      20
          1001          1000                      20
          2001          2000                      20
    SQL> Or if this will be more readable to you:
    select  t1.lotnum,
            t2.lotnum parent_lotnum,
            t1.dev_x,
            t2.dev_x parent_dev_x
      from  tbl t1,
            tbl t2
      where mod(t1.lotnum,1000) != 0
        and t2.lotnum = trunc(t1.lotnum / 1000) * 1000
        and (t2.dev_x != t1.dev_x or t1.dev_x is null)
        LOTNUM PARENT_LOTNUM      DEV_X PARENT_DEV_X
          1002          1000                      20
          1001          1000                      20
          2001          2000                      20
    SQL> SY.

  • Complex discount issue

    i have below situation
    Client has many discount payment terms.and client does not want to take discount, if theyare running paymen program in last two weeks of each quarter end.
    as there are four quarters inthe year and at the end of each quarter, in last two weeks of each quarter, if they run F110 and if any discount qualifies inthe payment run, then they dont want to take it. but after the close of the quarter end they will take discount in all the payment run.
    is there any switch which can be turned off to not to take discount?
    please share you thoughts
    thnks

    Financial Accounting > Accounts Receivable and Accounts Payable >Business Transactions>Outgoing Payments>Outgoing Payments Global Settings>Configure Automatic Generation of Cash Discount Documents
    try this iam not sure about the concept...may be useful
    VVR

  • Substring() Issue

    Hi,
    I have a string with the following content:
    String1
    String2
    With other words: "\n\n\n\nString1\nString2"
    How can I extract String1 & String2 from the whole string?
    Thanks in advance!

    I am sorry I should have made it clear that I am
    limited to J2ME as the String is in a MIDlet.
    Please advice if there is a way of extracting the
    required Strings!
    Thank you!I'm in a good mood. Here's a start:    public String[] mobileSplit(String text, String delimiterChars) {
            String[] array = new String[text.length()];
            int found = 0;
            StringBuffer buffer = new StringBuffer(); 
            for(int i = 0; i < text.length(); i++) {
                char ch = text.charAt(i);
                if(delimiterChars.indexOf(ch) == -1) {
                    buffer.append(ch);
                } else if(buffer.length() > 0) {
                    array[found++] = buffer.toString();
                    buffer = new StringBuffer();
            if(buffer.length() > 0) {
                array[found++] = buffer.toString();
            String[] returnArray = new String[found];
            for(int i = 0; i < found; i++) {
                returnArray[i] = array;
    return returnArray;
    You can call it like this:        String[] array = mobileSplit(
                    "\n\n\n \n\n\nString1\n String2 \n", // The String to split
                    "\n ");                              // Splits the newline- and whitespace character Note: untested code!
    Good luck.

  • Complex selection issue

    Hello,
    Is it possible to tell Pages to select all text with, say, font size 17?
    I have a texte with a bunch of different fonts and font sizes, and would like to apply changes to them. For example, I'd like to change all the text that is 17 to 12 without affecting all the other font sized text.
    I tried with paragraph and character styles to no avail...
    Loa

    "In the end I have to do the first pass manually..."
    Well, sort of, but it's not an arduous process.
    Select all of the text in one paragraph.
    Set the font, size, and any other attributes you want for the desired style.
    Leave the paragraph selected, or just leave the insertion point somewhere in the paragraph.
    Go View > Show Styles Drawer.
    In the styles drawer, you should see Body highlighted, and a red triangle to the right end of the selection highlight. Click the red triangle and select the first item in the menu that appears—Create new paragraph style from selection.
    Name the style.
    You now have a named style contining the attributes you set in the steps above.
    Double click in the next paragraph to which you want to apply this style.
    Press and hold the command key, and double click in each of the other paragraphs to which you want to apply this style.
    (The paragraph is selected if one or more characters in the paragraph are selected.)
    When all are selected (or as many as you feel safe are selected), click the new style name in the Styles Drawer to apply the style to all selected paragraphs.
    If all paragraphs you want do not yet ahve the style applied, repeat the last two steps.
    Regards,
    Barry

  • Complex Essbase MDX Issue - Need Guidance

    Hi,
    I have a complex Essbase issue in ASO version 11.1.2.2. Currently I have a MDX formula with a Measure member named '10th Percentile'. It calculates the 10th Percentile perfectly. So new requirement is to create a new Measures member and instead of calculating the '10 Percentile' value, it needs to display the Customer Name of the value that is the 10th Percentile from the Customer dimension. So if I do a retrieval and the '10th Percentile' is 3.23, then it needs to display the Customer Name of the 3.23.
    So I altered the formula to do what I think needs to be done and it verifies. However if I retrieve on that new measure in the Excel Add In, I get and error: An error [1200315] Occured in Spreadsheet Extractor. However if I navigate without data I don't get the error, but I also don't get any data, which I obviously need. So my question is, if MDX support reporting on Metadata not just Data, what/how can one report on it? Ideally I need to have this work in the Excel Add In as the client is using a custom vba modified template for their end users.
    Any ideas and help?

    Here's the formula. I bolded the part that is new.....
    IIF ( [Lbs Per Yard].CurrentMember IS [Lbs Per Yard].[No_Lbs/Yd] ,
    IIF( [Count_Price] = Missing, Missing, IIF( [Count_Price] < 2 , Missing,
    { Order (
    Filter ( CROSSJOIN ( Leaves ( [Service].CurrentMember)
    , Filter ( CROSSJOIN ( Leaves ( [Segment].CurrentMember)
    , Filter ( CROSSJOIN ( Leaves ( [Customer Type].CurrentMember)
    , Filter ( CROSSJOIN ( Leaves ( [Zip Code].CurrentMember)
    , Filter ( CROSSJOIN ( Leaves ( [Quantities].CurrentMember)
    , Filter ( CROSSJOIN ( Leaves ( [Frequencies].CurrentMember)
    , Filter ( CROSSJOIN ( Leaves ( [Yardages].CurrentMember)
    , Filter ( Leaves ( [Contract Year].CurrentMember)
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing ))
    , [$/Yd] <> Missing )
    , [$/Yd] /*this is the measure we're using for sort */
    , BASC /* sort in $/Yd in ascending order */
    ) AS OrderedSetOfItems} /* here we define an alias for the set in order to be able to use it later */
    .Item ( Round ( Count ( OrderedSetOfItems) *
    10 / 100 /*where we specify which percentile is being calculated */
    + 0.5 , 0 ) -1 ) *.Item (3-1).[MEMBER_NAME]*
    /* this takes Nth item from the ordered set (0-based index, hence -1) */
    /* .Name takes its name */
    , Missing )

  • Odd xjc compilation issues

    I realized recently that my complex type issues might be due to the fact that I was using version 1.6 of JAXB so I switched over to 2.0. I downloaded version 1.5 of the jdsk/jre as well since the documentation seemed to imply version 1.4.2 wont work with JAXB 2.0. I ran the xjc compiler and it didnt raise any errors. However, the resulting packages look very bizarre and every single one of them are flagged in error. In almost every case each package has an import statement that is trying to import itself. And I have all these Syntax error on tokens error message revolving around some @XmlEnumValue function (at least i think its a function).
    Am I missing something?

    Can be very hard to impossible to track down auto sleep issues. Just get PleaseSleep.
    http://www.dragonone.com/products/macosx/pleasesleep/

  • Complex IDOC mapping problem

    Hello,
    I'm stuck with a complex mapping issue that I can't figure out.  I'm trying to pull 0..N Variant Configuration segments from the ORDERS IDOC and map it into a 0..N XML segment.
    The inbound ORDERS IDOC is structured like this:
    IDOC
    ...E1EDP01  (Item segment 0..N)
    ......E1EDP19 (Product data 0..5)
    ...........Z1EDPIT  (Configuration Data 0..N)
    .................ATUE1   (Description)
    .................ZCODE   (Category)
    .................RTWTB  (Value)
    Target XML:
    Order  
    ....Item  (Item segment 0..N)
    .......Product  (Product data 0..1)
    ............VariantConfig  (configuration data 0..N)
    ....................Description
    ....................Category
    .....................Value
    I need to create a new VariantConfig segment in my XML for every Z1EDPIT segment for that PO Item.  But I need to skip any Z1EDPIT segments when ATUE1 = 'OPTIONS' or when ATUE1 does not exist.
    The problem I'm running into is that my mapping is capable of creating the VariantConfig segment under those conditions but the following mappings used to create the Description/Category/Value are unable to skip the Z1EDPIT segments.
    For example:
    IDOC
    ...E1EDP01 
    ......E1EDP19
    ...........Z1EDPIT 
    .................ZCODE     = REQT
    .................RTWTB     =  5644
    ...........Z1EDPIT 
    .................ATUE1     = Finish
    .................ZCODE    = REQT
    .................RTWTB    = 7712
    The output XML should read:
    Order  
    ....Item 
    .......Product 
    ............VariantConfig
    ....................Description   = Finish
    ....................Category      = REQT
    .....................Value          = 7712
    So I determine to create the VariantConfig segment if ATUE1 exists and does not equal 'OPTIONS'.  So my mapping creates one VariantConfig segment because the second Z1EDPIT qualifies.  But each element within that node is reverting back to the first Z1EDPIT segment.
    I thought the top of the Node (VariantConfig) would determine the context for the following fields.  Therefore, when the 2nd Z1EDPIT segment generates the VariantConfig node then the elements should refer to the current context of the root node (VariantConfig).
    What tools does PI's mapping provide to resolve a situation like this? 
    Any suggestions?
    Thanks,
    Matt

    Job,
    Thanks, for the responses!
    What do you mean by "add a context change for the fields". 
    Is there some mapping function to add a context change or is this a UDF I need to write to handle the context changes when ATUE1 is missing or equal to "OPTIONS".
    In my example:
    VariantConfig:
    ATUE1 (E1EDP01) >mapWithDefault [OPTIONS] equatsS [OPTIONS] -> Not ->createIf->VariantConfig
    Sub Element
    Category
    ATUE1 (E1EDP01) >mapWithDefault [OPTIONS] equatsS [OPTIONS] -> Not ->ifWithoutElse>ZCODE->Category
    The problem is that this does not keep the ATUE1 and the ZCODE in the same Z1EDPIT segment.  So I get the first ZCODE value when I only want the 2nd.   Even if I insert a context change I can't say for sure that next time I won't have 5 Z1EDPIT segments missing the ATUE1 segment before I find my first good segment that I need to map.
    ...confused...
    Thanks,
    Matt

Maybe you are looking for

  • Cannot connect to itunes store Please help me sniff sniff..

    yet again I have had to upgrade my itunes to a newer version and it has completely killed my connection to itunes store. I have tried everything, reinstalling, switching off my antivirus, switching off my firewall, replacing the host file it goes on

  • No audio after ICS update.

    After ICS update, have lost audio playback. In settings, speaker has single line crossing thru it showing audio is muted. Can not unmute audio. Same for audio 'alerts'. Have rebooted and pulled battery to no avail. Ideas?

  • Problem in replication of HR Master Data to CRM

    Hi All, I am working on ECC 6.0 and CRM 7.0 systems. I have made all the configurations for replicating HR Master Data from HCM( or HR module in ECC)  system to CRM as per the best practices. We have maintianed the Organisation Structure only in HR m

  • Insert on one dimension, expand on others

    Hi all, forgive me if I'm asking a basic question, but I can't seem to find this addressed anywhere & my evDRE skills are much better than my EPM ones! I'm creating an input schedule for CHANGES in the payroll. BPC NW 10.1 The requirement is to have

  • Components/Software Installation Problem for Adobe Form

    Hi all, I am new to developing Adobe forms. I only experience in smartforms on SAP R/3 environment. To start doing Adobe form, I have installed Adobe LiveCycle Designer ES (Is it correct?), .net Framework 2.0, SAP GUI 7.1. I already have Adobe Reader