How to debug for Eixt Class CL_RSPLS_CR_EXIT_BASE

Hello,
I have created a input ready query and I have a requirement where we can use based on the characteristic of Organisation and Country to derive the Material group.
For example:
Country     Organsiation    Material group
16            4518          =====> 164518
I know I can use classes in SE24.
I am assuming I should use CL_RSPLS_CR_EXIT_BASE for my requirement.
I have defined a characterisitc relationship with Organisation and Country as source characteristic and  Material group as target and chose Characteristic Combinations Based On : Exit class and Exit Class: CL_RSPLS_CR_EXIT_BASE
In IF_RSPLS_CR_METHODS~DERIVE  :
FIELD-SYMBOLS: <l_chavl> TYPE ANY.
data:  l_pur_org type /BI0/oid_pur_org,
        l_country type /bi0/oid_country.
ASSIGN COMPONENT 'D_PUR_ORG' OF STRUCTURE c_s_chas
TO <l_chavl>.
  l_pur_org = <l_chavl>.
ASSIGN COMPONENT 'D_COUNTRY' OF STRUCTURE c_s_chas
TO <l_chavl>.
  l_country = <l_chavl>.
CLEAR <l_chavl>.
CONCATENATE '10' l_pur_org l_country INTO <l_chavl>.
ASSIGN COMPONENT 'D_MTLGROUP' OF STRUCTURE c_s_chas
TO <l_chavl>.
For the above function  I get Organisation and Country from input schedule and it should derive  Material group and save it into the cube.
Is code wrong? It can not debug when i execute the query.
ps. I have tried to create break-point, and external break-point. But it does not work.
Thanks for your suggestion.
Edited by: gang qin on Jan 11, 2010 9:12 PM

Hi.
First you should create your OWN class based on CL_RSPLS_CR_EXIT_BASE  via se24.
Second redefine 3 methods: CHECK and CREATE without any code and DERIVE with your code.
As I understand your material group should be: '10' (constant) + pur_org + country cancateneted.
If Im right plz try the next code (plz note the code is not checked and debigged. If you will set breakpoint in method derive in your own class you can debug it).
You can change this code in section with comments "**** Your derivation algorithm here"
METHOD if_rspls_cr_methods~derive.
infrastructure needed by the buffer:
  DATA: l_s_mesg   TYPE if_rspls_cr_types=>tn_s_mesg,
        l_is_valid TYPE rs_bool.
  FIELD-SYMBOLS: <l_th_buf> TYPE HASHED TABLE,
                 <l_s_buf>  TYPE ANY.
  CLEAR e_t_mesg.
use the buffer?
o_use_buffer is switched on by default in the constructor
  IF o_use_buffer = rs_c_true.
  yes:
    ASSIGN o_r_th_buf->* TO <l_th_buf>.
    ASSIGN o_r_s_buf->*  TO <l_s_buf>.
    <l_s_buf> = c_s_chas.
    READ TABLE <l_th_buf> INTO <l_s_buf> FROM <l_s_buf>.
    IF sy-subrc = 0.
      IF o_r_is_valid->* = rs_c_true.
        c_s_chas = <l_s_buf>.
        RETURN.
      ELSE.
        IF e_t_mesg IS SUPPLIED.
          APPEND o_r_s_mesg->* TO e_t_mesg.
        ENDIF.
        RAISE EXCEPTION TYPE cx_rspls_failed
          EXPORTING
            msgid = o_r_s_mesg->msgid
            msgty = o_r_s_mesg->msgty
            msgno = o_r_s_mesg->msgno
            msgv1 = o_r_s_mesg->msgv1
            msgv2 = o_r_s_mesg->msgv2
            msgv3 = o_r_s_mesg->msgv3
            msgv4 = o_r_s_mesg->msgv4.
      ENDIF.
    ENDIF.
  ENDIF.
Your derivation algorithm here:
  FIELD-SYMBOLS: <zpur_org>   TYPE ANY.
  FIELD-SYMBOLS: <zcountry>   TYPE ANY.
  FIELD-SYMBOLS: <zmat_grp>   TYPE ANY.
  ASSIGN COMPONENT '/BI0/d_pur_org'   OF STRUCTURE <l_s_buf> TO <zpur_org>.
  ASSIGN COMPONENT '/BI0/d_country'   OF STRUCTURE <l_s_buf> TO <zcountry>.
  ASSIGN COMPONENT '/BI0/'D_MTLGROUP' OF STRUCTURE <l_s_buf> TO <zmat_grp>.
  CONCATENATE '10' <zpur_org> <zcountry> INTO <zmat_grp>.
  l_is_valid = 'X'.
End of your derivation algorithm:
update the buffer with the result:
l_s_mesg should contain a message in the 'invalid' case
l_is_valid should indicate whether derivation was possible
<l_s_buf> should contain the derived fields
  IF o_use_buffer = rs_c_true.
    o_r_is_valid->* = l_is_valid.
    IF o_r_is_valid->* = rs_c_true.
      INSERT <l_s_buf> INTO TABLE <l_th_buf>.
      c_s_chas = <l_s_buf>.
    ELSE.
      IF e_t_mesg IS SUPPLIED.
        o_r_s_mesg->* = l_s_mesg.
        APPEND l_s_mesg TO e_t_mesg.
      ENDIF.
      INSERT <l_s_buf> INTO TABLE <l_th_buf>.
      RAISE EXCEPTION TYPE cx_rspls_failed
        EXPORTING
          msgid = l_s_mesg-msgid
          msgty = l_s_mesg-msgty
          msgno = l_s_mesg-msgno
          msgv1 = l_s_mesg-msgv1
          msgv2 = l_s_mesg-msgv2
          msgv3 = l_s_mesg-msgv3
          msgv4 = l_s_mesg-msgv4.
    ENDIF.
  ENDIF.
ENDMETHOD.

Similar Messages

  • How to search for available class in given package?

    How to search for available class in given package or sub package?

    Finally i did it. I make hibernate and spring without much configuration. I just pass the package pattern to search for all bean. I named it package pattern injection.
    My website is still under construction yet. It named Jimmy6 Framework.
    The code it just the following for all hibernate and spring bean for the whole project.
    <bean id="sessionFactory" class="com.j6.framework.JAnnotationSessionFactoryBean">
              <property name="annotatationOrHbmXmlPackagePattern">
                   <list>
                        <value>com\.j6\.project.+?\.vo\..+?</value>                    
                   </list>
              </property>               
    <bean id="autoBeanCreatorFactoryManager" class="com.j6.framework.resource.AutoBeanCreatorFactory">
              <property name="packagePatterns">
                   <list>
                        <value>com\.j6\.project\..+?\.manager\..+?</value>
                   </list>
              </property>
         </bean>
         <bean id="autoBeanCreatorFactoryDao" class="com.j6.framework.resource.AutoBeanCreatorFactory">
              <property name="packagePatterns">
                   <list>
                        <value>com\.j6\.project\..+?\.dao\.hibernate.+?</value>
                   </list>
              </property>
         </bean>Feel free to have a look and gv some comments. Thanks :)
    Regards,
    Jimmy6
    Edited by: jimmy6 on Nov 4, 2008 8:15 AM

  • How to debug for inbound mail in SAPconnect - ERMS

    Hi,
    How to debug from the point of receipt of an inbound mail in SAPconnect so that we can see the data being passed to the ERMS Workflow WS00200001.
    Regards,
    Deepak

    Hi Ashish,
    Thanks for your prompt reply. Let me explain the scenario in little bit details. If you want I can post the screen shots at flickr etc. for better understanding.
    In transaction SWI1: we are getting Error at Invoking Service Manager for Workflow WS00200001. The error is "ERMS support object: Could not find DOCUMENT - Message no. CRM_ERMS020.
    In transaction CRM_ERMS_LOGGING: We are getting error "Exception in method constructor (CL_CRM_ERMS_XPATH_TAG): Service CL_CRM_ERMS_ADD2FB_DOCUMENT failed. Cannot read email".
    On providing valid email document id or work item id in transaction CRM_ERMS_LOGGING the required action is executed and everything is ok.
    We tried to debug in SCOT by DBG+ but on receipt of inbound mail debug session does not start.
    Actually we want to understand, on receipt of email what data is passed to the workflow as method call CL_CRM_ERMS_CONVERTER->CONVERT_DOCUMENT does not return XSL content and the error message is raised. It is possible that the previous method call SERVICE_MANAGER->GET_EMAIL_ID() does not retrieve a value for doc_id, but we are not sure without being able to debug through from the SAP connect process.
    Regards,
    Deepak

  • How to search for a Class by incomplete name?

    Hello.
    Does anyone know if it is possible to get an instance of the Class object for a class that I don't have a fully qualified name for?
    For example, I want to get the object I would normally get by calling
    my.project.package.web.jsf.MyConstants.classexcept that I only have the "MyConstants" part of the name.
    Is it possible to somehow use the classloader to search for <i>my.project.package.web.jsf.MyConstants</i> class when I only have <i>MyConstants</i> to start with?
    Thanks.

    vace117 wrote:
    Besides, getting this to work is not really that important. At this point it mostly bothers me as a theoretical question. Can it be done?If you're asking whether it's possible to have a situation where you have two classes with the same name, but in different packages, and that the JVM can look at just the class name and figure out which of the two classes you really meant to use...well, sure, in that (I suppose) you could write something that would search the entire classpath looking for the matching classes, and then apply some heuristics with something like BCEL to try to guess which class you really meant to use. It'll be ugly code and it won't be foolproof, but if you really want it...there you go.
    Ultimately, there's a baseline of information that the JVM needs -- in this case the full name of the class. If you start with only partial information, you're going to have to provide some way to derive the full information. Information doesn't just pop into existence magically. The cleanest, easiest way to provide the information is to provide all of it to begin with. The second cleanest, easiest way is to prepend a standard package name. It gets uglier from there.
    You could do is design a custom classloader that specifies classes in a different way...but I suspect that you'd find that ugly as well.

  • How to search for a class to know it is in which Jar file

    Hi Guys,
       Can any tell me how to search a class file. I have a set of Jar files in which the required class file is there. But i don't know in which Jar file the class is. Is there any way to find out.
    Regards,
    Gowtham K.

    Hi Gowtham,
    Please download the Class locator from the following site. This will help to know what you are looking for.
    <b>http://www.alphaworks.ibm.com/tech/jarclassfinder</b>
    <b>http://sourceforge.net/projects/classlocator</b>
    I hope this solves your problem.
    Regards
    Pravesh
    PS: Please consider rewarding points for helpful answer.

  • How to debug Sun's classes using Eclipse

    Sometimes happens to me during the debugging of my application to have the necessity to "step into"
    in some Sun's classes (java.lang.String, or swing classes or something else).
    Even if Sun provide us the sources, I have not found a way to debug Sun classes because the Sun
    classes are shipped in jars without the debug informations.
    Eclipse open correctly the Sun's source but, without the debug informations into Sun's jars, is impossible
    to proceed with debugging.
    Does anyone can help me?
    Thanks.

    I have not used Eclipse but I think this may do it. While u are build' ing ur project can u place the jar files in the source path so that their classes also get compiled! If u can do then u can step into sun's code.
    s

  • How to debug for this top result

    Hi,
    The following is the result of top command got by running my multi-threaded program that uses mysql. Here %wa is much greater than %us. I ran jconsole but could not find any thread lock or any other irregularities. I use a blocking queue which is accessed by some 200 threads. I think that may cause this much. But i don't know the exact way of tracing the source of the problem. I hear profiling, etc. But don't know which part of my code causes this. how to find it.
    I use intel dual core with 1GB RAM. Default JVM size.
    top - 11:49:50 up 1:21, 5 users, load average: 12.74, 6.11, 2.89
    Tasks: 177 total, 2 running, 174 sleeping, 0 stopped, 1 zombie
    Cpu(s): 10.0%us, 17.0%sy, 8.4%ni, 7.1%id, 56.9%wa, 0.0%hi, 0.5%si, 0.0%st
    Mem: 1025372k total, 1011940k used, 13432k free, 4976k buffers
    Swap: 2096440k total, 55672k used, 2040768k free, 272444k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    5258 raja 20 0 277m 37m 10m S 41.0 3.8 4:09.34 java
    2568 nobody 20 0 28728 17m 3284 S 2.6 1.7 0:02.97 mysqld
    4008 mysql 20 0 137m 19m 4264 S 1.3 2.0 0:04.30 mysqld
    5935 root 39 19 5072 1420 1008 S 1.0 0.1 0:01.14 makewhatis
    2603 root 20 0 339m 59m 10m S 0.7 5.9 2:58.37 Xorg
    6 root RT -5 0 0 0 S 0.3 0.0 0:01.42 migration/1
    673 root 15 -5 0 0 0 D 0.3 0.0 0:00.79 kjournald
    1773 root 15 -5 0 0 0 R 0.3 0.0 0:07.55 kondemand/0
    1954 dbus 20 0 3080 1336 764 S 0.3 0.1 0:02.84 dbus-daemon
    2177 root 20 0 6780 1884 1572 S 0.3 0.2 0:01.53 NetworkManager
    3370 raja 20 0 130m 18m 12m S 0.3 1.8 0:13.69 gnome-terminal
    5257 raja 20 0 212m 19m 10m S 0.3 2.0 0:01.25 rmiregistry
    5582 raja 20 0 74224 17m 8924 S 0.3 1.8 0:30.47 npviewer.bin
    5631 raja 20 0 2556 1104 840 R 0.3 0.1 0:04.05 top
    1 root 20 0 2008 704 500 S 0.0 0.1 0:00.98 init
    2 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kthreadd
    3 root RT -5 0 0 0 S 0.0 0.0 0:01.46 migration/0
    Thanks.

    When I have seen this behaviour, it is because you are writing data faster than the computer can keep up. You appear to be very low on free memeory which will make this problem worse. On my systems, this appears to be a problem if the "free" memory is less than 20% of your total memory.
    What happens is that every process which runs occasionally, now blocks waiting for disk and appears in the load average.
    I suggest you look at your vmstat to see what your disk activity looks like.

  • How to register for class while using ActiveX

    Hi
    I am trying to use ActiveX to send an email with Microsoft Outlook. I have found an example Vi. but i was getting an error with code "-2147221164" (Class not registered in Outlook_Mail-1.vi). How to register for that class and what are the files required for that registration.
    Attachments:
    Outlook_Mail-1.vi ‏31 KB

    Here is a picture of the Photosmart eStation:
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • RE: How to debug enhanced classes

    The line number information for classes is not affected by the
    enhancement process. For example, the pre-enhanced code 'this.foo = 2'
    looks like the following in pseudo-bytecode:
    aload_0 // load 'this' onto stack
    iconst_2 // load '2' onto stack
    putfield <foo> // place '2' into field 'foo' of 'this'
    The replacement code, 'jdoSetFoo (this, 2)' looks like this:
    aload_0 // load 'this' onto stack
    iconst_2 // load '2' onto stack
    invokestatic <jdoSetFoo> // invoke static method jdoSetFoo with the
    args
    The two bytecode blocks are the exact same length, and this holds true
    for setting fields as well.
    Java line number tables mark the bytecode position and length of each
    source code line. Because the enhancer doesn't change either of these
    properties, the line number tables remain correct, and line numbers
    match even after enhancement.
    If you thought you saw line number discrepencies, I'd be very very
    interested in seeing a specific example, because I just don't see how
    they could possibly exist, with the exception of 2 places:
    1. Cloning code. The enhancer adds special instructions after cloning.
    2. Static initializer blocks. Again, the enhancer adds to the static
    init block so that classes register themselves with the JDOImplHelper.
    -----Original Message-----
    From: David Ezzio
    To: Tech Trader JDO List
    Sent: 8/2/01 6:05 PM
    Subject: Re: How to debug enhanced classes
    In TT Beta 1, I noticed that the line numbers were not matched up
    correctly for the enhanced classes. It's a bug. Don't know if Beta 2
    is supposed to have fixed it. I used BugSeeker2.
    David

    Alex
    I'm getting the same problem you had. I can't debug my enhanced classes
    with JBuilder 6. Have you solved this question?
    TIA
    Arthur
    Roytman, Alex wrote:
    Eric,
    I meant source debugging not just stack traces
    I could not do it with JBuilder. I do not know how debugger works but
    debug info in binaries do not match unenhanced source code
    Alex
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Thursday, August 02, 2001 1:34 PM
    To: Roytman, Alex; JDO-ListServ
    Subject: Re: How to debug enhanced classes
    Shouldn't you be able to debug them just like normal classes? The line
    numbers in the stack traces shoud all be the same as those found in an
    unenhanced class.
    Of course, if you mean debug a problem with the JDO implementation,
    well,
    you don't have the source anyways so what good would it do? :)
    -Eric
    ----- Original Message -----
    From: "Roytman, Alex" <[email protected]>
    To: "JDO-ListServ" <[email protected]>
    Sent: Thursday, August 02, 2001 1:07 PM
    Subject: How to debug enhanced classes
    Has anybody came up with a method to debug enhanced classes?

  • How to find classtype and class for a material.

    Hi,
    How to find classtype and class for a material.
    which table contains this data.
    Thanks
    Kiran

    Hi Kiran,
    Check below sample code. Use this BAPI which will give all info about the class for the material.
      DATA:      l_objectkey_imp    TYPE bapi1003_key-object
                                         VALUE IS INITIAL.
      CONSTANTS: lc_objecttable_imp TYPE bapi1003_key-objecttable
                                         VALUE 'MARA',
                 lc_classtype_imp   TYPE bapi1003_key-classtype
                                         VALUE '001',
                 lc_freight_class   TYPE bapi1003_alloc_list-classnum
                                         VALUE 'FREIGHT_CLASS',
                 lc_e               TYPE bapiret2-type VALUE 'E',
                 lc_p(1)            TYPE c             VALUE 'P',
                 lc_m(1)            TYPE c             VALUE 'M'.
      SORT i_deliverydata BY vbeln posnr matnr.
      CLEAR wa_deliverydata.
      LOOP AT i_deliverydata INTO wa_deliverydata.
        REFRESH: i_alloclist[],
                 i_return[].
        CLEAR:   l_objectkey_imp.
        l_objectkey_imp = wa_deliverydata-matnr.
    *Get classes and characteristics
        CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
          EXPORTING
            objectkey_imp         = l_objectkey_imp
            objecttable_imp       = lc_objecttable_imp
            classtype_imp         = lc_classtype_imp
    *   READ_VALUATIONS       =
            keydate               = sy-datum
            language              = sy-langu
          TABLES
            alloclist             = i_alloclist
    *   ALLOCVALUESCHAR       =
    *   ALLOCVALUESCURR       =
    *   ALLOCVALUESNUM        =
            return                = i_return
    Thanks,
    Vinod.

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to enable remote debugging for a session other than the current one

    Hi all,
    I am trying to figure out how to enable remote debugging for a session other than the one I am currently using.
    More specifically, we have an application that is making database calls to Oracle 11gR2. Something is causing an exception during this invocation. My system is currently not set up to recompile said application, so I can't just add the debug call to the code and recompile. Therefore I would like to be able to log into the database (as sys, if necessary) and invoke dbms_debug_jdwp.connect_tcp on the desired session.
    The docs indicate that I should be able to do so:
    dbms_debug_jdwp.connect_tcp(
    host IN VARCHAR2,
    port IN VARCHAR2,
    session_id IN PLS_INTEGER := NULL,
    session_serial IN PLS_INTEGER := NULL,
    debug_role IN VARCHAR2 := NULL,
    debug_role_pwd IN VARCHAR2 := NULL,
    option_flags IN PLS_INTEGER := 0,
    extensions_cmd_set IN PLS_INTEGER := 128);
    But when I try (even as sys), I get the following:
    exec dbms_debug_jdwp.connect_tcp('1.2.3.4',5678,<session id>,<session serial>);ORA-00022: invalid session ID; access denied
    ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
    ORA-06512: at line 1
    00022. 00000 - "invalid session ID; access denied"
    *Cause:    Either the session specified does not exist or the caller
    does not have the privilege to access it.
    *Action:   Specify a valid session ID that you have privilege to access,
    that is either you own it or you have the CHANGE_USER privilege.
    I've tried granting the 'BECOME USER' privilege for the relevant users, but that didn't help. I read something about having to set some kind of ACL as of 11gR1, but the reference documentation was very confusing.
    Would someone be able to point me in the right direction? Is this even possible, or did I misread the documentation?

    Interesting deduction, that would be very useful indeed. I hate recompiling just to add the debug call, and it can't be done in our production environment. But it seems unlikely to me it would be implemented this way.
    I would cross-post this in the SQL AND PL/SQL forum though, as this is really a database issue, not with the SQL Developer tool. Do add the links to the other posts in each.
    Regards,
    K.

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • How to use the scanner class to ask for a character?

    Hey guys, this is my assignment:
    Ask the user for a single letter and a sentence, and print out the
    number of times that letter shows up in the sentence.
    Please tell me how to scan for a character. I tried this:
    import java.util.Scanner;
    public class Frequencies
        public static final void main(String[] args)
            Scanner scanner = new Scanner(System.in);
            Scanner scan = new Scanner(System.in);
            System.out.println("Enter a sentence");
            String x = scanner.next();
            System.out.println("Enter a letter to look for");
            String y = scan.next();
            char z = y.charAt(0);
            int chara = 0;
            for(int i = 0; i<x.length(); i++){
                    if(z==y.charAt(i)){
                            chara = chara++;
            System.out.println("There are " + chara + " " + z + "s in the sentence");
    }and got the error after Running (not compiling):
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 1
            at java.lang.String.charAt(String.java:687)
            at Frequencies.main(Frequencies.java:16)I thought this meant that I was asking for the character in postition 1 of string y, but in my code I wrote position 0
    when I tried inserting words in the character place (just to see what happened, not expecting functionallity, I got
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: [NUMBER OF CHARACTERS]
            at java.lang.String.charAt(String.java:687)
            at Frequencies.main(Frequencies.java:16)Please help.
    The assignment isn't due nor graded, this is just killing me lol.
    Thanks in advance
    Edited by: Sevan on Oct 18, 2008 4:40 PM

    jverd wrote:
    Skydev2u wrote:
    I've used this method for a while now and it gets the job done.
    import java.util.Scanner;
    public class ReadInput {
    public static void main(String[] args) {
    Scanner UserInput = new Scanner(System.in);
    char letter = UserInput.findWithinHorizon(".", 0).charAt(0);
    I know you're trying to help, but this isn't really doing it. It does nothing to address the source of the OP's problem. The way he's doing it now is almost right. He just needs to do a tiny bit of detective work to fix a small bug. Tossing off a totally different approach, with no explanation, is not particularly helpful.Your right jverd I skimmed the OP's problem too quick;y and in tern didn't understand it fully. After reading the post thoroughly I saw that the problem can be solved by taking the sentence the user enters and then converting it into a array of characters. Then searching for the specific letter the user enters is achieved by comparing it to each individual element of the char array. Then incrementing a counter variable each time a match is made. I hope this example code solve your problem.
    * @author skydev
    import java.util.Scanner;
    public class SentenceReader {
        public static void main(String[] args) {
            int counter = 0; //Amount of time the letter appears in the sentence
            char letter;    //Letter the user search for
            char[] sentenceArray; //char array to hold the elements of the string the user inputs
            String sentence; //sentence the user inputs
            Scanner UserInput = new Scanner(System.in);
            System.out.println("Please enter a sentence! ");
            sentence = UserInput.nextLine();
            sentenceArray = sentence.toCharArray(); //splits up the users sentence into a array of char
            System.out.println("Please enter a letter to search for ");
            letter = UserInput.findWithinHorizon(".", 0).charAt(0);
             for(int i = 0; i < sentence.length(); i++){
                    if(letter == sentenceArray){ //search to see if the letter of interest equals to each char (letter) of the array
    counter++; //increments the amount of time the letter appears, set to 0 by default
    System.out.println("The letter appeared " + counter + " times in the sentence"); //Displays the result :) I love programming

  • How to debug start routine for the custom code?

    Hi Experts,
    Can anybody tell me how to debug the start routine? Also could you please guide me where to write the custom code in the start routine.
    Thanks in advance.
    Sharat.

    Rajkumar,
    Thank you for your help. but the blog link that you send it to me does not mention anything about ABAP debugger screen.
    What should I do once I get in to the ABAP debugger? the link only tells how to get to the ABAP debugger that I know.
    Also it say that I have to use the infinite loop to debugg the start routine.
    Can anybody tell me how to debugg start routine with the scren shots please. I don't know how to use infinite loop in the start routine. Is their any easy process step by step to see my particular record behavior in the start routine?
    I will assing you the points. again thank you.

Maybe you are looking for

  • Can't transfer video to ipod classic

    I recently added 6 new videos to my Itunes library. When I tried to manually transfer them to my Ipod Classic only 1 of the 6 shows up on my Ipod. When I drag any of the other ones over it shows the little green plus sign, but never has the spinning

  • HP Pavilion x360 touchscreen stops working with Win 8.1 pro

    I currently have a HP Pavilion x360 2in1 convertible laptop.  The model # is 11-n010dx.  My issue is the touchscreen was working just fine with Win 8 on it, however, I need to be able to connect to my work network and that requires Win 8.1 pro.  I di

  • I want a push button for line items in my sales order entry screen.

    Hi, I want a push button for line items in my sales order entry screen. How can I do so? Thanks.

  • I just can't seem to get Home Sharing to work...

    I'd really appreciate your advice please... The setup - One PC running Itunes, one Apple TV on a wired connection and an Iphone and Ipad connected over wi-fi.  All are running the latest and greatest software versions. I now want to be able to stream

  • Another dreaded "-8" victim

    The Story: Bought MacBook to speak with & see my wife while on short term contract in Sweden. Home is in Canada. The first day I got it I could video chat from Sweden with my neighbour in Canada who lives one floor below us, but couldn't video chat w