Doubt in "Select between" statement

Hi All,
I need to select all the userid's between 'A' to 'Z' ( or 'A* to B' ) ; where 'A' , 'Z*' would be input on the selection screen.
when I tried :
select bname
from user_addr
into <<internal table>>
where bname between 'A' and 'Z'.
It gave me all the user id's starting with 'A*' but didn't proceed further to B,C,D,...Z.
Any possible solution. It is URGENT.
Good reward points would be awarded to correct answers.
Thanks,
Vishal.

Check the table contents, this is working for me for any range I give
data i_usr type table of user_addr.
select * into table i_usr from user_addr where
bname between 'A*' and 'F*'.

Similar Messages

  • Doubt in 'SELECT-CASE'

    I have a doubt in 'SELECT-CASE'. There is this example of which i have :-
    SELECT /*+ rule */ SUM(CASE WHEN age <= 15 THEN cnt ELSE 0 END) "upto 15 Years" ,
    SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" ,
    SUM(CASE WHEN age >= 21 AND age <= 25 THEN cnt ELSE 0 END) "21-25 Years" ,
    SUM(CASE WHEN age >= 26 AND age <= 30 THEN cnt ELSE 0 END) "26-30 Years" ,
    SUM(CASE WHEN age >= 31 AND age <= 35 THEN cnt ELSE 0 END) "31-35 Years" ,
    SUM(CASE WHEN age >= 36 AND age <= 40 THEN cnt ELSE 0 END) "36-40 Years" ,
    SUM(CASE WHEN age >= 41 AND age <= 45 THEN cnt ELSE 0 END) "41-45 Years" ,
    SUM(CASE WHEN age >= 46 AND age <= 50 THEN cnt ELSE 0 END) "46-50 Years" ,
    SUM(CASE WHEN age >= 51 AND age <= 55 THEN cnt ELSE 0 END) "51-55 Years" ,
    SUM(CASE WHEN age >= 56 AND age <= 60 THEN cnt ELSE 0 END) "56-60 Years" ,
    SUM(CASE WHEN age >= 61 AND age <= 65 THEN cnt ELSE 0 END) "61-65 Years" ,
    SUM(CASE WHEN age >= 66 AND age <= 70 THEN cnt ELSE 0 END) "66-70 Years" ,
    SUM(CASE WHEN age > 70 THEN cnt ELSE 0 END) ">70 Years"
    FROM
    (SELECT /*+ rule */ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12) age,COUNT(1) cnt
    FROM contract_all co , customer_all ca ,curr_co_status curr
    WHERE ca.customer_id = co.customer_id
    AND co.co_id = curr.co_id
    AND curr.ch_status = 'a'
    AND ca.birthdate IS NOT NULL
    --AND    co.co_activated BETWEEN '01-jan-2004' AND  '31-dec-2004'
    AND EXISTS ( SELECT 'x' FROM hss_cust_segment hcs
    WHERE hcs.prgcode = ca.prgcode
    AND hcs.description = 'POST')
    GROUP BY ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12))
    In this the statements on top like this-
    SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" ,
    how does the increment happen in 'THEN cnt' because we are not doing the increment as such using '+1' kind of thing.
    I hope, my question is clear. Please help in solving the doubt.
    Regards.

    Sample data, wrong output and desired output please...
    I tried with this and it seems right...
    WITH ca as (
      select to_date('26-9-1990') birthdate from dual union all
      select to_date('26-9-1989') birthdate from dual union all
      select to_date('26-9-1974') birthdate from dual
    SELECT /*+ rule */ SUM(CASE WHEN age <= 15 THEN cnt ELSE 0 END) "upto 15 Years" ,
      SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" ,
      SUM(CASE WHEN age >= 21 AND age <= 25 THEN cnt ELSE 0 END) "21-25 Years" ,
      SUM(CASE WHEN age >= 26 AND age <= 30 THEN cnt ELSE 0 END) "26-30 Years" ,
      SUM(CASE WHEN age >= 31 AND age <= 35 THEN cnt ELSE 0 END) "31-35 Years" ,
      SUM(CASE WHEN age >= 36 AND age <= 40 THEN cnt ELSE 0 END) "36-40 Years" ,
      SUM(CASE WHEN age >= 41 AND age <= 45 THEN cnt ELSE 0 END) "41-45 Years" ,
      SUM(CASE WHEN age >= 46 AND age <= 50 THEN cnt ELSE 0 END) "46-50 Years" ,
      SUM(CASE WHEN age >= 51 AND age <= 55 THEN cnt ELSE 0 END) "51-55 Years" ,
      SUM(CASE WHEN age >= 56 AND age <= 60 THEN cnt ELSE 0 END) "56-60 Years" ,
      SUM(CASE WHEN age >= 61 AND age <= 65 THEN cnt ELSE 0 END) "61-65 Years" ,
      SUM(CASE WHEN age >= 66 AND age <= 70 THEN cnt ELSE 0 END) "66-70 Years" ,
      SUM(CASE WHEN age > 70 THEN cnt ELSE 0 END) ">70 Years"
    FROM ( SELECT /*+ rule */ ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12) age, COUNT(1) cnt
           FROM ca
           GROUP BY ROUND(MONTHS_BETWEEN(SYSDATE,ca.birthdate)/12) )
    upto 15 Years          16-20 Years            21-25 Years            26-30 Years            31-35 Years            36-40 Years            41-45 Years            46-50 Years            51-55 Years            56-60 Years            61-65 Years            66-70 Years            >70 Years             
    0                      2                      0                      0                      1                      0                      0                      0                      0                      0                      0                      0                      0                     
    1 rows selectedNH.

  • Doubt in selection screen

    Hi i have a doubt in selection screen I had given statement as below now i can see the output screen and i'm getting the output also now i want to know the value of only one vendor. If i had given a vendor number it must select the particular data of that vendor only can u give me any suggestions please
    SELECTION-SCREEN BEGIN OF BLOCK P WITH FRAME TITLE TEXT-000.
          PARAMETERS: VENDORNO like EKKo-LIFNR,
                      PURORG like EKKO-EKORG,
                      PLANT like EKPO-WERKS,
                      PURDOC like EKKO-BEDAT.
    SELECTION-SCREEN END OF BLOCK P.

    Hi Pavan,
    <b>I think this is what u required when u select vendor number automatically for that particular vendor u require values in the remaining 3 parameter fields.
    </b>
    REPORT zex31 .
    PARAMETERS: vendorno LIKE ekko-lifnr,
                      purorg LIKE ekko-ekorg,
                      plant LIKE ekpo-werks,
                      purdoc LIKE ekko-bedat.
    DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
    DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR vendorno.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
                tabname           = 'EKKO'
                fieldname         = 'LIFNR'
                dynpprog          = sy-cprog
                dynpnr            = sy-dynnr
                dynprofield       = 'VENDORNO'
           TABLES
                return_tab        = return
           EXCEPTIONS
                field_not_found   = 1
                no_help_for_field = 2
                inconsistent_help = 3
                no_values_found   = 4
                OTHERS            = 5.
      BREAK-POINT.
      REFRESH dynfields.
      READ TABLE return WITH KEY fieldname = 'VENDORNO'.
    Add it back to the dynpro.
      dynfields-fieldname = return-retfield.
      dynfields-fieldvalue = return-fieldval.
      APPEND dynfields.
    Get the company code from db and add to dynpro
      DATA: xekko TYPE ekko,
            xekpo TYPE ekpo.
      CLEAR xekko.
      CLEAR xekpo.
      SELECT SINGLE * INTO xekko
      FROM ekko
      WHERE lifnr = return-fieldval.
      dynfields-fieldname = 'PURORG'.
      dynfields-fieldvalue = xekko-ekorg.
      APPEND dynfields.
      dynfields-fieldname = 'PURDOC'.
      dynfields-fieldvalue = xekko-bedat.
      APPEND dynfields.
      SELECT SINGLE * INTO xekpo
       FROM ekpo
       WHERE ebeln = xekko-ebeln.
      dynfields-fieldname = 'PLANT'.
      dynfields-fieldvalue = xekpo-werks.
      APPEND dynfields.
    Update the dynpro values.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
           EXPORTING
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           TABLES
                dynpfields = dynfields
           EXCEPTIONS
                OTHERS     = 8.
    START-OF-SELECTION.

  • Doubt in select options

    Hi frnds,
    Normally select option allowing only 8 charactor in declaration part, but i want to display with morethan 8 charator. i think some text id formet is there, how to do that.
    for ex,
    s_org for vbak-vkorg  .
    for this i want to give sales organisation.
    how to do this.
    plz its urgent.
    Gowri

    SELECTION-SCREEN BEGIN OF LINE.
    [SELECTION-SCREEN POSITION pos [ldb_additions]].
    SELECTION-SCREEN END OF LINE.
    Effect
    The first and last statements define a new line below the existing elements on the selection screen.
    All the screen elements within these statements that are defined with PARAMETERS SELECT-OPTIONS and SELECTION-SCREEN statements are placed in this line one after the other without spaces.
    Several SELECTION-SCREEN POSITION statements can be listed within the definition of a line. The SELECTION-SCREEN POSITION statement can be used to define the output position for the following screen element. The position pos can either be specified directly as a number between 1 and 83 or using pos_low or pos_high expressions. The expression pos_low specifies the position in which the input field for a parameter or the first input field for a selection criterion is displayed as standard. The expression pos_high specifies the position in which the second input field for a selection criterion is to be displayed as standard. If you make a different specification of the position in the statement defining the following element, this is taken into account. The statement SELECTION-SCREEN POSITION is only possible within the definition of a line. If there are conflicts with existing screen elements, the selection screen cannot be generated.
    The additions ldb_additions can only be used in a selection include for a logical database.
    The following applies in the definition of a line:
    Output fields are not created for selection texts for the parameters displayed in these kinds of lines. Instead, these can be created by specifying a SELECTION-SCREEN COMMENT.
    You cannot define other lines with SELECTION-SCREEN BEGIN OF LINE.
    You cannot define blocks or tabstrip controls with SELECTION-SCREEN BEGIN OF [TABBED] BLOCK.
    Within a line, only one selection criteria should be defined with SELECT-OPTIONS whose description can be specified in advance using SELECTION-SCREEN COMMENT. Other combinations, especially definitions of elements according to the selection criteria, can lead to an undefined behaviour.,
    The backslash (/) is not allowed when giving format specifications.
    You can omit the position specification pos in formatting specifications.
    Note
    If a screen element is assigned a position greater than 83 or is positioned outside a block with a frame, the selection screen is not generated. In the case of input and output fields that were positioned beforehand but have a length that extends beyond the end of the line, the visible length is shortened accordingly and the content is displayed in the visible length and can be scrolled. In this case, pushbuttons and horizontal lines are cut off at position 83 or where the frame of the block ends.
    Example
    A pushbutton, an input field, and an output field in a line in the standard selection screen for an executable program.
    SELECTION-SCREEN: BEGIN OF LINE,
                      PUSHBUTTON 2(10) push USER-COMMAND fcode,
                      POSITION 16.
    PARAMETERS para TYPE c LENGTH 20.
    SELECTION-SCREEN: COMMENT 40(40) text,
                      END OF LINE.
    INITIALIZATION.
      push = 'Push'.
      text = '<--- Fill field, then push button!'.

  • Using SELECT INTO statement to transfer data from one DB to another?

    Hello,
    I need to move data from an SAP table to another downstream SQL server box without flat file in between. I have set up the DBCON interface, so that my ABAP code on SAP can connect to the remote SQL Server, then I can run INSERT command as Native SQL inside the ABAP.
    However, INSERT has performance problem. The best performer as I can find is SELECT INTO statement. But then I am stuck at how to use SELECT INTO to query my local SAP table and send (via INTO) to remote database. I am not even sure whether I should use Open SQL or Native SQL.
    Any suggestion? BTW, I understand the limitation of Native SQL, but we are OK to use it.
    Thanks!

    It appears that this is some kind of migration project due to the scope of the data contained in the single file? If so whatever you do is like ly to be trow away once the migration of data is completed.
    You have a couple of options:
    1) Get the data extracted from HFM in multiple files instead of one bulk file, broken down by scanario,year & period
    2) Take the single data dump file produced by FDM and manipulate it yourself to get the data in a more usuable format for processing through FDM.
    Option 2 could be achieved via any ETL tool or a custom file parsing script. What may be more attractive to you and allow you to fully leverage your investment in FDM is that you could use the PULL adapter that ships as part of the FDM adapter suite to perform this transformation exercise. The PULL adapter takes a flat file input and allows you to use all the in built functionality of FDM to transform it and output a modified flat file (or series of flat files). You could use it to produce multioload files or a series of files broken down by scenario,year,period.
    Whatever you do I would suggest that break the single data file down into smaller chunks as this will help with the iterative debugging process you will inevitably have to undetake whislt migrating the data to the new application.

  • Date prompt with a between statement

    Can a dashboard support a date range prompt? We are trying to make a prompt and use a between statement. Suggestions?

    I think you are using the prompt from the Prompt tab in Answers. What you need to do is use Dashboard prompts.
    Although Dashboard prompts have a "between" operator," if you use the 'between" operator, the ability to save the selections to Presentation Variables (PVs) disappears. When I need a "between" dates type prompts, I do the following:
    1) Create two Dashboard prompts set to PVs, say StartDate and EndDate. (In the Edit Formula area, use a CASE stmt on the column chosen -- doesn't matter what the column is -- so no action is performed on the column) (e.g., CASE WHEN 1=0 THEN ColumnName.TableName ELSE 'TEST' END)
    2) Change control to "Edit Box" so users can input the dates. (If you select two appropriate date columns, you can use the "Drop-down List" option and have the user select a valid date. In that case, you wouldn't use the CASE statement in step 1.)
    2) In your report, filter on the date column, convert the filter to SQL, and type in the following:
    +"Column name"."Table Name"+ BETWEEN '@{StartDate}' AND '@{uEndDate}'
    3) Place both the prompts and the report on a dashboard and when a start and end date is selected, the "between" function is performed on the report.
    HTH,
    Edited by: LC143 on Sep 3, 2008 9:52 AM

  • In making a form, I've used buttons for user to select a state. Can I make it go to cities next?

    I don't know the correct terminology, so I don't think that I've posed my question very well.  Employees will be using the form that I'm trying to make, and I want for them to be able to select a city from a large number of cities, and for that city to ultimately show up on the form (not merely in the data that is output.)
    I thought that the clearest way for them to select a city would be for them to start by selecting the pertinent state first.  That would allow the list of cities in that state to be shorter and more manageable.  So I'd like for them to be able to select a state, and then by virtue of that selection, have a list of cities pop up.  I sort of achieved that by using buttons for the states, and then under "actions", I chose "open a file".  Then I set it up to open a file that contained the cities that are options,and set each city with a button. 
    The result is that it goes from my form to a second window, containing states and then to a third window, containing cities.  (Actually, there are multiple "city" windows because there's a list of cities for each state.)  But then I'd like for the city that they select to wind up being on my original form.  Is there an "action" that I can choose that will make that happen?
    Or is there a better way to accomplish what I'm trying to accomplish?  Maybe I'm just going about this all wrong(?) Any suggestions would be very much appreciated  Thank you!

    Yes, there is a much better way. I'd recommend using a combo box for the list of states. When the user selects a state, the list of associated cities would populate a second combo box, allowing the user to select a city. This type of functionality relies on JavaScript. If you are unfamiliar with with JavaScript in Acrobat, I'd suggest starting with the following article: http://acrobatusers.com/tutorials/2007/js_list_combo_livecycle/
    Ignore anything to do with LiveCycle Designer. If you get stuck, post again.

  • JDBC/select/async statement to JDBC/stored procedure/sync call

    Hi
    We have JDBC/select/async statement to JDBC/stored procedure/sync call i.e sender and receiver are JDBC.
    PI has to pick all the the records of single internal order number at a time from sender system and upload to receiver JDBc,
    gets the response and routes to sender/insert statement.
    This should run only once per day.
    We will have multiple Internal orders daily, each order consisting of 10 to 20 records but only one IO related records has
    to upload to Receiver/JDBC
    What are the options available ?
    We have thought of following options
    1. SQL query is already to pick, but we have to pick records at one time daily. example: morning,evening or midnight.
       At that time it can pick multiple times but it should not pick through out day
    2. Is there any option in BPM so that we can group IO's at a time and upload ? If so what are the steps need to use
       Any additonal receive step need to be used to pick the records from the table.
    Thanks

    hi
    as i can understando you, you will receive mani IO and you must execute one IO in the receiver SP? if so, you can solve this usssing a ccBPM where you will have to create a mapping(0.N) where the source and the target structure will be the same, the diferrence will be in the occurrance of the target structure which will have to be 0.N (Tab signature in Message Mapping). then back to the ccBPM define a block with the property ForEach. this will  loop any times accord with the number of IO that you receive from the sender. as a result you will execute one SP for each IO.
    so, you ccBPM will be
    RS>TS>BLOCK(Multiline container and single container of source structure)>TS->SS
    RS:Receive Step
    TS:Trans. Step
    SS:Send Step
    Also the container will be:
    source--> type Abs
    source_multiline --> type Abs
    target -->type Abs
    Thanks
    Rodrigo P.
    Edited by: Rodrigo Alejandro Pertierra on Jun 24, 2010 4:54 PM

  • Can i include variable in select into statement?

    Hi all,
    Is it possible to include a variable name in the "select into" statement ? For ex:
    "Select empname into variable_Name from employee" In this case variable_Name is the variable.Will this statement work by assigning empname to variable_Name if there is only one record in the employee table?please reply....c ya.

    Surely you have to? You can hardly SELECT INTO a constant. Perhaps I'm missing something,

  • Doubt in Selection-Screen for Program type "Function Group"

    Hi Gurus,
    I created a Function group in that i created one screen and writtem the Screen flow logic. In that screen I called a Function module "COMPLEX_SELECTIONS_DIALOG" For Creating a selection-Screen.
    The code snippet is like below.
    CASE ok_code .
        WHEN c_clk1.
          CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
         EXPORTING
           title                   = text-002
           text                    = 'Material Number'
           signed                  = 'X'
            lower_case              = ' '
            no_interval_check       = ' '
             just_display            = ' '          " Un commented by Srihari
             just_incl               = 'X'          " Un commented by Srihari
            excluded_options        =
            description             =
            help_field              =
            search_help             =
           tab_and_field           = st_tab
          TABLES
            range                   = r_matnr
         EXCEPTIONS
           no_range_tab            = 1
           cancelled               = 2
           internal_error          = 3
           invalid_fieldname       = 4
           OTHERS                  = 5.
    it works fine. But the problem is if i click the multiple selection button for the select-option in selection screen and enter the values and copy those value. In the multiple selection button green button is not coming like noram report selection-screen. Please remember I used the program type as "Function Group" not "Module Pool".
    Please send your suggestions.
    Thanks,
    Srihari.

    Ok, I am not 100% sure, if I understand you correctly, you said, you created one screen to 'simulate' a standard selection screen behavior without using select-options statement?
    If that's not correct, could you please post a few more details on what exactly you are doing.
    I had to 'simulate' a select-option behavior which I did as follows:
    - I created a range variable to store the values (s_ctby)
    - on the screen I defined the LOW (s_ctby-low), HIGH (s_ctby-high) and the multiple selection field pushbutton
    - In the PBO I set the icons for the multiple selection pushbutton
      READ TABLE s_ctby INDEX 2 TRANSPORTING NO FIELDS.
      IF sy-subrc NE 0.
        gv_createby = gc_icon_enter_data.
      ELSE.
        gv_createby = gc_icon_disp_data.
      ENDIF.
    - In the PBO make sure that any values entered on the screen are transferred to the range
    * transfer any changed values into the correct range for user transaction
    * (screen 0110) because that screen just 'simulates' a selection screen
    * so we have to make sure that any data the user enters in the selection
    * fields is passed into the appropriate ranges
      IF sy-tcode EQ gc_trans_user.
    *   created by
        IF NOT s_ctby-high IS INITIAL.
          s_ctby-sign   = c_i.
          s_ctby-option = c_bt.
          IF s_ctby[] IS INITIAL.
            INSERT s_ctby INDEX 1.
          ELSE.
            MODIFY s_ctby INDEX 1.
          ENDIF.
        ELSEIF NOT s_ctby-low  IS INITIAL AND
                   s_ctby-high IS INITIAL.
          s_ctby-sign   = c_i.
          s_ctby-option = c_eq.
          IF s_ctby[] IS INITIAL.
            INSERT s_ctby INDEX 1.
          ELSE.
            MODIFY s_ctby INDEX 1.
          ENDIF.
        ELSEIF s_ctby-low  IS INITIAL AND
               s_ctby-high IS INITIAL.
          DELETE s_ctby INDEX 1.
        ENDIF.
    - If the user hits the multiple selection pushbutton
        WHEN gc_fc_create_by.
    *     if the user hits the multiple selection button on the screen
    *     we call the standard SAP functionality to show the multiple
    *     selection popup SAP uses on a standard selection screen
          CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
            EXPORTING
              title             = text-t02
            TABLES
              range             = s_ctby
            EXCEPTIONS
              no_range_tab      = 1
              cancelled         = 2
              internal_error    = 3
              invalid_fieldname = 4
              OTHERS            = 5.
          IF sy-subrc NE 0 AND NOT sy-msgty IS INITIAL.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    *     now update the header line so the screen fields display the correct values
          CLEAR s_ctby.
          READ TABLE s_ctby INDEX 1.
    Hope that helps,
    Michael

  • Problem in Submit via selection screen statement

    Dear Experts,
    I have designed selection screen and a dialog screen 100. I am passing the selection screen values to dialog screen using Selection screen via selection screen statement. When i tried to change the values in dialog screen, it is not allowing me to do so and the values are not refreshed.
    I have searched the SDN Forum, but not able to find the suitable thread.
    Regards,
    Ramesh Manoharan
    Edited by: ramesh.manoharan on Mar 17, 2010 1:03 PM

    Hi,
    I have used the below statement to pass values the values from selection screen to dialog screen (Created as an Executable program)
    Submit <pgm> via selection screen
      with ...... .
    Dialog screen is created as an executable program where i have created two subscreen area and populating the Selection Screen as subscreen by using the below statement:
    selection-screen begin of screen <subscreen no.> as subscreen.
    selection-screen end of screen <subscreen no.>.
    The problem i am facing is that the values of selection screen are getting populated in the dialog screen. But when i tried to change the input values in the dialog selection screen. I am unable to do that and it is not showing the new entered values. Only the previous values are shown (got from selection screen from Submit via selection screen statement).
    Kindly let me know where i am going wrong ? Kindly help me to overcome the problem .
    Regards,
    Ramesh Manoharan

  • In Mountain Lion how does OS select between ethernet and WiFi when both are activated??

    In Mountain Lion how does OS select between ethernet and WiFi when both are activated??  How does OS use "both" networl accesses??

    It will pick the highest service in the list which has an internet connection.
    To order the list, open Network System Preferences and select Set order of network services from the button below the service list.

  • Doubts in Select query

    Hai,
    I have problem in my select query,
    My previous select query:
      SELECT  rrcty 
            ryear 
            rbukrs
            rzzpspid 
            SUM( hslvt )
            SUM( hsl01 )
            SUM( hsl02 )
            SUM( hsl03 )
            SUM( hsl04 )
            SUM( hsl05 )
            SUM( hsl06 )
            SUM( hsl07 )
            SUM( hsl08 )
            SUM( hsl09 )
            SUM( hsl10 )
            SUM( hsl11 )
            SUM( hsl12 )
            SUM( mslvt )
            SUM( msl01 )
            SUM( msl02 )
            SUM( msl03 )
            SUM( msl04 )
            SUM( msl05 )
            SUM( msl06 )
            SUM( msl07 )
            SUM( msl08 )
            SUM( msl09 )
            SUM( msl10 )
            SUM( msl11 )
            SUM( msl12 )
             FROM zzsl5t
           INTO TABLE it_erbproj
             WHERE rldnr       EQ  c_rldnr        AND
                rrcty      EQ  c_rrcty        AND
                ryear       EQ  v_srr_fyear    AND
                rbukrs      EQ  v_srr_ccode    AND
                racct      EQ  v_racct        AND
                rzzpspid  IN r_zzpspid         
             GROUP BY  RRCTY ryear RBUKRS rzzpspid.
    now i want change the above select query as,
    If user enters input period 03 means,
    i have to select
    SELECT  rrcty 
            ryear 
            rbukrs
            rzzpspid 
            SUM( hslvt )
            SUM( hsl01 )
            SUM( hsl02 )
            SUM( hsl03 )
            SUM( mslvt )
            SUM( msl01 )
            SUM( msl02 )
            SUM( msl03 )
    only, not to select all the periods.
    how can i give fields dynamically.
    please suggest me.
    Elamaran

    Duplicate message. Please close this one and look at my answer Doubt in Select query.

  • Where clause in SELECT INTO statement

    Hi,
    I am using multiple conditions in where clause for my SELECT INTO statement as follows.
    SELECT count(DTLA.LOCATION_ID)
    INTO LOCATION_ID_count
    FROM DOC2_MGR.DOC_TYPE_LOB_ASSOC DTLA
    WHERE (DTLA.DOC_TYPE_ID = 'XYZ' AND DTLA.lob_code = 'ABC');
    It considers only first condition and returns the result i.e. DTLA.DOC_TYPE_ID = 'XYZ' only.
    Does select into statement suppose to consider only one condition in where clause???
    Thanks in advance!
    --Sandeep                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I got it resolved. Here is list of things I noted
    1. I was using variable names same as column names. It was mixing up temp variable names with column name on the table, which doesn't make sense as I was referring column names in table.column format
    2. I had mixed few datatypes. Input param was suppose to be number where as I was passing it as Text
    Thanks anyway!
    --Sandeep                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • What is the different between statement and preparedstatement?

    hi,
    recently i have attended a telephonic interview. they asked me what is the different between statement and preparedstatement? and when u will use them? Hi! can any one say me the original difference??

    sorry dear,
    i am already shortlisted. and monday is my HR round.
    . Every 1 is not like u.
    So you have read the examples and explanations that you found when you googled, and you have read the javadoc and you still don't understand? And you are shortlisted? For what? I hope you won't do server programming.
    I will give you a few hints.
    Escaping of data
    Storing of dates
    Safer
    Faster

Maybe you are looking for

  • HP Officejet Pro L7580- here's a new one for HP Mac Architect

    So like all the other disgruntled HP users who foolishly installed 10.5 when it was released, I have been without a scanner ever since. Until three days ago, however, I've been able to print, as the driver for the L7580 was included in Leopard. Now,

  • Online poll in dreamweaver cs3

    I'm new to dreamweaver and website development, can ayone help? I've set up a html form with radio objects and a submit button as a simple web poll. Yet i'm not sure how this works. Do I have to set up something to proccess the information. I am hook

  • WAD problem: HTML code is disappearing.

    hello all When i paste the HTML code into the HTML tabpage of a WAD, and then switching to the layout tab or saving the template, results in loosing the HTML code and no layout is available, only default code is available in the HTML Tab. is it a WAD

  • How do you contact Adobe PS Elements Support?

    Does anyone know how to contact Elements support besides Forum?

  • I am unable to print PDF files

    I am using mac 10.6.7 os i am unable to  print pdf files