How to pick up the last value of the input string

Hi there,
I have a requirement in which I have to pick up the last value of the input string.
I don't know the field length, it could be 10 line, it could be 4 line and it could be even 1 line.
Another problem is that the field contains all the alphanumeric values so the sort function is not working.
I believe I need to write a UDF but not sure exact what and how.
Can some body please help me solving this issue.
Input.
1.Abc
2.abc123atxx.com
3.(980)771-2341
4.
5.518VR50V58AD10DSAYBDSAFDSIEGHA:1
In that case I only need to pickup the last value i.e. 518VR50V58AD10DSAYBDSAFDSIEGHA:1
Output
518VR50V58AD10DSAYBDSAFDSIEGHA:1
Note:
1. Length is unknown
2. Alphanumeric data
Thanks,

Hi karthick Lakkar,
Thanks for your quick response but unfortunately I am getting mapping exception.
What I did is create a UDF with 2 input
INPUT
a string
b string
and then this code
int Length=Integer.parseInt(a);
int requiredLength=Integer.parseInt(b);
if(Length<=requiredLength)
return(a);
else
return a.substring((Length-requiredLength),Length);
I am wondering about the input as well.
At present I am doing
KTEXT + KTEXT --- UDF
+ does represent concat, means same input will go to the UDF
This is the error which I am getting
Exception:[java.lang.NumberFormatException: For input string: "Kevin Farrar"] in class com.sap.xi.tf._MM_XXXXXXXXXXXXXX_ method calculate[Kevin Farrar, Kevin Farrar, com.sap.aii.mappingtool.tf7.rt.Context@6dbf19db]

Similar Messages

  • Restrict the input string length

    Hi, how do I restrict the input string length in a JTextField. Suppose if I want my text field to accept only 4 characters, the fifth character I try to enter shouldn't be accepted in the field.
    Thanks,
    Kalyan.

    This is for 6 characters limit
    //create a JTextField that is six characters long
    JTextField textField = new JTextField(new FixedNumericDocument(5,true),"", 6);
    Here boolean true means only numeric. set to false to take in alphanumeric.
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    public class FixedNumericDocument extends PlainDocument {
    private int maxLength = 9999;
    private boolean numericOnly;
    public FixedNumericDocument(int maxLength, boolean numericOnly) {
    super();
    this.maxLength = maxLength;
    this.numericOnly = numericOnly;
    //this is where we'll control all input to our document.
    //If the text that is being entered passes our criteria, then we'll just call
    //super.insertString(...)
    public void insertString(int offset, String str, AttributeSet attr) throws BadLocationException {
    if (getLength() + str.length() > maxLength) {
    return;
    else {
    try {
    if (numericOnly) {
    Integer.parseInt(str);
    //if we get here then str contains only numbers
    //so that it can be inserted
    super.insertString(offset, str, attr);
    catch(NumberFormatException exp) {
    return;
    return;

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • How do I program Instrument I/O Assistant to read a variable in the input string?

    How do I program the Instrument I/O Assistant to read a variable in the input string? I can manually type in the string using the Instrument I/O Assistant using the "Write" or "Query" tools but I do not know how to send a variable input to the Instrument I/O Assistant so that variable can be used inside the "Write" string. For example, I have a power supply whose current I want to set to X Amps. I can type the command "PC10" to program the current to 10 Amps, however I want to be able to program it at any arbitrary current. How do I feed the value X into the code for this purpose?

    You can't. The assistant was designed to be a quick and dirty way to do some basic communication with an instrument. You can turn it into a VI (right click and select Open Front Panel) and modify it so that your write string is an input to the VI or use it as a template and create your own code with VISA Read and Write primatives.

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • How can we change the input field on a view stop showing zeros

    Hello,
           To make screen look consistent with other character input field. How can we change the input field on the view stop displaying zeros even though the data type is NUMC and data type should not be change?
    Edited by: sap_learner on Mar 25, 2010 5:44 PM
    Edited by: sap_learner on Mar 25, 2010 5:49 PM
    Edited by: sap_learner on Mar 25, 2010 5:55 PM

    hello Manas Dua,
                           Thanks for your help. I am able to resolve my problem.
    My code will help  the future comers to resolve this kind of issues.
    *The code is applied to method WDDOINIT of the default view.
      DATA lo_nd_terms_input    TYPE REF TO if_wd_context_node.
      DATA lo_nd_terms_input_i TYPE REF TO if_wd_context_node_info.
      DATA lv_zeros             TYPE wdy_attribute_format_prop.
      lv_zeros-null_as_blank = 'X'.
      lo_nd_terms_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
      lo_nd_terms_input_i = lo_nd_terms_input->get_node_info( ).
      lo_nd_terms_input_i->set_attribute_format_props(
        EXPORTING
          name              = `ENTER THE ATTRIBUTE NAME`
          format_properties = lv_zeros     ).
    Edited by: sap_learner on Mar 26, 2010 5:02 PM

  • How is to set the input range of PCI-MIO-16E-1 (6070E) to be 0 to +5V?

    How is to set the input range of PCI-MIO-16E-1 (6070E) to be 0 to +5V? Thank you very much.

    Hi x2am,
    Here is a link to a document about setting input range limits.
    DAQ Input Limits
    Hope this helps!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

  • When you set up tracks what is best to pick for the input and output?

    When you set up tracks what is best to pick for the input and output? also what is the buss output? Thanks

    First part of the question I don't understand, so could you elaborate please?
    Second part: bus output is used for submixes, for example, let's say you want the same EQ to be applied to all guitars in the song, so instead of using same EQ plug-in on all guitar tracks, you feed the output from these tracks to a bus track and use the effect just once on this bus submix.

  • How do I get the 12 string effects in MS 3 jam pack 1 to work in garageband

    How do I get the 12 string effects in MS 3 jam pack 1 to work in garageband '11

    How do I get the 12 string effects in MS 3 jam pack 1 to work in garageband '11

  • How to pick up the latest report instance of a schedueld report

    Hi,
    I am supporting a custom application (.NET), which has to pick up the latest report instance by accepting the Report ID.
    At times, the application does seems to be pick up the wrong (older) instance. This is not happening all the times but certain reports behaves this way once a while.
    This is how the application seems to be determining the latest instance.
    SELECT * FROM CI_INFOOBJECTS
    WHERE SI_PROGID = 'CrystalEnterprise.Report'
    AND SI_INSTANCE_OBJECT = 1
    AND SI_SCHEDULE_STATUS = 1
    AND SI_PARENTID= '" + id + "'
    ORDER BY SI_ID DESC
    Once the above statement returns all the available instances it just pick up the very first instance and returns it back to the application and it gets displayed through the Report Viewer.
    My question here is that, does this order (ORDER BY SI_ID DESC) will always return me the latest instance first? When I manually verify the instance ID, it seems to be getting incremented eventhough it is a random number.
    When I review the InfoView code, which also seems to be doing the same thing I have found that it is using SI_UPDATE_TS instead of SI_ID.
    Could someone please tell me which is the correct one to use? I tried by could not able to find references anywhere.
    Environment: BO XI R2 - SP2

    Jason,
    Thanks for the info. The query builder o/p and the application o/p are the same. When this situation happened last time I just simply deleted those older instances from the history and left only the current one.
    This has forced the query to return the only available instance, which is the current one.
    My suspect here is that, the SI_ID of a new instance is smaller than the older instance...
    for example,
    Instance 1 - 10023
    Instance 2 - 12344
    Instance 3 - 9892
    Is this possible?? Since I have deleted the older instances I have no way to confirm this case unless it happens again.
    The BO documentation about SI_ID reads like this...
    "This property is used to uniquely identify an object. The number is assigned at creation time, and is never changed until the object is destroyed. You should never hard-code this number, however, since if the object is destroyed the number may be assigned to another object. No two objects have the same ID, even if they are different types of objects; that is, you will never find a report that has the same ID as a folder."
    As it claims that an ID can be re-used if the object is destoryed I assume that though the new ID will be unique there is no guarantee that it will be bigger than the previous instance of the same object.
    But the problem is that I dont have a documentation proof to claim this hence asking help from the guru's here...
    Regards,
    Elan.

  • How to pick up the tcode MB51 search speed

    hi
    in the TCODE MB51 selection screen of header data block.
    if only set reference field(MKPF-XBLNR) for SELECT CONDITION.
    the query will be comparatively slow.because the mkpf table is very large in my system.
    how to pick up.
    in other table exist index for reference field to link material document????
    thank you .

    Hi,
    For Material document the following are the tables;
    MKPF     Material document (no index for XBLNR)
    MSEG   Material document (item level)
    MLHD     Material Ledger Document: Header
    1. Generate Index...
    2. Modify the report to make sure the user entres the few combination from Item data  & Posting date from Header data...
    Thanks,
    Prabhu Rajesh

  • How to pick out the main body/article when surrounded by ads ?

    Hi all,
    First of all, not exactly sure where I should post this, so please let me know a better forum if you know of one.
    I am working with a linguisitic search engine that takes pdf articles and indexes them based on lists of keywords, and then does word counts. For this latest project the pdfs are downloads of newpaper articles, typically 1 to 2 pages long. My linguistic engine works on these fine but because these are downloads from the web, the pdfs have extraneous advertisements and links (and so on) surrounding the main article. This leads to false negatives and so I need to get rid of the things around the main body. If the articles were all written with the same format  (e.g. headline at the top and then some sort of copyright at the end) I 'd be able to focus the linguistics engine solely on the article. Unfortunately that is not the case. What I am considering now is some sort of pre-processing using some sort of pdf editor. From what I understand text in the pdf format is stored in elements which describe the layout. Typically, within an article the width of the actual article remains the same. The article typically spans a larger width than say something like an advertisement which contains a link and a description. Would it be possible to pick out the text elements based on something like width or font-type and then save just those portions to another pdf or text file? Can one do such things with Acrobat or the SDK? I'll have about 5-10,000 docs to work on. Thus I need an automated procedure. Going thru manually and copying&pasting the relevant portions will be too tedious. Thanks for any suggestions.

    It's really hard to say what will be possible without the benefit of seeing a typical example. It's not generally true that "...text in the pdf format is stored in elements which describe the layout..." If the ads are in consistent locations (e.g., on the right 2 inches of the page), you can automate the redaction process using JavaScript.

  • How to pick up the 3d model after change the picture control to the Opengl control?

    Colleagues,
    I have a problem when I use the cvi.I need to draw a 3D model use the opengl in the picture control,and pick up the mode.For example,I transfer the picture control to the Opengl control,then draw a cube and sphere by Opengl。And I want to pick up them。Such as,when mouse click the cube,it will show a MessagbBox("a cube");when mouse click the sphere,it will show a MessagbBox("a sphere");But it doesn't work.
    I'm a chinese student and juse begin to learm the cvi.And my English isn't very good.I don't know whether the problem has been clear.Anyone can help me?

    I haven't used the OpenGL CVI addition for years, but IIRC there is (was?)
    no callback associated to it. Meaning that some actions are defined within
    the OpenGL control, such as rotation/zoom, but that's it.
    Guillaume Dargaud
    http://www.gdargaud.net/

  • How to pick up the default format in XDO by ESS Post-Processing Actions

    Hi,
    I used PLSQL to generate the BIP output
    ess_runtime.add_pp_action(
    props => l_request_props,
    action_order =>1,
    action_name => 'BIPDocGen',
    on_success => 'Y',
    on_warning => 'Y',
    on_error => 'Y',
    file_mgmt_group => 'XML',
    step_path => NULL,
    argument1 => 'APINVSEL',
    argument2 => 'pdf', -- Bug 9019934
    argument3 => l_iso_language || '_' || l_iso_territory);
    But we set the output format the argument2 to "PDF" so the format of output will always be PFD. Could we pick up the default fomat defined in the XDO file?

    Hi,
    in our case (EBS R12.1.3) the templates are stored in table xdo_templates_b, so you can query that one to get the default output type. Example:
    select xt.template_id
         , xt.template_code
         , xt.default_output_type
      from xdo_templates_b xt
    where xt.template_code = p_template_code
       and xt.application_code = p_app_code
       and xt.data_source_code = p_data_source_codeThen you can use the results of that query to pass the default output type to ess_runtime.add_pp_action.
    regards,
    David.

  • Pick up the input file if delta betweeb two files is 30%

    Hi Experts,
    A file is placed at the source folder..will it be possible for XI to check if previous file exists in that folder..
    If yes then if th diffrence between both fields is greater than 30 % then pick up the file???
    I do not see any which way it can be done in XI..
    pls share ur thoughts..
    Regards,
    Teja
    Edited by: Ravindra Teja on Jan 24, 2010 8:53 AM

    Thanks Michal...
    Yes this is a nice idea..lemme start off right away...
    I ll have to put a . right???
    any help onthe code???
    Would ther be some blog on reading both files or how to read an attachment using adapter modules??
    appreciate ur help
    Edited by: Ravindra Teja on Jan 24, 2010 11:54 AM

Maybe you are looking for