Filter with first 2 char of field

Hi All,
I am creating a budget report, in that program i want to get data start with 'KS'
in my internal table i have object no all object no are different,
i want start with 'KS' object no... so which syntex i use in report
can you please guide me.
Thanks
Jigar

Hi Jigar,
Please have a look on the following code :
Suppose you have to retreive the data from lfa1 table for lifnr field starting with 'KS'.
Types: begin of str_data,
           lifnr type lifnr,
           land1 type land1_gp,
           name1 type name1_gp,
            end of str_data.
Data: it_data type standard table of str_data,
        wa_data type str_data.
Select lifnr land1 name1 into table it_data from lfa1 where lifnr like 'KS%'.
loop at it_data into wa_data.
write:/ wa_data-lifnr, wa_data-land1, wa_data-name1.
endloop.
This will retrieve the data for lifnr starting with 'KS'.
This is same as your requirement.
Hope this will help you.
Regards,
Nitin.
Edited by: Nitin Karamchandani on Aug 12, 2008 7:29 AM

Similar Messages

  • Problems with Relation for char field (Forms 9i)

    hi, people
    I have 2 DataBlocks. Every block has the same table of the database as a source.
    I create the relation between this two blocks. I use the primary key as a Join Condition.
    Primary key is the Char(10) field.
    All works OK until the value of this field doesn`t include the sign "_".
    If the PK field doesn`t contain "_" the record will be displayed in DetailBlock else will not.
    Help...
    Thank you

    Hi,
    This problem is due to failuer of navigation of mouse cursore. For more specific solution can you give the error message and error code, So that we can have exact picture. Waiting for error code......

  • The first 100 Chars in Struts

    Hi I am a novice struts user and I need HELP!
    I have a string Description in a vector with I then throw at the JSP. Here I am using c:out stuff to get it to print...BUT I need only the first 100 chars or so following by elipses...I know that there is a scriplet for a string but I can't figure out the command for a struts.
    Here is my code:
    <%@ page language='java'%>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    <html>
    <head>
    <title>Search Results</title>
    </head>
    <b> Results:</b><br><br>
    <c:forEach var="record" items="${SearchProgram}">
    <b> <c:out value="${record.acronym}"/> </b><br>
    <a HREF="https://enweb.mitre.org/program.do?programId=<c:out value=${record.programId "/>"><c:out value="${record.longName}"/><br>
    <a HREF="https://enweb.mitre.org/spo.do?spoPadId=<c:out value=${record.spoPadId"/>"> Mother SPO Homepage<br>
    <c:out value="${record.description}"/><br><br> <!-- THIS IS WHERE I PRINT DESCRIPTION-->
    </c:forEach>
    </html>

    No easy way to do this in JSTL/JSP code.
    Obviously you could use scriptlets record.getDescription().substring(0, 100)
    The better solution would be to populate the description (or maybe a short description?) field with the shortened value.
    ie add a method to your bean getShortDescription which gets the value you want.

  • Using Non-destructive filter with Nested XML data

    Hi,
    How do you use Non-destructive filter with Nested XML data?
    I am using the non-destructive filter sample with my own xml which is setup to search for the <smc></smcs> in my xml below. But when i test it it only searches the last row of the "smc". How can i make it work so it can search for repeating nodes? or does it have something to with how my xml is setup?
        <ja>
            <url>www.sample.com</url>
            <jrole>Jobrole goes here</jrole>
            <prole>Process role goes here...</prole>
            <role>description...</role>
            <prole>Process role goes here...</prole>
            <role>description....</role>
            <prole>Process role goes here...</prole>
            <role>description...</role>
            <sjc>6K8C</sjc>
            <sjc>6B1B</sjc>
            <sjc>6B1F</sjc>
            <sjc>6B1D</sjc>
            <smc>6C9</smc>
            <smc>675</smc>
            <smc>62R</smc>
            <smc>62P</smc>
            <smc>602</smc>
            <smc>622</smc>
            <smc>642</smc>
            <smc>65F</smc>
            <smc>65J</smc>
            <smc>65L</smc>
            <smc>623</smc>
            <smc>625</smc>
            <smc>624</smc>
            <smc>622</smc>
            <audience>Target audience goes here....</audience>
        </ja>
    here is the javascript that runs it.
    function FilterData()
        var tf = document.getElementById("filterTF");
        if (!tf.value)
            // If the text field is empty, remove any filter
            // that is set on the data set.
            ds1.filter(null);
            return;
        // Set a filter on the data set that matches any row
        // that begins with the string in the text field.
        var regExpStr = tf.value;
    if (!document.getElementById("containsCB").checked)
            regExpStr = "^" + regExpStr;
        var regExp = new RegExp(regExpStr, "i");
        var filterFunc = function(ds, row, rowNumber)
            var str = row["smc"];
            if (str && str.search(regExp) != -1)
            return row;
            return null;
        ds1.filter(filterFunc);
    function StartFilterTimer()
        if (StartFilterTimer.timerID)
            clearTimeout(StartFilterTimer.timerID);
        StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
    I really need help on this, or are there any other suggestions or samples that might work?
    thank you!

    I apologize, im using Spry XML Data Set. i guess the best way to describe what im trying to do is, i want to use the Non-desctructive filter sample with the Spry Nested XML Data sample. So with my sample xml on my first post and with the same code non-destructive filter is using, im having trouble trying to search repeating nodes, for some reason it only searches the last node of the repeating nodes. Does that make sense? let me know.
    thank you Arnout!

  • Jpa native query returns only first character of a field

    Hi,
    I've a JPA native query that returns two fields from my oracle database. The first field is a CHAR(2) field with two char values in it, like 'OZ' etc.
    The problem is, as soon as the query is executed it returns only first character of field1. If the actual value of field1 is like 'OZ' then it returns only 'Z'.
    Query nativeQueryForProfileInfo = getManager().createNativeQuery(queryToRun);
    List list = nativeQueryForProfileInfo.getResultList();
    Please help,
    thanks

    There could be several explanations here and it's difficult to say without having more details, possibilities are
    There is something wrong with your display logic.
    There is something wrong with your mapping.

  • Problem with READ Statement in the field routine of the Transformation

    Hi,
    I have problem with read statement with binary search in the field routine of the transformation.
    read statement is working well when i was checked in the debugging mode, it's not working properly for the bulk load in the background. below are the steps i have implemented in my requirement.
    1. I selected the record from the lookuo DSO into one internal table for all entried in source_packeage.
    2.i have read same internal table in the field routine for each source_package entry and i am setting the flag for that field .
    Code in the start routine
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
         and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp <> 3.
    delete it_zcam where end_dt initial.
    sort it_zcam by surce accno.
    endif.
    field routine code:
    read table it_zcam with key source = source_package-source
                                                 accno  = source_package-accno
                                                 binary search
                                                 transportin no fields.
    if sy-subrc = 0.
    RESULT  = 'Y'.
    else.
    RESULT = 'N'.
    endif.
    this piece of code exist in the other model there its working fine.when comes to my code it's not working properly, but when i debug the transformation it's working fine for those accno.
    the problem is when i do full load the code is not working properly and populating the wrong value in the RESULT field.
    this field i am using in the report filter.
    please let me know if anybody has the soluton or reason for this strage behaviour.
    thanks,
    Rahim.

    i suppose the below is not the actual code. active table of dso would be /bic/azcam_o1100...
    1. is the key of zcam_o11 source and accno ?
    2. you need to get the sortout of if endif (see code below)
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
    and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp 3.
    delete it_zcam where end_dt initial.
    endif.
    sort it_zcam by surce accno.
    field routine code:
    read table it_zcam with key source = source_package-source
    accno = source_package-accno
    binary search
    transportin no fields.
    if sy-subrc = 0.
    RESULT = 'Y'.
    else.
    RESULT = 'N'.
    endif.

  • How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys?

    How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys an see at the same time the changes on the photo?
    It worked under Windows, now I use OS 10.8 and have to apply a preset with a click or Return button but after that the pop-up menu close so I have to open it once again to change a preset. Please help. Thank you!

    The filter panel is a shortcut for the content panel and it only effects the content of that window. So if you have a folder it will only see this as a folder and not with its content. (a Stack behaves about the same, being different in only counting the first file in the filter panel criteria but not what is in the stack itself)
    You have a view work arounds, first is use menu view / show items from subfolders (this can take some time especially if you have not used caching before on this content) and this builds visible thumbs for all content and that can be used for filtering.
    Or use the find command (Edit / find) and inhere specify the source and fill in the criteria include subfolders and this will give you the correct result.
    When you create a smart collection the find command also pops up given you the same opportunity to get the results in a collection, but since a collection is only a bunch of aliases referring to the originals you might be a bit careful with editing and deleting.

  • SharePoint 2010 list view - How to filter on a multiline text box field - the view filter does not allow me to select it.

    Hi there,
    Does someone know in SharePoint 2010 list view - How to filter on a multiline text box field - the view filter does not allow me to select it.
    Thanks,

    Hi,
    Per my knowledge,
    it is by design that the data type multiple lines of text can only use “contains” and “begins with” operators.
    You can also filter the list view using SharePoint Designer,
    Open your list AllItem.aspx page in SPD ->click “Filter” > in “Field Name” select your multipe line of text field, in “Comparison” will displayed four choices.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Camparing file name with a value of the field in the source

    Hi All,
    I have a file sender. I need to compare the file name with the value of a field in the source and then map to the target.
    For example:
    <Record>
         <Date>20071103></Date>
         <name>abcd</name>
    </Record>
    the name of the file would be 20071103. i need to check this file name with value in 'date' field , if its true then we need to map it to target
    please suggest some way to meet the reqirement
    thanks
    jhansi

    Hi,
    Here is the reason i need to do this:
    The data is loaded by DTP in process chain. Overlaping requests are deleted. But, iIn some cases requests with the same selection options  need not to be deleted. My idea was to change selection options in Manage(infocube) with Abap program without changing selection options in DTP filter,  so that the system would not recognize requests as "overlaping requests".
    So, where is the information about shown in the field Selection Options is stored? In which tables?
    Thanks
    Tigr_Z

  • Bex Analyzer - Is is possible to filter with Ranges?

    Dear All,
           I've currently created a view on top of a query. Now I need to filter this view based on a field with from and to values. Say I want to see the records where order number is from 1 - 20. Order number is a part of the view. Is there a way to get all the rows for this range filter criteria?
    Thanks for your help,
    regards,
    SL

    Hi,
    This is possible.
    Select the characteristic you want to Filter->Right click and "Select Filter Value"->In the selector dialog,select "Value Ranges"->Select the From and To values and click OK.
    Now the values in the report will be filtered based on the From and To values selected in the selector.
    Rgds,
    Murali

  • Mail sending FM with subject 50 chars?

    Hi all,
    We are using "SO_DOCUMENT_SEND_API1" to send the mail. We using this FM specifically as it has the option to override the name of the sender of the mail as well (using "SENDER_ADDRESS" field).
    But the issue with this FM is that the field used for Subject of the mail is "DOCUMENT_DATA-OBJ_DESCR" which is "CHAR 50" field. So it wont allow us to have being subject line, which is exactly what require.
    So could some one please let me know if there is any FM which has the facility to override the sender name (i.e, mail id) and also give us the facility to have subject line more than 50 chars??
    Any info regarding this will be of great help.
    Regards,
    Narahari

    Hi Narahari,
    You could copy the FM to Z function module and try to use ur own structure to pass subject that can have more taht 50 chars.
    Cheers
    Ankur

  • Select first 4 char

    Hi all,
    I am new to ABAP.
    I want select first 4 char of  variable.
    Example:
    X = '627128891'.
    i want first 4 char of X  save to Y.
    Y= '6271'.
    How can I do it with ABAP statement?
    Thanks
    Shiva.

    hi,
    data x(10) type c value '1234567'.
    data y(4) type c.
    y = x0(4).   " xn(m) n is the starting position and m no of character from n.
    output y = 1234.. first four characters
    y = x+2(2).
    output y = 34 ..
    rewards if understood..
    regards,
    nazeer

  • UDF for Replace first 4 char

    Hi Friends,
    Can anyone please provide me UDF for following Condition
    my input is 123456 or 1234567.i need read first 4 char and replace it by sw..the output should be sw56 or sw567
    Thanks in adv.
    Reg,
    dinesh
    Edited by: Dineshbabu.M on Feb 18, 2011 2:20 PM

    Hi,
    This simple UDF will do what you want:
    The UDF takes a single String array as input, say s[ ] and it has a single ResultList item result as output.
    The complete code is as follows:
    s[0]="sw"+s[0].substring(4,s[0].length());
    result.addValue(s[0]);
    Pass the output of the UDF to the required target field. That's it.
    HOPE IT HELPS YOU BUDDY!!!
    THANKS
    BISWAJIT
    Edited by: 007biswa on Feb 18, 2011 7:04 PM

  • Filter with checkbox

    I am attempting to build a filter that will add or remove
    items from a Datagrid. The two fields I would like to filter are
    categories and locations. I would like to filter the two fields
    with a checkbox for each field. Here is the example. A user selects
    a location which filters the categories available at that location,
    it also filters the Datagrid. The user then selects a category
    which filters the DataGrid. If the user removes the check mark, the
    filtered data is removed from the DataGrid. The filter also has the
    ability to display all items.

    1) all the checkboxe's click event can point to same event
    listener
    2) event.currentTarget would tell you what checkbox has been
    clicked on
    3) you'd need to maintain a list of all the checked boxes
    4) implement a filter function based on the list and set it
    to the filterFunction property of the ArrayColleciton that you're
    using to populate the datagrid
    Hope this helps.
    ATTA

  • ISync adds a "-" to contacts with First/Last Name Blank

    Hello, I'm using iSync 2.3 with a Nokia 8800 (S40) and Sonyericsson T610.
    When a contact's name is First name:John Last name:Smith, it syncs properly to my phones as "John Smith".
    With First name: John Smith Last name: empty, it syncs as John-Smith-.
    Same goes with a blank first name. Some of the contacts only have a first name written in, anyone knows how I can get rid of the extra -s?

    I'm not aware of anyone called just "John"! Everybody I know has at least a first name and a last name... therefore that is the data I enter into Address Book and iSync works fine for me and all my Sony Ericsson phones.
    If you don't provide the required data, you can't really expect iSync to work correctly.
    There is a reason for this... its because most phones don't split First and Last Name into two fields like Address Book does. So, if you have a contact named just "John" with no last name, when you sync, how does iSync know whether "John" is a First or Last name?
    To get around this iSync adds a '-' into the blank field, so that when syncing back it knows where to put the data.
    The solution is extremely simple, just provide Address Book with a first and last name (which AFAIK everyone has).

Maybe you are looking for