Search method problem

Hi again,
I have problems about my search method at the below. It always create ArrayIndexOutOfBounds Exception. According to this error, the index(38) equals to the size of my arraylist. So how can I fix it ??
import java.util.*;
* ...Listdescription...
* @author  ...yourname...
* @version 1.00, 2006/05/19
public class List
     // properties
     ArrayList store;
     int index = 0;
     // constructors
     public List(){
          store = new ArrayList();
     // methods
     public void add(Object e,int node){
          store.add(node, e);
     public void addHead(Object e){
          store.add(0, e);
     public void addTail(Object e){
          store.add(e);
     // recursive method     
     public void toString(int a){
          if(store.size() == a )
               System.out.println( "");
          else{
               System.out.println(store.get(a));
               toString(a + 1);
     // recursive method
     public int search(Object e){
//          if(index == store.size())
//               return -1;
          if(e == store.get(index)){
               return store.indexOf(e);
          else{
               index++;               
               return search(e);               
     public static void main( String[] args)
             List myList = new List();
             for(int a = 0; a < 35; a++ )
                  myList.add(a,new Integer(a));
             myList.add(35,new Integer(35));
             myList.addHead(new Integer(36));
             myList.addTail(new Integer(39));
             myList.toString(0);
             System.out.println(myList.search(new Integer(3)));
} // end of class List

Do you think that the following can run for all object types ?
     public int search(Object e){
          if(index == store.size())
               return -1;
          if(e.equals(store.get(index))){
               return store.indexOf(e);
          else{
               index++;               
               return search(e);               
     }

Similar Messages

  • Problem with search method in AM called from JSP

    Hi, im trying to get the real value from an foreign key of a view, and i have been created a custom search method in the AM, but i got a problem, the search only get results the first time that is called, the next times gets null result :
    public String getValorReal(Long identificador, String vista,
    String campoFiltro, String campoValor)
    where identificador is the foreign key, vista is the name of the view that contains the real value of the foreign key, campoFiltro is the field name of the view that will match the foreign key, and campoValor is the field name of the view that the search method will return as the real value.
    I created this class that call the search method :
    public class CuentasContablesOrgLOV {
    private BindingContainer bindings;
    public Map CuentaContable= new HashMap(){
    public Object get(Object key){
    Map parametros;
    BindingContainer bindings = getBindings();
    String result = null;
    OperationBinding operationBinding = bindings.
    getOperationBinding("getValorReal");
    if (operationBinding != null){
    parametros = operationBinding.getParamsMap();
    parametros.put("identificador",new Long(key.toString()));
    parametros.put("vista","CcCuentasContablesView4");
    parametros.put("campoFiltro","identificador");
    parametros.put("campoValor","CuentaContable");
    result = (String)operationBinding.execute();
    return result;
    public Map getCuentaContable() {
    return CuentaContable;
    I invoke this class from the JSP with EL:
    <af:outputText value='#{CuentasContablesOrgLOV.cuentaContable[row.CcCucoIdentificador]}'/>
    In the AM method obtains all the parameters correct, but the search only works the first time!
    Do you have an idea whats been happened?
    thanks a lot for your help

    There is no <%@ method %> tag for a JSP.
    http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
    It looks like you are trying to write a JSP that only accepts post requests - not get?
    I'm not sure if you can accomplish that in a JSP directly.
    You can with an HttpServlet (which is where the doGet/doPost methods are defined) but HttpJspPage doesn't extend that class necessarily.
    Best you could probably do is put in a test of request.getMethod() to see if it is get/post.

  • Search Method

    Dear all,
    I am working in ADF 10g (I have a problem when I am creating Search method).
    I need to make search by using LOV (create 2 LOV list one for month and one for Year)
    In my DB I have the the date in one column (19-Feb-2009)
    I make two view object one for month and I use this statement:
    SELECT Distinct TO_CHAR(A_DATE,'Month'),EXTRACT(Month from A_DATE)
    from Attendances
    order by EXTRACT(Month from A_DATE) ASC
    Because I need to extract the month from the date column(EXTRACT(Month from A_DATE) as a text(TO_CHAR(A_DATE,'Month') and distinct( Distinct TO_CHAR(A_DATE,'Month').
    for the year I used this statement:
    Select Distinct EXTRACT(YEAR from A_DATE)
    from Attendances
    order by EXTRACT(YEAR from A_DATE) ASC
    in the Application Data Module I got this:
    In the Date:
    TOCharADateMonth
    ExtractMonthfromDate
    In the year
    ExtractYearfromDate
    The Method I used:
    public void SearchYear(String Year, String Month) {
    ArchiveVOImpl view = getArchiveVO1(); // To get Archive view
    ViewCriteria vc = view.createViewCriteria(); //
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    ViewCriteriaRow mon = vc.createViewCriteriaRow();
    if (Year != null || Month != null) {
    vcr.setAttribute("ADate", Year);
    mon.setAttribute("ADate", Month);
    vcr.setUpperColumns(true);
    mon.setUpperColumns(true);
    vc.add(vcr);
    vc.add(mon);
    view.applyViewCriteria(vc);
    view.executeQuery();
    I have the error from Date format
    I need the help in this, cause this is first time to me to use ADF.

    Where should I use this
    view.setWhereClause("WHERE TO_CHAR(ADATE,'YYYY') = '" + Year + "'");
    could you explain to me?
    Did I need to change any statements?
    Edited by: user807547 on Aug 31, 2009 1:35 AM
    Edited by: user807547 on Aug 31, 2009 1:36 AM

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • What cause searching network problem after updating iphone 6 from iOS 8.1.2 TO iOS 8.1.3?

    what cause searching network problem after updating iphone 6 from iOS 8.1.2 TO iOS 8.1.3?

    SSince Apple does not support downgrading the iOS I suggest you start a new question that gives a good title to a specific problem. Then in the body of the thread describe the problem in detail, tell us what steps you have tried so far to correct the problem, what happened, and what error messages you received.

  • TREX search methods

    Does anybody know the exact differences between the full text search methods in CV04N (or CDESK) ?
    DDIC has domane SDOK_TRMAC with following (german) elements:
    E     exakte Suche
    L     linguistische Suche
    F     fuzzy Suche
    N     Natürlichsprachliche Suche
    W     Wortsuche
    S     Soundex
    G     Class Features
    C     Class
    Type E is quite simple, o.k. ....
    What ist the difference ? I can't find any information in manuals. Which one are supported with
    SAP R3 4.6c and TREX 6.1
    Greetings from germany ...
    Markus

    Hi!
    I have the same questions!
    Did I miss any important SDN / wiki posts?
    Thanks.

  • BufferedReader's readLine() method problem (REPOST)

    Hello,
    If anyone can help me out I would not have to struggle :)
    Here is the thing. I have a file like this:
    1 srjetnuaazcebsqfbzerhxfbdfcbxyvihswlygzsfvjleengcftwvxcjriwdohjisnzppipiwpnniui yjpeppaezftgjfviwxunu
    2 ekjghqflatrcdteurofahxoiyvrwhvaxjgcuvkkpondsqhedxylxyjizflfbgusoizogbffgwnswohe njixwufcdlbjlkoqevqdy
    3 stfhcbslgcrywwrgbsqdkcxfbizvniyookceonscwugixgrxvvkxiqezltsiwhhepqusjdlkhadvkzg iefgarenbxnxtxnqdqpfh
    4 dcuefkdrkoovjwdrqbpgoirruutphuiobqweknxhboyktxzcczgekrlbfsbfuygjpheydiwaasxifph tldawxsfepotkgqqsivur
    5 fpfrspbuhangkeugfuwexsgivetovkoyloddgofdcajwwlrocgjrhonsrfrfxozvgohwoytycfjoycr xdhnhxyitkeqynedrbroh
    6 hgzqqsfgnotfepywbpccrosxborslqtkanyffrwknjapnzjnesjlkbbsckbyvgrxujqyocpcpctsqyz apcinhjyysxsdwfjugndr
    7 pltzealtrklzrugxdcskndqyvsrzncitqvjcnndeqossyrifzvbqovtdzsixjlizsbxwutgqipuxfid xyoktwupsuqbqgnxdfbze
    8 avpxfjgwpxnzfsfosgsryhpyaezigrqsxsgdvwdbwovhcchrijbitvbcvltrgvadogokaennwpjjpku uttidlnqftdnzqpqafels
    9 oyvztgletdwdtibshpzeuqryvulnubrqtgxwizfsdzqlgxvsebhslnovphgehfigbjyyqsirqcwflbn bnrflotpqytqzbgnkeyrk
    10 unvryrnlqucuydrasyzyiclnjvospzdoviqchdhasxzffblwsewikzbznyegrqtjvxfxfjenvrboofb xfsynlxhyuvqprqbvoruk
    and my java programs is like this:
    public String searchForAString(String fileName, int lineNumber)
    File fileObject = new File(fileName);
    String finalString ="";
    String record = "";
    int line;
    try
    FileInputStream fileInputStreamObject = new FileInputStream(fileObject);
    BufferedInputStream bufferedInputStreamObject = new BufferedInputStream(fileInputStreamObject);
    //DataInputStream dataInputStreamObject = new DataInputStream(bufferedInputStreamObject);
    BufferedReader bufferedReaderObject = new BufferedReader(new InputStreamReader(bufferedInputStreamObject));
    //System.out.println(bufferedReaderObject.readLine());
    //System.out.println("_____________________");
    while((bufferedReaderObject.readLine()) != null)
    System.out.println(bufferedReaderObject.readLine());
    Last System.out.println statement only displays second, forth, sixth, eigth, tenth and null lines. Why not every line? Any ideas? Thanks!
    Re: BufferedReader's readLine() method problem.
    Author: EagleEye101 Feb 18, 2005 8:48 PM (reply 1 of 1)
    You do relize that when you call the in.readLine() in your loop conditional and in your loop body it reads in diffrent lines. Try this:
    public String searchForAString(String fileName, int lineNumber)
    File fileObject = new File(fileName);
    String finalString ="";
    String record = "";
    int line;
    try
    FileInputStream fileInputStreamObject = new FileInputStream(fileObject);
    BufferedInputStream bufferedInputStreamObject = new BufferedInputStream(fileInputStreamObject);
    //DataInputStream dataInputStreamObject = new DataInputStream(bufferedInputStreamObject);
    BufferedReader bufferedReaderObject = new BufferedReader(new InputStreamReader(bufferedInputStreamObject));
    //System.out.println(bufferedReaderObject.readLine());
    //System.out.println("_____________________");
    String s = bufferedReaderObject.readLine();
    while(s != null)
    System.out.println(bufferedReaderObject.readLine());
    s = bufferedReaderObject.readLine();
    Every time you call the readLine method, it does read a diffrent line. Java does not know you want to read the same line twice.
    Tried it, did not work. I need to go through each line of the file I have. Any ideas?

    solution should be in your other thread.
    Please do not repeat threads--it really bugs the people here, just some 'nettiquite' --I don't mean to be a grouch.
    --later.  : )                                                                                                                                                                                                                                                                                                                                                       

  • Best native search method

    What is the Best native search method in Java? Is it Merge Sort implemented in Collections.sort()?

    > Okay. So just list all the methods that ARE in the
    Java API and only look for those methods in the
    documents that were linked to.
    Thanks, Paul. I guess I assumed that was blazingly obvious. I appreciate the clarification... :o)
    ~

  • *Security Error Issue while accessing youtube search method.

    Hello All,
    I am creating a flex aplication which has youtube videos search control. it works fine on local , but when I am trying to access this from any server its getting security error "[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] " while  accessing the search method url using httpservice. Can any one help me.
    Thanks.

    You may need to add the -use-network=true compiler argument. When in Flex Builder this does not matter as much:
    From Flex Builder main menubar,   Project - Properties - Flex Compiler - Additional compiler arguments:  -use-network=true
    If this post answers your question or helps, please mark it as such.

  • Search Method by more one parameter

    Hi All,
    I am trying to use search method (LOV) which has three parameters..
    How can let the user search by one parameter or two or all..

    Are you asking how to write the SQL for the VO for this?
    How about:
    Where field1=nvl(:p1,field1)
    and field2=nvl(:p2,field2)....

  • Refreshing Webservices in Search (caching problem?)

    Hi,
    I've developed some EJBs and deployed them to the WAS. I then created a WSIL Destination in NWA.
    In Visual Composer I see the methods in my Search Pane no prolem.
    I have since added 2 new methods to my service, deployed them, and tested them in Webservice navigator. Again no problem.
    Now in VC I choose my destination and search it. Now it only shows the origonal methods and not the 2 new ones. Has anyone else experienced this and got a work around? If I create a new destination and point it to the WSDL file directly then it works. Surely I don't have to do this everytime I change my web services?
    On older versions of VC you had a similar problem which was resolved by turning off client caching in the VC Compiling Options, but this no longer exists in 7.1.
    Any ideas?
    Cheers,
    Russ.

    Hi,
    Caching of services in VC has several layers:
    1. Connectivity layer: VC Connectivity caches results (search and discovery) for better performance. Services search over regestries such as WSIL and SR, has higher importance to cache, since the time needed for the search may be expensive. Clearing the cache can be achieved in two means:
    a. Restart the Web Services connector (note: 1088382 or using NWA start-stop J2EE application)
    b. disable the caching of the connector (Note: 1123574) - should be used if the backend services definitions are undergoing masive changes, and should be turned off after finishing the massive services definotions development.
    2. VC Design time cache: VC stores its own replication of the definitions "VC Proxies" to save rountrips to the backend. The proxies can be viewed in VC managed models (data services) and are stored and re-used per VC DC. The proxies can be manually cleared from the managed model dialog or using the re-import functionlity (prefered) over the infoshape (mouse right click)
    Guidelines:
    If the service had changed --> use re-import (2)
    If services were added/removed --> clear the connector cache (1.a / 1.b)
    Best Regards,
    Ran

  • 2nd try - DPS: need to have multitple certificate mappings/search methods

    My 6.3 DPS is configured to authentificate end-users through SASL binds and to request a client certificate.
    I need to use 4 user attributes (cn,sn,givenname,ou) defined in the backend LDAP directory to map certificates to LDAP entries.
    The problem is that some servers are also connecting through DPS but their certificate doesn't contain any givenname attribute.
    So, they can not be authenticated by DPS which rejects their connections.
    I wish we could define multiple certificate mapping strategies in DPS (or at least a prefered and a default strategy) in order to have
    a workaround in such a situation.
    Any plan to implement that feature or any suggested workaround (other than creating new server certificates and entries with a givenname) ?

    Here's what I see in the access and error log:
    Access log:
    [07/Jan/2010:15:48:35 +0100] - CONNECT - INFO - conn=309 client=217.108.164.186:47961 server=rct-31.gipc.hst.fluxus.net:1636 protocol=LDAPS
    [07/Jan/2010:15:48:35 +0100] - PROFILE - INFO - conn=309 assigned to connection handler cn=Gestionnaire de connexion ultime,cn=connection handlers,cn=config
    [07/Jan/2010:15:48:35 +0100] - OPERATION - INFO - conn=309 op=0 BIND dn="" method="SIMPLE" version=3
    [07/Jan/2010:15:48:35 +0100] - OPERATION - INFO - conn=309 op=0 BIND RESPONSE err=0 msg="" etime=0
    Error log:
    [07/Jan/2010:15:48:01 +0100] - EXCEPTION - DEBUG - Exception thrown from thread Connection Handler 1 for Listener Thread 0.0.0.0:1389
    javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?
    com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
    com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1356)
    com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1324)
    com.sun.net.ssl.internal.ssl.SSLEngineImpl.closeInbound(SSLEngineImpl.java:1263)
    com.sun.directory.proxy.extensions.LDAPClientConnection.disconnect(LDAPClientConnection.java:1541)
    com.sun.directory.proxy.extensions.LDAPClientConnection.disconnect(LDAPClientConnection.java:1482)
    com.sun.directory.proxy.extensions.LDAPConnectionHandler.runThread(LDAPConnectionHandler.java:457)
    com.sun.directory.proxy.util.DistributionThread.run(DistributionThread.java:225)
    [07/Jan/2010:15:48:36 +0100] - EXCEPTION - DEBUG - Exception thrown from thread Connection Handler 1 for Listener Thread 0.0.0.0:1636
    java.io.IOException: Received CLOSED during initial handshaking
    com.sun.directory.proxy.extensions.LDAPClientConnection.doHandshake(LDAPClientConnection.java:398)
    com.sun.directory.proxy.extensions.LDAPClientConnection.read(LDAPClientConnection.java:1229)
    com.sun.directory.proxy.extensions.LDAPConnectionHandler.runThread(LDAPConnectionHandler.java:346)
    com.sun.directory.proxy.util.DistributionThread.run(DistributionThread.java:225)
    [07/Jan/2010:15:48:36 +0100] - EXCEPTION - DEBUG - Exception thrown from thread Connection Handler 1 for Listener Thread 0.0.0.0:1636
    java.io.IOException: Received CLOSED during initial handshaking
    com.sun.directory.proxy.extensions.LDAPClientConnection.doHandshake(LDAPClientConnection.java:398)
    com.sun.directory.proxy.extensions.LDAPClientConnection.disconnect(LDAPClientConnection.java:1547)
    com.sun.directory.proxy.extensions.LDAPClientConnection.disconnect(LDAPClientConnection.java:1482)
    com.sun.directory.proxy.extensions.LDAPConnectionHandler.runThread(LDAPConnectionHandler.java:457)
    com.sun.directory.proxy.util.DistributionThread.run(DistributionThread.java:225)
    Unfortunately, since I don't have access to the back-end DS access log, should I see more details (of interest !) on the DPS side
    with a higher log level ?
    From my understanding and with my DPS config, when DPS chooses the "Gestionnaire de connexion ultime" connection handler, it means
    it hadn't been able to map the certificate's owner to an LDAP entry. (This connection handler has the lowest priority in my DPS configuration).
    I've to check (with my customer), but it could be that with the existing back-end DS content, the problem is that when DPS searches for the certificate's owner LDAP entry with only 3 attributes, it's returned more than a single entry.
    Actually, otherwise, since I don't see any obvious problem in the error log, and thanks to your feedback, I can't see any other possible problem,
    provided that the customer is confident in the fact that there's an entry with the right certificate in the DS back-end .

  • Reset() method problems...

    I have an assignment. I may be able to do it all myself, except for this one part. We are to find out, and use the reset() method for one question. I have done some code for the question.
    public class Date {
        public Date() {
             int dm_day = 0;
             int dm_month = 0;
             int dm_year = 0;
        public Date( int day, int month, int year){
        public void set_day(String str){
             dm_day = str;
        public int get_day(){
             return dm_day;
        public void set_month(String str){
             dm_month = str;
        public int get_month(){
             return dm_month;
        public void set_year(String str){
             dm_year = str;
        public int get_year(){
             return dm_year;
        public String toString(){
             String str = "Today's Date\n";
             str = dm_day + "/" + dm_month + "/" + dm_year;
    }I need to rovide a reset() method which sets the date to the first day of the year (January 1st). That is, the day and month change; the year is left as is. We cannot use the textbook, because it dies not include this method. So.. if anyone could help me out here, that would be excellent.
    Thanks in advance

    Yes I did write the code. I do understand what it
    does. I do not know what the reset method is for.Then don't write a reset method!
    The
    question states that it is to reset the year, keeping
    the day and month as the user's input. OK, so you do understand what the reset method is for.
    You're making this much harder than it has to be.
    As I said
    before, we are supposed to figure this out.Figure what out? How to do it? I already gave you a big fat clue that you apparently ignored.
    There is
    no help from our textbook. I have searched for the
    reset method.The textbook wouldn't tell you how to do this. There isn't some reset method standard in Java. This is just an application-level thing, put into your assignment for this individual case.
    But the docs that i found did not make
    sense to me. Nor did they say anything about what I
    am doing here. They're only going to help you out so much. In particular, they're not going to give you the answers to homework problems.
    And the error messages said all, and only
    "incompatible types" that is it.At this point, you should forget the reset() method until you get the code working otherwise. Which it's not.
    Jeff already told you what the problem is with your code that's preventing it from compiling. Plus of course the error message itself tells you. They don't tell you letter-for-letter what you have to type to fix your code, because that's basically impossible. Sorry, but you're going to have to think at least a little bit.

  • CRM_BSP_FRAME search help problem

    Dear firends 
      I m having a problem with populating the search help for the Product profile wich has appliation CRMM_BSP_ACCOUNT_FS, I have created a search help with user exit Z_BP_GET_ADDRESS_EXIT, here i am accessing the address numbers, I have usesd this exit in Transaction EEWB ZBP_Product_Profile..under the (TASK) CRM_BUPA_PCUITD for the portal,, where this search work in SAP GUI...(i have attached this fumction module for BP transaction also) correctly and have no trouble. where it is not working in portal.. please tell me the what could be the problem is i ll be really thankful to you...
    I m giving you the search help code also...
    FUNCTION Z_BP_GET_ADDRESS_EXIT.
    ""Local Interface:
    *"  TABLES
    *"      SHLP_TAB TYPE  SHLP_DESCT
    *"      RECORD_TAB STRUCTURE  SEAHLPRES
    *"  CHANGING
    *"     VALUE(SHLP) TYPE  SHLP_DESCR
    *"     VALUE(CALLCONTROL) TYPE  DDSHF4CTRL
      IF CALLCONTROL-STEP = 'SELECT'.
        DATA: PARA TYPE tpara-paramid VALUE 'BPA',
              PARTNER TYPE BU_PARTNER,
              ADDRESS TYPE BU_ADDSC,
              T_ADD_NO TYPE STANDARD TABLE OF BAPIBUS1006_ADDRESSES_INT,
              LINE TYPE SEAHLPRES,
              ADD_NO_LINE TYPE BAPIBUS1006_ADDRESSES_INT.
       GET PARAMETER ID PARA FIELD PARTNER.
    MOVE '0000000061' TO PARTNER.
        DATA: ES_BUT000     TYPE     BUS000___I,
    ES_BUT000_OLD     TYPE     BUS000___I,
    ET_partner TYPE TABLE OF BAPIBUS1006_KEY.
        CALL FUNCTION 'BUPA_ADDRESSES_GET'
         EXPORTING
           IV_PARTNER                     = PARTNER
      IV_PARTNER_GUID                =
      IV_ADDRESS_TYPE                =
      IV_OPERATION                   =
      IV_VALID_DATE                  = SY-DATLO
    IMPORTING
      EV_STANDARD_ADDRNUMBER         =
      EV_STANDARD_ADDRGUID           =
      EV_STANDARD_USED_INSTEAD       =
         TABLES
           ET_ADDRESSES                   = T_ADD_NO
      ET_ADDRESSES_ALL               =
      ET_RETURN                      =
        LOOP AT T_ADD_NO INTO ADD_NO_LINE.
          CALL FUNCTION 'BUA_ADDRESS_DESCRIPTION_GET'
           EXPORTING
              I_PARTNER                        = PARTNER
        I_PARTNERGUID                    =
        I_OPERATION                      =
              I_ADDRNUMBER                     = ADD_NO_LINE-ADDRNUMBER
        I_ADDRGUID                       =
        I_BUT000                         =
        I_XMEMORY                        = ' '
        I_XWA                            = ' '
        I_VALDT                          = '00000000'
        I_VALDT_SEL                      = '00000000'
        I_VALDT_SEL_NAMES                = SY-DATLO
           IMPORTING
        E_DESCRIPTION                    =
              E_DESCRIPTION_STREET             = ADDRESS
        E_XSTANDARD                      =
        E_XFIX                           =
        E_DESCRIPTION_LONG               =
        E_ADDRNUMBER                     =
        E_DESCRIP_STREET_WITH_NAME       =
      EXCEPTIONS
        NO_ADDRESS_FOUND                 = 1
        WRONG_PARAMETERS                 = 2
        INTERNAL_ERROR                   = 3
        DATE_INVALID                     = 4
        OTHERS                           = 5
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CONCATENATE ADD_NO_LINE-ADDRNUMBER ADDRESS INTO LINE-STRING.
          INSERT LINE INTO TABLE RECORD_TAB.
        ENDLOOP.
        CALLCONTROL-STEP = 'DISP'.
      ENDIF.
    ENDFUNCTION.
    thanking you..
    regards,
    Naim
    Message was edited by: Naim Khan S Babi

    Hi,
    I think you may use F4 Help feature on the PC-UI.
    1. Inherit model access class where the field is defined.(field type must be "Input field" and F4 Application "VALUE_TABLE"). Update blueprint tables.
    2. Redefine FILL_DROPDOWN_LISTBOX method.
    3. Insert your logic to fill CT_DROPDOWNLB_DATA parameter as required.
    Code sample
    METHOD if_crm_bsp_model_access_il~fill_dropdown_listbox.
      TYPES:
        BEGIN OF t_listbox_data,
          key   TYPE AD_ADDRNUM,
          value TYPE AD_STREET,
        END OF t_listbox_data.
      DATA:
        lw_data TYPE REF TO data,
        lw_listbox_data TYPE t_listbox_data,
        li_data TYPE REF TO data,
        li_listbox_data TYPE TABLE OF t_listbox_data,
        li_listbox_data_temp TYPE TABLE OF t_listbox_data.
      FIELD-SYMBOLS:
        <fi_listbox_data> TYPE table,
        <fw_listbox_data> TYPE t_listbox_data,
        <fw_ddlb> TYPE crmt_dropdownlistbox_data.
    * HERE FILL li_listbox_data WITH YOUR LOGIC)
    * Looping over all dropdown list values
      LOOP AT ct_dropdownlb_data ASSIGNING <fw_ddlb>.
    *   When the custom field is processed
        IF <fw_ddlb>-fieldname EQ 'YOUR_FIELD'.
    *     Creating the objects.
          CREATE DATA li_data TYPE TABLE OF t_listbox_data.
          CREATE DATA lw_data TYPE          t_listbox_data.
    *     Assigning field symbols.
          ASSIGN li_data->* TO <fi_listbox_data>.
          ASSIGN lw_data->* TO <fw_listbox_data>.
    *     Copying the retrieved lines.
          <fi_listbox_data>[] = li_listbox_data[].
    *     Name of the key column
          <fw_ddlb>-keycolumnname   = 'KEY'.
    *     Name of the value column
          <fw_ddlb>-valuecolumnname = 'VALUE'.
    *     Moving the data to the table
          MOVE li_data TO <fw_ddlb>-data.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    Hope it helps,
    David

  • Searching Record problem

    hi all, i wrote the sql statement for search a reacod. when i enter a first character then it is retrieving data from database. but the problem is when i enter the name like "Syarikat Usaha Sama" it is not retrieving becoz this name is having spaces between word to word. this name also stored in DB same. if there is no spaces in DB also it is ok. but if name is having diffenent words with spaces wont work. please help me ..i am sending corresponding code also what i have been written.
    ename = jTextFieldNamaMajikan.getText();
    try{
    conn = connection.getInstance().getConnection();
    s = conn.createStatement();
    if(empType.length() >1){
    sql="select a.employer_name,a.employer_id,e.employer_type,c.description,b.description from d_workplace a,ems_ref_city b,ems_ref_state c,d_employer d,d_ref_employer_type e where a.employer_id = d.emp_id and d.emp_typ = e.employer_type and a.city_code = b.city_code and a.state_code = c.state_code ";
    } else{
    sql="select a.employer_name,a.employer_id,f.description,c.description,b.description from d_workplace a,ems_ref_city b,ems_ref_state c,d_employer d,ems_ref_country f where a.employer_id = d.emp_id and a.city_code = b.city_code and a.state_code = c.state_code and a.country_code = f.country_code ";
    //Original** sqlTemp = (ename.length() >0 ? "and (employer_name like '"+ename.toLowerCase()+"%' or employer_name like '"+ename.toUpperCase()+"%') " : "and employer_name like ''");
    sqlTemp = (ename.length() >0 ? "and (employer_name like '"+ename.toLowerCase()+"%' or employer_name like '"+ename.toUpperCase()+"%') " : "and employer_name like ''");
    System.out.println("sqlTemp is :"+sqlTemp);
    sql = sql + sqlTemp;
    while(rowCount > 0){
    ((DefaultTableModel) jTable1.getModel()).removeRow(0);
    rowCount -= 1;
    System.out.println("SQL is : "+sql);
    rs = s.executeQuery(sql);
    if (rs != null)
    while ( rs.next() ) {
    ((DefaultTableModel) jTable1.getModel()).insertRow(0, new Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5)});
    rowCount += 1;
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null,"An error occured: " + e);
    }

    Hi friend, the problem is when entered name then i click the button it has to show all the records based on the entered name. ok. For example In database there are 3 records are there names are 1. Syarikat Usha 2. Sama 3. imatera sdn ok.
    if i entered the name sama or Sama then all the correponding details are displaying. where as If i entered the name as Syarikat Usha then is showing that no records are existed. but in database these records are existed.
    the proble is that there is a space between Syarikat and Usha see that is the main problem. i tried to give use trim() method but it is not working.
    see one morething friend i wrote query :
    sqlTemp = (ename.length() >0 ? "and (employer_name like '"+ename.toLowerCase()+"%' or employer_name like '"+ename.toUpperCase()+"%') " : "and employer_name like ''");
    this query is for display the records based on the ename ok got it now.
    note: here we are comparing given name with existed name in database
    i think u can understand the problem.

Maybe you are looking for

  • ODS attribute only Problem

    Hi, I have a ODS which had a infoobject with attribute only status. To be able use this in Bex this attribute only status has been disabled. Now while transporting the request I am getting the error - generate new SIDs for this characteristic in the

  • 24" iMac as a display

    Can I use my 24" iMac as a display?  I've tried ScreenRecycler and it cannot be downloaded to my Macbook Air

  • Iprinting multiple photos on 1 sheet?

    I want to print 2 photos onto 1 sheet. I highlighted the 2 phots and went to file-->print. from there i selected layout where i saw 1, 2, 3, 4 photos as options. i messed with it and now it only gives me the option for 1 photo per page. i went to set

  • How to delele skype account

    how to delete my account

  • IT DOES NOT WORK IN NETWORK (APEX + Oracle XE in XP)

    Hi there! I am beginner in Apex and Oracle XE. So I have met some trouble. I have installed Oracle 10g XE to Windows XP. It was easy. Then I started DB home by url: http://127.0.0.1:8080/apex. It works. But my PC has Network card with persistent IP a