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

Similar Messages

  • How to read the 'Input help with fixed values' of domain .

    How to read the 'Input help with fixed values' of domain .
    The domain has a Value range i want to read those values .
    Are these values stored in any table ?
    Plz help me i need it ver badly...
    Thanks in Advance...

    Hi Chandra Shekhar,
    To read the 'Input help with fixed values' of domain , you can use the function module : HR_P_GET_FIXED_VALUE_TEXT.
    iIf you enter the domain name, you will find the fixed values entered in the domain.
    These values are stored in a table DD07L(DD zero 7 L). Here the values are stored based on domain name.
    See if it works for you.
    Award points if its helpful.
    Regards,
    Bhanu

  • Range selection for Fix value variable in BPS

    Hi,
       When create vaiable, there is a fix value variable, under selection condition, we can choose either multiple single value or range, however if we choose the range, let say mtareial number from 1 to 100, when we run the BPS application through UPSPL, the value for material variable will be populated with value 1 to 100, when I try to change the value to a single value,it's not allowed me to change,  while the user define value type, we can change the value, Is this supposed to be?

    JW,
    BPS variables does not allow the choice of multiple single values, you can choose a single value OR a range of values. This issues has been brought up with SAP Development.
    If you need single values or a complete range of values, you can add each single value as a fixed value and the range as another fixed value that can be selected. You can select each single value individually or the whole range (or any subranges you specified) but not multiple selections of single values.
    In user definted variable if you check input allowed by users, you can add some values and the users can add more but then they could potentially go into material numbers they should not get access too.
    Hope this helps,
    Mary

  • Find characteristic with fixed value at planning levels

    Hi Experts,
    I need to know which are the planning levels that contains a characteristics with a specific fixed value (ex: 0UVERSION = “220” )
    Does anybody know how can I do it?
    Thanks in advance

    Hi,
    Please create a query (tcode SQVI) on tables UPC_PLEVEL and UPC_OPTIOS. The join will be on field GUID. Select all the fields as available for display and selection. UPC_OPTIOS has the selection values maintained for the level. Please put in
    UPC_OPTIOS-FIELDNAME  = 0UVERSION
    UPC_OPTIOS-SIGN            = I
    UPC_OPTIOS-LOW = 220
    this will give you all the levels that have the said value
    hope this was helpful
    thanks

  • XMLTABLE with fix value

    Hello
    I insert XMLData into a table. This works without problems. But now I want to insert one value as a fix value. This is not in the xmlfile but I need this information, that I know from which database is this xmlfile. I'd try with 'DATABASE-NAME', but it doesn't work.
    Can someone helps me?
    Thanks.
    roger
    INSERT INTO event_xml (name,
    dtsysl,
    hrsysl,
    dtcptl,
    nusesi,
    dsp_step,
    dsp_state,
    bat_class,
    bat_program,
    bat_seqi,
    bat_state,
    database)
    SELECT *
    FROM XMLTABLE (
    'Operations/Event'
    PASSING xmltype (BFILENAME ('EVENT_DIR', '$fname_neu'),
    NLS_CHARSET_ID ('CHAR_CS'))
    COLUMNS name VARCHAR (40) PATH 'name',
    dtsysl DATE PATH 'dtsysl',
    hrsysl NUMBER PATH 'hrsysl',
    dtcptl DATE PATH 'dtcptl',
    nusesi NUMBER PATH 'nusesi',
    dsp_step VARCHAR (40) PATH 'DSP/step',
    dsp_state VARCHAR (40) PATH 'DSP/state',
    bat_class VARCHAR (40) PATH 'BAT/class',
    bat_program VARCHAR (40) PATH 'BAT/program',
    bat_seqi NUMBER PATH 'BAT/seqi',
    bat_state VARCHAR (40) PATH 'BAT/state',
    'DATABASE-NAME');

    This is not in the xmlfile but I need this information, that I know from which database is this xmlfileYou mean sth like this:
    insert into event_xml (name,
                           dtsysl,
                           hrsysl,
                           dtcptl,
                           nusesi,
                           dsp_step,
                           dsp_state,
                           bat_class,
                           bat_program,
                           bat_seqi,
                           bat_state,
                           database
           select t.*, 'DATABASE-NAME'
             from xmltable (
                    'Operations/Event'
                    passing xmltype (bfilename ('EVENT_DIR', '$fname_neu'), nls_charset_id ('CHAR_CS'))
                    columns name varchar (40) path 'name',
                            dtsysl date path 'dtsysl',
                            hrsysl number path 'hrsysl',
                            dtcptl date path 'dtcptl',
                            nusesi number path 'nusesi',
                            dsp_step varchar (40) path 'DSP/step',
                            dsp_state varchar (40) path 'DSP/state',
                            bat_class varchar (40) path 'BAT/class',
                            bat_program varchar (40) path 'BAT/program',
                            bat_seqi number path 'BAT/seqi',
                            bat_state varchar (40) path 'BAT/state') t;?

  • Aggregate with fixed value for 0SOLD_TO__0REGION wonu00B4t work

    Hi,
    We want to have a aggregate for a specific region. I have problem getting the aggregate to work. When testing it for aggregates in tc rsrt, it states that it will not use the aggregate because of Characteristic/Attribute 0SOLD_TO__0REGION does not have aggregation level */%.
    This in spite of the fact that 0SOLD_TO__0REGION is filtred to only include the same region and country in the aggregate and in the query.
    Maybe the message with the * in the end of it means that the aggregate needs to have all regions (value * in aggregate instead of F), but if that is the case, why?
    BR,
    Niclas
    Edited by: Niclas Erlandsson on Jul 22, 2009 10:30 PM

    Hi
    1.Create separate aggragates for each Attribute, using fixed values and create a multiprovider over this cube and take the report.
    Multiprovider perform parallel search on aggregates hence you query retrival time will be quick.
    2.Create Hierarchy variable and hierarchy node variable in the properties of IO
    in this case also you won't see entirer hierarchy. if you won't provide data for other nodes... it won't display.
    set authorization on hierarchy node also helps
    Hope this helps
    Regards
    CSM Reddy

  • Travel Expense with fixed value

    Hi SAP Gurus!
    Anyone can suggest me how to create a Travel Expense with a fixed value?
    F.e. I want to create a Travel Expense called "Lunch Reimbursement" that is always 5.20€.
    Thank you very much, bye!
    Stefano

    Stupid question, find it!
    Thank you.
    Stefano

  • Aggregates with Fixed values

    HI
    We have a requirement to create an aggregate on one of our infocubes. Dical period is going to be included as part of this aggregate. I would like to know if it is possible to set this aggregate to be populated for a fixed range of periods eg: 008/2009 - 012/2009.
    I know that we can set this to one fixed date like 008/2009 but is a range of period possible? If so how can I do that.
    Thanks.

    Hi,
    To the best of my knowledge, it is not possible to give a range as a Fixed Value for Aggregate.
    However, I recommend to go for other possible options like partioning, compression, Indexing, OLAP Cache, DB Statistics etc to improve the performance of the query.
    Regards,
    Sekhar.

  • How to use array list with fixed values to insert record in trigger

    I have a list  of number 1,30,40,45,60 . These numbers are not being changed so I  don't need to keep in a table. So have to create a  after insert trigger   for 
    As
    Begin
    @list =  1,30,40,45,60 // Array value 
    for i=1 to @list.count
    Insert into mappingtable(arrayvalue,itemcode) values (list[i],Inserted.Itemcode)
    Next
    End
    Please can you help with a code 
    Regards
    Pol
    polachan

    Be careful what you assume - rarely are lists of values like this truly static.  One thing to keep in mind that arrays in sql server are tables.  So, one example is:
    set nocount on;
    /* represents the virtual inserted table in your trigger */
    declare @inserted table (itemcode char(4));
    insert @inserted (itemcode) values ('ABCD'), ('JJKL');
    select * from @inserted;
    select * from @inserted cross join (values (1), (30), (40), (45), (60)) as arrayx(value);

  • 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 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

  • SelectChoice with fixed values.

    Good morning!
    I'm using af:selectChoice.
    I want to show a list of values to the user, and saves another values.
    For example.
    With sex select Choice:
    I want to show MAN/WOMAN and saves M/W.
    Thanks in advance,

    You can do something like this:
    <af:selectOneChoice
          value="#{bindings.YourAttributeName.inputValue}"
          binding="#{backing_YourPage.selectGender}"
          id="selectGender">
         <af:selectItem label="Man" value="M"
                 binding="#{backing_YourPage.selMan}"      
                 id="selMan"/>
         <af:selectItem label="Woman" value="W"
                 binding="#{backing_YourPage.selWoman}"
                id="selWoman"/>
    </af:selectOneChoice>

  • Variables with fixed value

    Is there in Java an operator that allow to a variable only a fixed set of values. For example the variable char color have only these value: "red","yellow",.. "etc".

    [Enums.|http://java.sun.com/docs/books/tutorial/java/javaOO/enum.html]

  • Can I compare bind variable with fixed value in where cause

    I found the problem buffer hit ratio < 70%. From monitoring, this below query is full table scan(8.5G)
    I think full table scan is a problem from scanning 720MB buffer cache.
    SELECT CT.LENS_ID,
    TO_NUMBER (TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD')) AS EXP_DATE,
    CT.WAREHOUSE_ID,
    COUNT (*) AS QTY
    FROM TB_STK_BARCODE_CTRL CT
    WHERE CT.EXPIRED_DATE IS NOT NULL
    AND (:B7 = -1 OR CT.WAREHOUSE_ID = :B7)
    AND (:B1 = -1 OR CT.LENS_ID = :B1)
    AND CT.L_STATUS_ID = 'I'
    GROUP BY CT.LENS_ID, TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD'), CT.WAREHOUSE_ID;
    I try to remove ":B7 = -1" from the query, and performance is OK. Index(WAREHOUSE_ID, LENS_ID, VERTICAL_TEXT, HORIZONTAL_TEXT) is used.
    SELECT CT.LENS_ID,
    TO_NUMBER (TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD')) AS EXP_DATE,
    CT.WAREHOUSE_ID,
    COUNT (*) AS QTY
    FROM TB_STK_BARCODE_CTRL CT
    WHERE CT.EXPIRED_DATE IS NOT NULL
    AND CT.WAREHOUSE_ID = :B7
    AND CT.LENS_ID = :B1
    AND CT.L_STATUS_ID = 'I'
    GROUP BY CT.LENS_ID, TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD'), CT.WAREHOUSE_ID;
    any suggest please
    Edited by: M.Suradech on Apr 8, 2012 8:11 PM

    M.Suradech wrote:
    AND (:B7 = -1 OR CT.WAREHOUSE_ID = :B7)
    AND (:B1 = -1 OR CT.LENS_ID = :B1)Looks like you are attempting to make some "generic" type of query.
    I'd recommend implementing something like this instead of what you currently have.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1669972300346534908

Maybe you are looking for

  • Customer Name on Sales Order not in Data Collections

    Hi, I am looking for some help. My company just did an upgrade from 11i to R12 in the middle of May. As part of the upgrade we installed ASCP. We have noticed that certain customers are not being collected when running Standard Data Collections. We h

  • Dynamic table owner in apex 3.0 and Oracle 10g

    I have an application that requires bulk deletes for all rows in a particular department. The application edits incoming data and then moves final approved data to the 'production' db. End users modify their data via bulk load until they are happy wi

  • Hi Can anyone guide me configure LDAP client in solaris 8 server.

    Hi, I am already having the solaris 8 LDAP master server. We have new server which i need to confgure as a client to that master server. Can any one help me to configure the same. Thanks in Advance.... Bala......

  • Creative Zen with prob

    Every time I try to sync music to my Zen I get a message that says the device is full whether I'm using wmp or another program and I can't format the player either,I have the latest firmware .Any help would be greatly appreciated.

  • My ipod is disabled for 21,707,332 minutes! what to do...

    my ipod touch is disabled for 21,707,330 minutes! no tech support now....how can i restore it?!