Select with STAR value

Hi All,
I have custom table with field that contains the * (star) values . ie
ABC*123
AB*1234
A*12345
A%12345
a&12345
I need to get values of all * entries using a select statement.
I don't need to select all and loop thru and filter it out
Any suggestions ?
Thanks
aRs

Hi,
You can build a wildcard ranges and please try something like this.
r_wildcard-sign =  'I'.
r_wildcard-option = 'CP'.
r_wildcard-low = 'B*'.
append r_wildcard.
r_wildcard-sign =  'I'.
r_wildcard-option = 'CP'.
r_wildcard-low = '*B*'.
append r_wildcard.
select * from mara
into table gt_mara_b
where mtart = 'YSAB'
and matnr in r_wildcard.
Regards,
Ferry Lianto

Similar Messages

  • Bulk select with varying values ?

    How do we implement bulk collect when the where condition varies ?
    Here is a sample code...
    I've problems with get_values procedure..
    declare
    type col1_type is table of number;
    type col2_type is table of varchar2(30);
    v_col1 col1_type;
    v_col2 col2_type;
    procedure get_values( p_col1 col1_type, p_col2 in out col2_type ) is
    begin
    forall j in p_col1.first .. p_col1.last
    select col2
    into p_col2
    from temp2
    where col1 = p_col1(j);
    end;
    begin
    select col1, col2 bulk collect into v_col1, v_col2 from temp1;
    for i in v_col1.first .. v_col1.last loop
    dbms_output.put_line( v_col1(i) || ' ' || v_col2(i));
    end loop;
    get_values(v_col1, v_col2);
    for i in v_col1.first .. v_col1.last loop
    dbms_output.put_line( v_col1(i) || ' ' || v_col2(i));
    end loop;
    end;

    But my question was How can we pass an variable which hold multiple values( as shown in the example which is bold) and fetch the return values for all the values in the variable using FORALL OR RETURNING OR BULK COLLECT.
    declare
    type col1_type is table of number;
    type col2_type is table of varchar2(30);
    v_col1 col1_type;
    v_col2 col2_type;
    procedure get_values( p_col1 col1_type, p_col2 in out col2_type ) is
    begin
    /* How can we implement this using bulk without looping through each element of the variagle p_col1. I know it can done using for j in p_col1.first .. p_col1.last
    loop ............ end loop; */
    forall j in p_col1.first .. p_col1.last
    select col2
    into p_col2
    from temp2
    where col1 = p_col1(j);
    end;
    begin
    select col1, col2 bulk collect
    into v_col1, v_col2
    from temp1;
    for i in v_col1.first .. v_col1.last loop
    dbms_output.put_line( v_col1(i) || ' ' || v_col2(i));
    end loop;
    get_values(v_col1, v_col2);
    for i in v_col1.first .. v_col1.last loop
    dbms_output.put_line( v_col1(i) || ' ' || v_col2(i));
    end loop;
    end;

  • SAP BI & ABAP: Select with multi values

    Hi all experts,
    I'm pretty new in this forums, and i have a variable with customer exit, multiple values. This variable return several closing date (MM.YYYY) for a input plant. Below my sample code:
    WHEN 'VARIABLE_NAME'.
    CHECK i_step = 2.
    *a plant
    CLEAR w_plant.
    *a project
    CLEAR w_project.
    *a version
    CLEAR wt_version.
    *a closing period for a budget
    CLEAR w_cloper.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'plant_input'.
      w_plant = loc_var_range-low.
      w_project = loc_var_range-low(7).
    ENDLOOP.
    CALL FUNCTION 'CONVERSION_EXIT_PROJ_INPUT'
      EXPORTING
        input  = w_project
      IMPORTING
        output = w_project.
    SELECT * INTO TABLE w_version_table
      FROM  version_table
           WHERE  project = w_project. --> in this step i have multi value in my internal table.
    If sy-subrc = 0.
      LOOP AT w_version_table INTO wt_version_table.
        CLEAR l_s_range.
        l_s_range-low  = wt_version_table-o_cloper.
        l_s_range-sign = 'I'.
        l_s_range-opt  = 'EQ'.
        APPEND l_s_range TO e_t_range. --> in this step i get single value, last value in the internal table.
      ENDLOOP.
    ENDIF.
    My code work it, but my variable return a single value. Which part of code i changed it to get all values.
    Best regards.
    Daous

    Hi Daous,
    if this is a BI question, would you mind posting it in one of the forums for BI & Analytics?
    This here is really about search...
    Best, Karsten

  • SELECT with fixed value

    Hi,
    I want to use SELECT....INTO TABLE statement but using a fixed value in one column, is that possible???
    I'm trying to do something like this:
    SELECT matnr "sy-datum" quantity FROM ztable INTO TABLE it_table.
    The it_table has got 3 columns: matnr, date and quantity but in the ztable there isn't a date and I want to insert into the table with a variable or something...
    Thanks

    Hi,
    you can do like this.
    Suppose your internal table structure is like that,
    data:begin of itab occurs 0,
           matnr type mara-matnr,
          datum type sy-datum,
          quant  type  menge,
          end of itab.
    SELECT matnr  quant FROM ztable INTO corresponding fields of  TABLE it_table.
    loop at itab .
    itab-datum = sy-datum.
    modify itab index sy-tabix.
    endloop.
    If you do like this then your column of itab-datum will have sy-datum .
    I hope this will help you.
    Help children of U.N World Food Program by rewarding them and encourage others to answer your queries

  • Creating F4 help with customized values in selection screen

    Hi  Dear friends
             In my report  i have two input flds at selection screen i.e. sales order no and date description.Now based on sales order no the F4 help in the fld date description should change dynamically.eg. if there are two sales document number 001 and 002 and the corresponding date description for 001 are 123 and 234 and for 002 are 987 and 876 .Then if i select 001 the F4 help in date description should contain 123,234 and for 002 it should contain 987,876 before pressing the execute button.How to achieve this. Plz help me. i tried to use AT-SELECTION SCREEN ON VALUE REQUEST event but its not giving any out put as in the SELECT query i putted a WHERE condition where sales document of the database table equals to the sales order inserted in the selection screen. But when i debugg the input sales order parameter shows blank.

    Try this way
    REPORT ZVENKAT_F4_FOR_PARAMETERS MESSAGE-ID zmsg .
    TYPES:
       BEGIN OF t_t001w,
         werks       TYPE t001w-werks,
         name1       TYPE t001w-name1,
       END OF t_t001w,
       t_return_tab  TYPE ddshretval.
    DATA:
        w_t001w      TYPE t_t001w,
        w_return_tab TYPE t_return_tab.
    DATA:
        i_t001w      TYPE STANDARD TABLE OF t_t001w,
        i_return_tab TYPE STANDARD TABLE OF t_return_tab.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS :p_werks TYPE t001w-werks,
                p_name1 TYPE t001w-name1.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
      PERFORM f4_help_for_palant.
    *&      Form  f4_help_for_palant
    FORM f4_help_for_palant.
      DATA:
          w_dynpfields TYPE dynpread,
          i_dynpfields LIKE STANDARD TABLE OF dynpread.
      IF i_t001w[] IS INITIAL.
        SELECT werks name1
        FROM t001w
        INTO TABLE i_t001w.
      ENDIF.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
        retfield               = 'WERKS'
        dynpprog               = sy-repid
        dynpnr                 = sy-dynnr
        dynprofield            = 'P_WERKS'
       value_org              = 'S'
        TABLES
          value_tab              = i_t001w
        return_tab             = i_return_tab.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE i_return_tab INTO w_return_tab INDEX 1.
      p_werks = w_return_tab-fieldval.
      READ TABLE i_t001w INTO w_t001w WITH KEY werks = p_werks.
      IF sy-subrc = 0.
        w_dynpfields-fieldname    = 'P_NAME1'.
        w_dynpfields-fieldvalue   = w_t001w-name1.
        APPEND w_dynpfields TO i_dynpfields.
        CLEAR w_dynpfields.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = sy-repid
            dynumb               = sy-dynnr
          TABLES
            dynpfields           = i_dynpfields.
      ENDIF.
    ENDFORM.                    " f4_help_for_palant
    Thanks
    Venkat.O

  • Select Query with minimum values

    Table name: employess_inout
    Column name: employee_code number(data type)
    IN_Time date(data type)
    Out_time date(data type)
    i want to select only in_time coloumn data with min intime as in one date A employee have more then 2 times in_time entry
    example
    employee_code in_time out_time
    1 18-mar-12 08:15:21 18-mar-12 13:02:01
    1 18-mar-12 14:07:46 18-mar-12 18:01:32
    1 19-mar-12 09:15:11 19-mar-12 12:58:54
    1 19-mar-12 14:10:01 19-mar-12 16:21:57
    1 19-mar-12 16:53:37 19-mar-12 18:15:33
    In above example I only want to select in_time column values which is minimum as 18-mar-12(08:15:21) like wise in date 19-mar-12 minimum value is 09:15:11.
    Please write the script.
    thanks in advance

    Dear Frank Kulash
    the Script is
    Select ei.emp_code,p.ename, d.department_name, ds.designation_name,
    to_char(ei.intime, 'dd') "IN_Date",
    to_char (ei.intime,'hh24:mi') "IN_Time" /*here i used "min" but not solved*/
    FROM einout ei, personnel p,departments d, designations ds
    where ei.emp_code = '470'
    and intime between to_date ('01/03/2012 08:10', 'dd/mm/YYYY hh24:mi')
    and to_date ('21/03/2012 10:00','dd/mm/YYYY hh24:mi')
    and ei.emp_code = p.emp_code
    AND p.dept_code = d.dept_code
    and p.desig_code = ds.desig_code
    group by ei.emp_code,p.ename, d.department_name, ei.intime,ds.designation_name --, ei.outtime
    order by ei.intime, ei.emp_code asc;
    Out Put
    EMP_CODE ENAME DEPARTMENT_NAME DESIGNATION_NAME IN_Date IN_Time
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 01 09:15
    *470      GHULAM YASSEN             INFORMATION TECHNOLOGY         OFFICER                   02          08:58*
    *470      GHULAM YASSEN             INFORMATION TECHNOLOGY         OFFICER                   02          14:04*
    *470      GHULAM YASSEN             INFORMATION TECHNOLOGY         OFFICER                   02          15:11*
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 03 09:06
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 05 17:07
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 06 09:47
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 07 09:36
    *470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 07 19:39* 470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 08 12:16
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 09 09:26
    *470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 09 14:08*
    I want to take out put
    like that
    EMP_CODE ENAME DEPARTMENT_NAME DESIGNATION_NAME IN_Date IN_Time
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 01 09:15
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 02 08:58
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 03 09:06
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 05 17:07
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 06 09:47
    470 GHULAM YASSEN INFORMATION TECHNOLOGY OFFICER 07 09:36
    I only need min time (value) once of A date.
    [Bold rows are no need in output]
    please tell how it will be possible

  • Populating select list in a JSP with enumeration values

    I'm working on a JSP in which I need to populate a select list with enumeration values.
    Everytime I'm trying to insert these values (using enum.nextElement()) in a select box only the first enumerated value gets inserted correctly, the rest of the values shows up outside the select list. I would appreciated any help...thanks!!!

    I'm not exactly sure how your generating your list to begin with, however the following code will work:
    <form>
    <select>
    <%
         java.util.Vector v = new java.util.Vector();
         for(int i=0;i<12;i++){
              v.addElement(new Integer(i));
         java.util.Enumeration enum = v.elements();
         while(enum.hasMoreElements()){
         Object obj = enum.nextElement();
         out.println("<option name='"+obj+"'>"+obj+"</option>");
    %>
    </select>
    </form>Anthony
    BTW does anyone know why the greater than symbol never renders properly in these forums when text is encapsulated in the code tag?
    pre:
    >code:
    >

  • Initializu00EDng select options field with default values and with NO INTERVALS

    Dear All,
    I have used WDR_SELECT_OPTIONS technology within WD Abap.
    I also have added the fields which have to be taken into consideration.
    lt_range_table =
    wd_this->m_handler->create_range_table(
    i_typename = 'PLANT' ).
    wd_this->m_handler->add_selection_field(
    i_id = 'PLANT'
    it_result = lt_range_table
    i_read_only = read_only ).
    Can I assign two values to this field 'PLANT' whereby the user may take only these values.
    I mean kind of pre initializíng of this select options field with default values.
    Due to this handling it should be prevented that the user can give other values
    except this values.
    Additonally it should be fine whether it is possible to disable the second input field
    of this select options field like NO INTERVALS .
    Regard
    sas
    Regard
    sas

    wd_this->m_handler->add_selection_field(
    i_id = 'PLANT'
    it_result = lt_range_table
    I_NO_INTERVALS = 'X'
    i_read_only = read_only ).
    Pls check 'WDR_TEST_SELECT_OPTIONS' web dynpro component

  • Blurd,transparent messagebox with some values to be selected

    I have seen many times that if we give any command on web page then a blurd and transparent type messagebox comes on screen with some values in it and screen .
    When we select any value on that messagebox that values goes on next page.
    I dont know how to proceed for such transparent window.
    anybody please help.
    thanks and regards

    Are you sure this has something to do with Java?
    (Javascript.is.not.Java)
    db

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • How no to select lines with NULL values

    Hi,
    I am not a newbie newbie in SQL but I do not understand why I cannot retrieve the lines where there are null values.
    The table observatoire.fiche has 2 columns with default values set to NULL : total_heures, and total_heures_exceptionnelles. These are numeric types columns.
    I want not to select lines where :
    total_heures equal NULL AND total_heures_exceptionnelles = NULLI have tried this but I do get an "Invalid relational operator" error message.
    select a.nom || ' ' || a.prenom d, a.agent_id r
    from   OBSERVATOIRE.AGENT a, observatoire.fiche b
    where  a.agent_id = b.agent_id
    and    b.total_heures NOT NULL AND total_heures_exceptionnelles NOT NULL
    group by a.nom, a.prenom, a.agent_id
    order by a.nomCould you help me ?
    Thank you for your kind answers.

    Satyaki_De wrote:
    I think this is not the good way to do it. Did you check my solution? It should work the same output as your solution.Really ?
    test@ORA10G>
    test@ORA10G> -- (1)
    test@ORA10G> with t as (
      2    select 1 as x, 10 as total_heures, null as total_heures_exceptionnelles from dual union all
      3    select 1, null, 20   from dual union all
      4    select 1, null, null from dual union all
      5    select 1, 30, 40     from dual)
      6  --
      7  select x, total_heures, total_heures_exceptionnelles
      8  from   t
      9  where  x = 1
    10  AND NOT ( total_heures IS  NULL
    11            AND
    12            total_heures_exceptionnelles IS NULL
    13          );
             X TOTAL_HEURES TOTAL_HEURES_EXCEPTIONNELLES
             1           10
             1                                        20
             1           30                           40
    test@ORA10G>
    test@ORA10G> -- (2)
    test@ORA10G> with t as (
      2    select 1 as x, 10 as total_heures, null as total_heures_exceptionnelles from dual union all
      3    select 1, null, 20   from dual union all
      4    select 1, null, null from dual union all
      5    select 1, 30, 40     from dual)
      6  --
      7  select x, total_heures, total_heures_exceptionnelles
      8  from   t
      9  where  x = 1
    10  AND    total_heures IS NOT NULL
    11  AND    total_heures_exceptionnelles IS NOT NULL;
             X TOTAL_HEURES TOTAL_HEURES_EXCEPTIONNELLES
             1           30                           40
    test@ORA10G>
    test@ORA10G>isotope

  • Anyone with corsair value select memory.

    Hi,
    I have the neo2 board, and 4 512 meg corsair value select ram. With two memory chips, it works fine, but with four, I get errors, even with memtest 86. All the chips work fine one at a time, or in pairs in every socket.
    My question is does anyone else have problems with 2 gigs of ram, and/or corsaid value select memory. Also is the value select with all four chip be supported soon?
    Thanks.

    Try setting your timings to 2,5-3-3-7 , voltage to 2,75V in bios on next boot. That will probably do the trick.

  • When we execute   transcation selection-screen should come with some values

    hi gurus,
    My requirement is whenever user executes a particular transaction,
    selection screen should appear with some values by default.
    can you suggest me in solving this problem.
    its urgent.
    thanks,
    Bhanu.R

    Hi,
    for that do like:
    A transaction with a variant can have its own transaction code, which you can then use to execute the transaction with the appropriate variant.
    To create a variant transaction, proceed as follows:
    Choose Goto ® Create vari. trans. from the initial transaction variant maintenance screen.
    Enter a transaction name and corresponding short text. Transaction type Variant transaction is already set. The following screen already contains default values for the name of the calling transaction, the variant name, and the client-specific or cross-client variant checkbox.
    Save your entries.
    Example:
    Variant ABC has been defined for transaction Z000. We now want to create the variant transaction ZVAR.
    Name of the new transaction: ZVAR
    Name of the calling transaction: Z000
    Name of the variant: ABC
    Transaction ZVAR starts transaction Z000 with variant ABC.
    If the variant specified for a variant transaction does not exist (in the current client), then the calling transaction will be started without variant.
    Regards,
    Renjith Michael.

  • Issue with Blank Value selection in Dropdown List

    Hello Experts,
                        I am facing one strange issue in Adobe Forms Drop Down(DD) list. Foll. is the list data which contains a several item data & blank value. After item data selection user must be able to select blank value in case he doesn't want to set the value to Order Unit as shown in screen shot below.
                                  Now my issue is after any of the item values selection (for ex. BAG - BAG)  user is not able to set the blank value again at my client system. However its working fine in mine. When checked client is using Adobe Reader 8.0 which is same as mine.
    Thanks in advance.
    Regards,
      Amit

    Hi Steve,
                   Thanks for the reply. We have a blank value in the DD as a list item, where key & description is empty space. As i posted above user must be able to select that blank item if doesn't want any value for Order Unit. This selection is working fine in my sytem, but my client facing the issue where he can not select the blank value from DD.
    Thanks,
    Amit

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

Maybe you are looking for