How to search records in a standard table with * ?

Hi everyone,
Can anyone tell me how to search records in a standard table with * ?
That is, in screen if user type * abc * for searching the records in which the field MC_STEXT contains 'abc'. What the code should be? How to complete the code below?
  SELECT SINGLE objid FROM p1000  INTO p1000-objid,
  WHERE MC_STEXT = ? .
Thanks!

Hi
There are several way to do that, probably just as some guys wrote the easier way is to use LIKE in WHERE condition and the sign % instead of *:
V_STRING = '%ABC%'.
SELECT SINGLE objid FROM p1000 INTO p1000-objid,
WHERE MC_STEXT LIKE V_STRING.
U can also use a range (just like select-options):
RANGES: R_MC FOR P1000-MC_STEXT.
R_MC-LOW = 'ABC'.
R_MC(3) = 'ICP'.
APPEND R_MC.
SELECT SINGLE objid FROM p1000 INTO p1000-objid,
WHERE MC_STEXT IN R_MC.
Max

Similar Messages

  • How to delete records from dynamic internal table.

    Hi Experts,
    Need urgent help!!!
    Issue is with Dynamic internal tables.
    Below is code written by me :
    FORM select_query USING Lw_tabnam
                      TYPE  t682i-kotabnr.
      DATA :  lw_line  TYPE REF TO data,
              lw_line1 TYPE REF TO data.
        CREATE DATA Lw_line    TYPE (lw_TABNAM).
        ASSIGN      Lw_line->* TO   <WA_tbl>.
        CREATE DATA LW_LINE    TYPE STANDARD TABLE OF (Lw_tabnam)
                               WITH NON-UNIQUE DEFAULT KEY.
        ASSIGN      Lw_line->* TO <TBL>.
        SELECT * FROM  (Lw_tabnam)
                 INTO CORRESPONDING FIELDS OF TABLE <TBL>
                 WHERE (t_keys).
    Endform.
    code is working fine.
    here even the table name and where condition are dynamic,everything is fine upto this point.
    Now i have to delete some record from <TBL> based on some conditons.
         for ex : ( here lc_fieldname is KUNNR)
          loop at t_kunnr.
              lw_tabix = sy-tabix.
            Read table <tbl>
                    with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
            If sy-subrc = 0.
            *Delete
            delete <tbl> from <wa_tbl>
    delete <tbl> index  lw_tabix.
            Endif.
         Endloop.
    The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
    Can you help me ab't how to delete records in Dynamic internal table?
    Other option that i am thinking of is to create a static table of type dynamic table.
    means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
    Thanks in advance ,
    If you have any suggestion ab't this then do let me know.
    bye,
    Gaurav.

    Hi
    I wrote this code and it works fine:
    DATA LW_TABNAM(10) VALUE 'LFA1'.
    DATA : LW_LINES TYPE REF TO DATA,
           LW_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE,
                   <WA>    TYPE ANY.
    CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN LW_LINES->* TO <TABLE>.
    CREATE DATA LW_LINE TYPE (LW_TABNAM).
    ASSIGN LW_LINE->* TO <WA>.
    DO 10 TIMES.
      APPEND INITIAL LINE TO <TABLE>.
    ENDDO.
    SY-TABIX = 4.
    DELETE <TABLE> INDEX SY-TABIX.
    WRITE SY-SUBRC.
    I hope it help you
    Max

  • Number of records in a standard table

    Hi,
    How to find number of records, without fetching them into a internal table?
    is there any command for that?
    I want to know the number of records of a standard table in a report.
    Thanks

    Hi,
    If you want to know the number of records in your internal table after select statement.
    You can use the below statement.
    data : wa_lines like sy-tfill.
    DESCRIBE TABLE itab LINES WS_LINES.
    In wa_lines you will have the number of records.
    If you want to know the number of records from standard itself.
    You can use below :
    select count(*) from table into variable
    endselect.
    Thanks,
    Sriram Ponna.

  • How to spool in excel sheet of table with 1561828 records

    how to spool in excel sheet of table with 1561828 records
    i think excel got only 65l limit?
    COUNT(*)
    1561828
    i am using windows box...any suggestions?

    Raman wrote:
    means excel 2007 can hold 15,61,828 records ? can i give like spool filename.xls?You can name the spool file anything you want, but surely you realize that naming it 'filename.xls' doesn't make it an xls file. A name is just a name. There are industry standards on certain names indicating certain file formats, but the name doesn't make it that format.

  • How to display records into a non table base block..

    Hi,
    Can anybody help me how to display records into a non table base block....
    Find below is my coding but it only display the last record in the first line
    in the block.
    PROCEDURE CREATE_CARTON_QUESTION IS
    CURSOR car_c IS
    select /*+ rule */ question_id, question_description
    from WHOP.QADB_QUESTIONS
    where question_category = 'Carton'
    and question_active_flag = 'Y';
    v_found VARCHAR2(10);
    v_status boolean;
    v_error      varchar2(150);
    v_count number;
    car_r car_c%rowtype;
    begin
    begin
    select count(*) into v_count
    from WHOP.QADB_QUESTIONS
    where question_category = 'Carton'
    and question_active_flag = 'Y';
         exception
         when no_data_found then
         v_count := 0;
    end;
    if v_count > 0 then
    for car_r in car_c loop
    ---populating carton questions
    :la_carton.carton_question_id     := car_r.question_id;
    :la_carton.carton_question_answer     := 'N';
    :la_carton.carton_error_details     := null;
    :la_carton.attribute2          := car_r.question_description;
    end loop;
    end if;
    end;
    Thanks in advance.
    Regards,
    Jun

    Hi SNatapov,
    Thanks for you reply but still I get this error...
    FRM-40737 Illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-ITEM trigger.
    Please note that I call that program unit in the last field of my control block inside when-validate-item trigger the questions should be display in la_carton block which is my non-base table block.
    Find below is the code....
    begin
    go_block('la_carton');
    first_record;
    for car_r in car_c loop
    ---populating carton questions
    :la_carton.carton_question_id := car_r.question_id;
    :la_carton.carton_question_answer := 'N';
    :la_carton.carton_error_details := null;
    :la_carton.attribute2 := car_r.question_description;
    next_record;
    end loop;
    end;
    Hoping you can help me this problem...
    Thanks in advance.
    Regards,
    Jun

  • How to search records using netbeans

    i'm using netbeans.....how to search records from database
    pls help me

    Not at all....i'm familar with java,i stucking in button coding,that is
    how to match with database.
    public String buttonGo_action() throws SQLException {
    // TODO: Process the action. Return value is a navigation
    // case name where null will return to the same page.
    System.out.println("Action******");
    String sname=(String) textsearch.getText();
    sname = "%"+ sname+"%";
    grc_risks_customer_info_tableDataProvider.setCursorRow(grc_risks_customer_info_tableDataProvider.findFirst("NAME",sname));
    //.findFirst("GRC_RISKS_CUSTOMER_INFO_TABLE",sname));
    getSessionBean1().getGrc_risks_customer_info_tableRowSet().setString(1,sname);
    grc_risks_customer_info_tableDataProvider.refresh();
    this coding is not working...that's y...

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • How to search for a message or thread with a known message ID in forum?

    How to search (or "swich") to a thread with a known ID ? The "Search
    Message" yields no results when searching for a message ID. Is there a
    other proper way for referencing a thread or message?

    If you want to keep the threads for yourself, you can use your favorites menu or the site's bookmarks option.
    If you have to transfer the number to some one else, the URL format looks fairly simple -
    http://  forums.ni.com/ni/board/message?board.id=board number\name&message.id=your number.
    if you enter the same board, you will have the board number. This doesn't look like a particularly convenient way, but I don't have a problem with copying and pasting URLs.
    The other option would be to do a search, but that is not guranteed to give you an exact answer.
    Try to take over the world!

  • How to know the the list of tables with no rows inside a schema?

    with reference to
    http://www.ss64.com/orad/USER_TABLES.html
    How to know the the list of tables with no rows inside a schema?
    I try this select table_name from user_tables where num_rows=0;
    I can found one table that is empty.
    So what's the query to return list of tables in a schema which has no rows?
    thanks

    You can do that only if your have collected the stats properly. Otherwise its going to show you wrong information.
    Check this out...
    SQL> drop table t
      2  /
    Table dropped.
    SQL> create table t
      2  as
      3  select level no from dual connect by level <=100
      4  /
    Table created.
    SQL> select table_name,num_rows from user_tables where table_name = 'T'
      2  /
    TABLE_NAME                       NUM_ROWS
    T
    SQL> begin
      2      dbms_stats.gather_table_stats(user,'T');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> select table_name,num_rows from user_tables where table_name = 'T'
      2  /
    TABLE_NAME                       NUM_ROWS
    T                                     100
    SQL>Thanks,
    Karthick.

  • How to change the search help in the standard table?

    Hello Experts,
    Due to service package installation the search help in standard table (VBAP)  field (KDMAT) was changed from Collective search help (VMCV)  to elementary search help (VMCVA).
    Now I need to change the elementary search help to Collective search help, without taking the Access Key.
    Please suggest me the appropriate solution

    hi
    In SE11, go to the change mode of the collective search help and add the elementary search help, in the INCLUDED SEARCH HELPS tab.for including elementary search help, you just have to enter the name of search help along with its parameter in collective search help
    system autimatically takes selection method and dialog from elementary search help
    regards
    Prashant

  • Changing The record in a Standard Table

    Hi,
        I need to change the record which i had entered in the standard table.I can able to delete it by going in to the debugging mode but my question is how to change the record.
    Regards,
    Vijaya Lakshmi

    To update the data of any table, go to transaction SE16N, type u201C&SAP_EDITu201D. It will activate SAP editing function.
    Esle.
    Opern any record in SE16.Double click on the record so that all the fileds will be displayed in vertical format.
    start debugging by /H
    change the value of "code" to "DELE" and execute.
    Moreover if you want to do this in PROD environment, I would NOT use the SE16n way, due to dependencies, which can have unwanted effects (database inconsistencies). Although in this case (only Name of customer), it might not be as bad as it normally would be.

  • How to search the content in a Table

    Hi all,
        How can i search the content in a table. is there any UI Element is there to do this? Can any body give me any sample code for this
    regards,
    VJR

    Hi,
    you gotta do that programmatically,
    here is a sample code:
    int sizeOfstudent = wdContext.nodeCtx_vn_student().size();
    //Ctx_vn_student is the node associated with the table ie its dataSource property
    String filtername = wdcontext.currentContextElement.getSName();
    //sName is the name to be searched , it is a context attribute
              for(int i = sizeOfstudent-1;i>=0;i--)
                   String matchValue = recNode.getElementAt(i).getAttributeAsText("Name");
    //get the name of 1st record(in table) or 1st elememnt in node, "Name" here is value attribute of that node
    //so we are fetching its value and comparing it like..
                   if(matchValue.equalsIgnoreCase(filtername))
                        //here you can add the action to be taken on mathing name                }
    hope it helps
    regards

  • How to insert values in the standard table

    Hi Experts,
      I have a Standard table ( Info structure ), its called S551. It having 20 fields, Now i want to insert some 1000 records inthat table from Excel sheet, can any one plz help this.
      If i tried in se11, with create entries option its not allowing to insert the values manually inthat table.
    Plz help this. Point will be sure.
    Mohana

    Hi Mohana,
    U can't insert the records directly in to the standard data base table. Also it is not advisable. It is always better to use BAPI/BDC to upload mass data.
    I advise to write a small program for this.
    Upload the excell file to internal table which is having same structure of S551.
    use FMs TEXT_CONVERT_XLS_TO_SAP or GUI_UPLOAD for uploading data from excell to internal table.
    INSERT/MODIFY S551 FROM itab.
    Make sure that ur excell file structure and internal table structure matches and
    U have values for all the primary keys of the table and don't have duplicates(primary key).
    Thanks,
    Vinod.

  • How to compare records in singe internal table

    Hi Folks,
    iam having 3 records in my first itab( T_FINAL) with fields
    material no,  descrip ,  mat type and  group.
    and 16 records in second itab(T_MVKE ) with fields
    mat no ,  distri.chanel  and division
    now I want to fetch the records from T_MVKE  by comparing the records in
    T_FINAL .my requirement is to check the given mat no. in sales org.2000,2100.  if yes then i have to consider 2000 only, if it is in only 2100 then consider 2100 only . is it is in 2000 only then consider 2100 only
    my code is
    LOOP AT T_FINAL.
        READ TABLE T_MVKE WITH KEY MATNR = T_FINAL-MATNR.
       IF SY-SUBRC = 0.
       ON CHANGE OF T_MVKE-MATNR OR T_MVKE-VKORG.
    IF T_MVKE-VKORG = '2000' and SY-TABIX > 1.
          CONCATENATE '2000' 'TS' P_WERKS T_FINAL-MATNR INTO KEY.
    ELSEIF T_MVKE-VKORG = '2000' AND SY-TABIX = 1.
         CONCATENATE '2000' 'TS' P_WERKS T_FINAL-MATNR INTO KEY.
    ELSE.
        CONCATENATE '2100' 'TS' P_WERKS T_FINAL-MATNR INTO KEY.
        ENDIF.
    this logic fails ,. could tell me how to compare values in single itab?
    Thanks
    neha

    Hi ,
    if i've understand you correctly , try that:
    LOOP AT t_final.
      AT NEW matnr.
        CLEAR: v_2000, v_2100.
    *1) 2000
        READ TABLE  t_mvke    WITH KEY matnr = t_final-matnr
                                       vkorg = 2000.
        IF sy-subrc = 0.
          v_2000 = 'X'.
        ENDIF.
    *2) 2100
        READ TABLE  t_mvke    WITH KEY matnr = t_final-matnr
                                       vkorg = 2100.
        IF sy-subrc = 0.
          v_2100 = 'X'.
        ENDIF.
    *compare
        IF v_2000 = 'X' AND  v_2100 = 'X'.
    *read 2000 only
        ELSEIF v_2000 = ' '  AND v_2100 = ' '.
    *nothing found
        ELSE.
    *all other combinations
    *read 2100 only
        ENDIF.
      ENDAT.
    ENDLOOP.
    regards Andreas

  • How to create a Attribute "Type standard table OF" to a OSS NOTE

    Dear experts,
    I need to add new attributes in a standard class as per one OSS note. I took access key to add new attributes. I have a question.
    class name: CL_J_1BEFD
    Attribute: MT_GROUP_C350
    Level: Instance
    Visibility: Private
    Type STANDARD TABLE OF mty_result
    How do i add the instance attribute because i do not want to give the typing and associated type, instead i have to declare data: MT_GROUP_C350 type standard table of mty_result in class builder private section code.
    if you look at the pushbutton between Associated type and Description, for all instance attributes there's a green color lining below the arrow. I want my attribute also to be exactly same.
    Though i have access key, in private section the display<->Change button is disabled.
    Please suggest me how do i add code in private section of a standard class. i have required access key to change the class.
    Thanks,
    Alysson

    Hi Friend...
    Thanks, but the question is...
    When I went to transaction se24 or se80, I chose the class CL_J_1BEFD and second I swap to "CHANGE MODE".. after that the pushbutton is blocked... I can create the Attribute  mt_group_c800 in the Class (using TYPE or LIKE option), but i can't change the code in the private session even using the assistant to modify it.
    When I acess the Button "Detail View" the option "Direct Type Entry" is just unavaliable too, no matter what i do!
    I coudn't find a way to create the Attibute like the note Describes (SAPNOTE NUMBER 1575772 - in the attachment of the note)
    The changes are contained in the attachment
    Follows the instructions retrieved from the file:
    Add the following Attributes on the Class CL_J_1BEFD Private section
    data:
    mt_group_c800 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c850 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c860 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c890 TYPE STANDARD TABLE OF mty_result .
    How can i make a way to creat this attributes using  "TYPE STANDARD TABLE OF " Option?

Maybe you are looking for

  • Problem exporting AVI to WMV in Quicktime.

    So I am putting together a powerpoint presentation for school but they have Vista computers, and my quicktime movie files and AVI files will not work because the school does not have quicktime on its computers. The only exported file through Quicktim

  • Photo albums not deleting from my iphone 6

    Photo albums not deleting from my iphone 6 even after i remove them from itunes. plus it shows as others in the storage. how to remove the albums ? i removed them from the itunes linked folders though it still shows on the iphone !!!

  • Airport Extreme for G5

    Hi folks I am looking to add an Extreme card to my ageing G5 (2x2.3ghz) but looking at the text below from the Apple Store I am confused as to how to ascertain which model G5 Dual Processor I have. Any clues? +This AirPort Extreme Card is not compati

  • To those of you suffering with ATV

    This is my story that might help some of you... My colleague and I each bought an Apple TV two weeks ago and had very different experiences. I plugged mine into my network and it worked immediately, syncing with my Alu iMac on 10.5.4 His, however, wa

  • Labview run time 8.5

    Where can I download labview run time 8.5?