Why this simple 'IF' syntax is not working?

Hello
Pls. help me that,
var myObject = /TextField11/
var greyFieldsList = "TextFieldAA TextFieldBB TextFieldCC "
var ReqFieldsList = "TextField11 TextField22 TextField33 "
var returnValue = greyFieldsList.search(myObject);
var returnValueReq = ReqFieldsList.search(myObject);
if (returnValue != -1) {
this.fillColor = "192,192,192"; //GREY
this.access    = "readOnly";
else if (returnValueReq != -1)
this.fillColor = "255,255,191";  //YELLOW
else
// do nothing
Yellow is not working at all!!
Grey is working some times, some times not!
Pls. correct my IF condition in such a way it shoud work.
At given point of time, any field possess only one color
Thank you

Hi Srini,
Try the following:
IF XLIKP-LGBZO  CP 'AB*'.
sy-subrc = 0.
ELSE.
sy-subrc = 4.
ENDIF.
CP - Contains Pattern
Hope this helps you.
Regards,
Chandra Sekhar

Similar Messages

  • Why this simple IF - ENDIF is NOT working??

    Hi Experts,
    Am wrting a simple  IF condition with WILD CARD value , in the user exit, as below,
    if xlikp-lgbzo = 'AB'. (pls. notice that, there is WILD CARD in the 'AB' value)
    sy-subrc = 0.
    else.
    sy-subrc = 4.
    endif.
    1) Say, the XLIKP-LGBZO value = AB-01-02 (pls. notice that, there  ' - ' in the value of AB-01-02)
    then, sy-subrc is becoming 4 ?????????????
    2 )Say, the XLIKP-LGBZO value = ZB-01-02
    then, sy-subrc is becoming 4
    the 2nd case is OK, but, Why the 1st case is becoming FALSE?? actuallym it shuld b TRUE, right??
    Is it bcoz of hiphans -  " - "?? but, i tried with WITH OUT hiphans , then also NOT working CORRECTLY??
    thanq

    Hi Srini,
    Try the following:
    IF XLIKP-LGBZO  CP 'AB*'.
    sy-subrc = 0.
    ELSE.
    sy-subrc = 4.
    ENDIF.
    CP - Contains Pattern
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • Why this filter's code is not working right?

    Hey, I have written a filter to record every request and write to a xml file. Everything works fine but the the code in filter's destroy is called twice. Don't know why? Is that there something wrong with my file writing code?? here is the code
    Filter Code:
    package xx;
    import javax.servlet.Filter;
    import javax.servlet.FilterConfig;
    import javax.servlet.FilterChain;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpSession;
    import java.io.IOException;
    import UserInfo;
    public class RequestInspector implements Filter {
    protected RequestRecorder recorder = null;
    protected static String ipAddress;
    protected static int hrId = -1;
    public void init(FilterConfig config) {
    String fileLoc = config.getInitParameter("FileLocation");
    String fileName = config.getInitParameter("FileName");
    ipAddress = config.getInitParameter("IPAddress");
    try {
    hrId = Integer.parseInt(config.getInitParameter("HRID"));
    } catch (NumberFormatException nfe) {
    } catch (NullPointerException npe) {
    if (fileLoc != null && fileName != null && ipAddress != null && hrId != -1) {
    recorder = RequestRecorder.getInstance(fileLoc, fileName);
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
    throws IOException, ServletException {
    HttpServletRequest httpRequest = (HttpServletRequest)request;
    HttpSession session = httpRequest.getSession(false);
    UserInfo info = ((session==null) ? null : (UserInfo)session.getAttribute("USER_INFO"));
    if ( request.getRemoteAddr().equals(ipAddress) && info != null && info.getHrId() == hrId && recorder != null) {
    recorder.record(httpRequest);
    } // if...
    chain.doFilter(request, response);
    public void destroy() {
    if (recorder != null) {
    recorder.stop();
    RequestRecorder Code
    package ids.util;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.util.Vector;
    import java.util.Hashtable;
    import javax.servlet.http.HttpServletRequest;
    public class RequestRecorder {
    private static final Hashtable holder = new Hashtable(2);
    private FileWriter writer = null;
    private int counter = 0;
    private RequestRecorder(String fileLocation, String fileName)
    throws IOException {
    writer = new FileWriter(new File(fileLocation, fileName));
    initializeFile();
    public static RequestRecorder getInstance(String fileLocation, String fileName) {
    RequestRecorder recorder = null;
    try {
    String path = new File(fileLocation, fileName).getAbsolutePath();
    recorder = (RequestRecorder) holder.get(path);
    if (recorder == null) {
    recorder = new RequestRecorder(fileLocation, fileName);
    holder.put(path, recorder);
    } catch (IOException ioe) {
    return recorder;
    public synchronized void record(HttpServletRequest request) throws IOException {
    if (writer == null) {
    return;
    writer.write("\n\t\t<request path=\"" + request.getRequestURI() +"\" label=\"request" + (++counter) +"\">");
    Enumeration params = request.getParameterNames();
    while (params.hasMoreElements()) {
    String param = (String)params.nextElement();
    String[] paramValues = request.getParameterValues(param);
    if (paramValues != null) {
    for (int i=0; i<paramValues.length; i++) {
    writer.write("\n\t\t\t<param>");
    writer.write("\n\t\t\t\t<paramName>");
    writer.write(param);
    writer.write("</paramName>");
    writer.write("\n\t\t\t\t<paramValue>");
    writer.write(paramValues);
    writer.write("</paramValue>");
    writer.write("\n\t\t\t</param>");
    } //for...
    } //if...
    } //while...
    writer.write("\n\t\t\t<validate>");
    writer.write("\n\t\t\t\t<byteLength min=\"20\" label=\"validation" + counter+"\"/>");
    writer.write("\n\t\t\t</validate>");
    writer.write("\n\t\t</request>");
    writer.flush();
    public void stop() {
    if (writer != null) {
    try {
    finalizeFile();
    writer.close();
    writer = null;
    } catch (IOException ioe) {
    ioe.printStackTrace();
    private synchronized void initializeFile() throws IOException {
    writer.write("<?xml version=\"1.0\" standalone=\"no\"?>");
    writer.write("\n<!DOCTYPE suite SYSTEM \"../conf/suite.dtd\">");
    writer.write("\n<suite defaultHost=\"tiserver.com\" defaultPort=\"8899\" label=\"test\">");
    writer.flush();
    private synchronized void finalizeFile() throws IOException {
    writer.write("\n\t</session>");
    writer.write("\n</suite>");
    writer.flush();
    protected void finalize() {
    stop();
    }The XML output file looks like this
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE suite SYSTEM "../conf/suite.dtd">
    <suite defaultHost="tiserver.com" defaultPort="8899" label="test">
    <request path="/acfrs/loginP.jsp" label="Login">
    <param>
    <paramName>userId</paramName>
    <paramValue>redfsdf</paramValue>
    </param>
    <param>
    <paramName>passWord</paramName>
    <paramValue>h1dffd3dfdf</paramValue>
    </param>
    <validate>
    <regexp pattern="Invalid Login" cond="false" ignoreCase="true" label="Login Check"/>
    </validate>
    </request>
    </session>
    </suite>frs/left_frame.jsp" label="request1">
    <validate>
    <byteLength min="20" label="validation1"/>
    </validate>
    </request>
    <request path="/acfrs/welcome.jsp" label="request2">
    <validate>
    <byteLength min="20" label="validation2"/>
    </validate>
    </session>
    </suite>
    If you closely observe the XML file "</session> </suite>" is written in the middle of the file too. Why does this happen? By the way, this code works perfectly on my windows desktop but on unix server the above problem turns up. Any clues??
    Thanks

    Ooops! The finalize() method in RequestRecorder is redundant. Mistakenly uncommnented it (finalize() method code ) while posting it here :-)

  • Why this simple assingment is not possible in Generics ?

    Hi
    Just curious to know why this simple conversion does not work and requires casting ?
    List<? super Integer> list = new ArrayList<Integer>();
    List<? super Number> listN = list; //Requires Casting
    List<? extends Number> listExNu = new ArrayList<Number>();
    List<? extends Integer> listExIn = listExNu; //Requires CastingAs per my understanding ,
    A List<? super Number> can fit inside a List<? super Integer> ...
    So what really happens here to force casting ? Any ideas ?

    ejp wrote:
    List<? super Integer> list = new ArrayList<Integer>();The only two classes that are superclasses of Integer are Number and Object.Not quite. Please note that the clause *? super Integer* is inclusive, i.e. it also matches List<Integer>.
    Additionally, it matches all interfaces implemented by Integer. Thus, the following types can be assigned to list:
    List<Integer>
    List<Serializable>
    List<Comparable<Integer>>
    List<Comparable<? extends Integer>>
    List<Comparable<? super Integer>>
    List<Comparable<? extends Number>>
    List<Comparable<? extends Serializable>>
    List<Comparable<?>>
    List<Number>
    List<Object>And the following types can be assigned to listN:
    List<Serializable>
    List<Number>
    List<Object>Since the latter is a genuine subset of the former, an implicit conversion such as listN = list is impossible.

  • Why is my apple ID password not working on ipad2 after updating to iOS6?

    Why is my apple ID password not working after upgrading to iOS6?

    Who knows?
    Settings>iTunes and App Stores>Tap your ID and sign out. Reboot your iPad.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Go back to the settings and sign back in again and see of it works now.
    If it doesn't work, post back with some information that might help us help you. Describe what you are doing in some detail and it might let us better understand why this is happening.

  • Why Does Live View In DW Not Work With BC Template?

    The live view using a BC template in DW CS6 shows "PAGE NOT FOUND" in the body section but the header and footer look fine. I should also point out that the index.htm page works fine, it's just the other pages that have this problem. What makes it weirder is that the site works fine in all other modes including when viewing in a normal browser, it's ONLY when in live view! I also noticed that if I delete the .htm extension in the url in the DW browser when in Live View it fixes the problem, but this requires me to do this everytime I want to switch to live view and surely is either a problem with how the BC template files are named or DW CS6 is buggy? Hopefully this is an easy one to answer??

    Hi Alex,
    Thanks for your reply, I have done a video demo at http://screencast.com/t/RsutrvoFn0xZ
    Date: Thu, 14 Feb 2013 05:49:55 -0800
    From: [email protected]
    To: [email protected]
    Subject: Why Does Live View In DW Not Work With BC Template?
        Re: Why Does Live View In DW Not Work With BC Template?
        created by Alex Pavelescu in Dreamweaver & Business Catalyst - View the full discussion
    Hi, Please provide the site url, and if you can, a video demo of the issue you're facing, using http://www.techsmith.com/jing.html, where you could also display the way you have your side setup ( Dreamweaver menu > Site > Site manager > http://screencast.com/t/GqqBk9MY4ck ) Kind Regards,Alex
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5072585#5072585
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5072585#5072585
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5072585#5072585. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Dreamweaver & Business Catalyst by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Very simple Char* conversion operator not working

    This should be simple, but it's not working.  The code below gives me a compiler error:
    Error 2 error C2440: 'initializing' : cannot convert from 'Foo' to 'char *' 
    class Foo
     char * _data;
    public:
     operator const char * () { return _data; }
     Foo f;
     char * bar = f;
    char*_data;
    public
    operatorconstchar*(){return_data;}
    Eric Jorgensen http://www.ericjorgensen.com

    On 3/5/2015 12:26 AM, "Eric Jorgensen" wrote:
    This should be simple, but it's not working.  The code below gives me a compiler error:
    Error 2 error C2440: 'initializing' : cannot convert from 'Foo' to 'char *'
    Foo can be converted to const char*, but not to char*
    Igor Tandetnik

  • Why does my digital AV adapter not work with my iPad

    Why does my digital AV adapter not work with my iPad

    i was going to try it on a flat screen hdmi input, but just as i plug the apple digital av adapter in to my ipad it says "this accessory is not supported by ipad"... my itouch says the same thing... any ideas?

  • Why is my touch screen function not working when using facetime

    Why is my touch screen function not working when using facetime

    Hello megascones,
    After reviewing your post, it sounds like the screen is not responding to touch in one app. I would recommend that you read this article, it may be able to help the issue.
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Restart your device. If you can't restart, reset your device.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Why iPhone 6 Plus sound microphone not working, but in the case of sound recordings in conversation mode work?

    Why iPhone 6 Plus sound microphone not working, but in the case of sound recordings in conversation mode work?

    Sighhhh, wasted so much time yesterday and today going around Sony centre and then carphone warehouse. They told me to come back after Easter.
    I came home, banged the phone against the wall and it worked.
    Turned out that mic was working on loud speaker and when using headphones so I thought that the secondary mic is working and the main one (placed with the speakers) isn't. So I banged that part against the wall slightly (in plastic case to prevent scratches) then put the phone underwater, waited for it to dry and now it's working. Idk how well and if it's of perfect quality again but people can hear me well.

  • ICloud password works on everything but erasing all data. I got a new iPhone and need to wipe this one but am not sure how else to do this since the password is not working. Any suggestions?

    iCloud password works on everything but erasing all data. I got a new iPhone and need to wipe this one but am not sure how else to do this since the password is not working. Any suggestions?

    Firefox also makes regular backups of your bookmarks in a folder named bookmarkbackups in your personal settings folder. You can restore the backup to your new Firefox, but unlike importing the HTML-format file, it is a complete drop-in replacement, so if you have saved new bookmarks you do not want to lose, the export/import method may work better for you.
    By default, Windows hides your personal settings folder so the easiest way to access it is from inside Firefox. You can use either:
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This will launch a window showing your Firefox settings files.
    You might want to back up this whole folder if you have other data you want to preserve from your XP computer.
    Either way, you should find the bookmarkbackups folder here and when you click into it, find maybe 10 files with dates in their names.
    The procedure to restore the file once you have it on removable media or some other convenient place is described in this article: [[Restore bookmarks from backup or move them to another computer]].
    Regarding the other files and what you might find of use: [[Recovering important data from an old profile]].

  • HT1694 I'm having a lot of problems with the hotmail account, regularly is indicating an error in the server, that I have to introduce the password again that late that this is wrong. I have changed the password making this shorter but it does not work.

    I'm having a lot of problems with the hotmail account, regularly is indicating an error in the server, that I have to introduce the password again that late that this is wrong. I have changed the password making this shorter but it does not work.

    bump? Is bumping allowed? Lol.
    I just really need some help here.

  • I am trying ot install my cs6 online. it says that my code has been redeemed but i took it off of one of my laptops to download it onto this one. it is still not working. please help

    I am trying ot install my cs6 online. it says that my code has been redeemed but i took it off of one of my laptops to download it onto this one. it is still not working. please help

    Find your serial number quickly
    Download CS6 products
    Activation & Deactivation Help
    Mylenium

  • Why is my secondary click is not working on the right?

    why is my secondary click is not working on the right?

    system preferences/Trackpad/point and click
    check and uncheck secondary click or alter method
    Try SMC reset
    http://support.apple.com/kb/HT3964
    Pram Reset
    http://support.apple.com/kb/ht1379

  • Microsoft Office 2011 no longer opens because "there is a problem" after updating mountain lion when the app store said there was an update available this morning. Reinstalling did not work. What's the problem?

    Microsoft Office 2011 no longer opens because "there is a problem" after updating mountain lion when the app store said there was an update available this morning. Reinstalling did not work. What's the problem?

    Has your problem been solved by the updates??
    Have a similar problem. This MacBook opened all MS Office programs in Dec2012 but no longer does in Feb2013. Went to Microsoft/mac/downloads but none of the three updates would run citing a problem "version of software needed to run this update was not found on this volume".
    MacBook: 7.1, Intel Core 2 Duo, 2.4 GHz
    Microsoft Office 2011:  version 14.2.3
    Mountain Lion: 10.8.2 (12C60)

Maybe you are looking for