How to use a CTE in a CASE statement?

Hi everyone,
I'm trying to use a CTE in a CASE statement and getting error. In fact, I'm not sure how to use a CTE in this case and this is the first time I'm using a CTE. I managed to build a CTE successfully but, failed to incorporate it in the CASE statement.
SELECT wbs,
MIN(srt),
MAX(srt)
CASE ust
WHEN
WITH CTE AS
SELECT p_id + p_name + ps_name AS colg, p_id
FROM pd_info
WHERE s_desc = 'warehouse'
OR p_desc = 'Originated from warehouse'
OR p_desc = 'Originated from a partner store'
SELECT colg FROM CTE
WHERE cte.colg IN (SELECT p_id + p_name + ps_name AS c
omb from pd_info)
OR cte.p_id = 'xxxxxxxx' THEN 'invalid'
ELSE 'valid'
END,
p_name,
sub_name,
ps_name,
FROM pd_info;
Could experts here please help me?
Thank you,
Bangaaram
Known is a DROP, Unknown is an OCEAN.

With the help from some experts, I've figured out that CTE doesn't work in this case. Here are the queries that I'm using for the above. Either of them is working good so far.
SELECT Wbs
, MIN ( Srt )
, MAX ( Srt )
, CASE
WHEN S_Desc = 'warehouse'
OR P_Desc = 'Originated from warehouse'
OR P_Desc = 'Originated from a partner store'
OR P_Id = 'xxxxxxxx'
THEN 'invalid'
ELSE 'valid'
END AS Ust
, P_Name
, Sub_Name
, Ps_Name
FROM Pd_Info
GROUP BY Wbs
, CASE
WHEN S_Desc = 'warehouse'
OR P_Desc = 'Originated from warehouse'
OR P_Desc = 'Originated from a partner store'
OR P_Id = 'xxxxxxxx'
THEN 'invalid'
ELSE 'valid'
END
, P_Name
, Sub_Name
, Ps_Name;
SELECT wbs,
MIN(srt),
MAX(srt)
CASE
WHEN cte.p_id = 'xxxxxxxx'
or exists
(select *
from pd_info p2
WHERE (s_desc = 'warehouse'
OR p_desc = 'Originated from warehouse'
OR p_desc = 'Originated from a partner store' )
and p2.p_id = p1.p_id and p2.p_name = p1.p_name and p2.ps_name = p1.ps_name
THEN 'invalid'
ELSE 'valid'
END ust,
p_name,
sub_name,
ps_name,
FROM pd_info p1;
Thank you,
Bangaaram
Known is a DROP, Unknown is an OCEAN.

Similar Messages

  • How to use a event structure with a state machine

    First, I would like to inform you that I only work on LabView part time, and have much to learn.  Anything I do learn, I usually forget until I need it again, because I only work on it part time.
    Using your StopWhileLoopMOD[1].vi, I am trying to put a state machine inside the event structure.  
    Related link: http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loop-in-Event-case/td-p/465564/page/2
    Here is my application:  on the front panel, the user can select any combination of 7 different tests.  I have created cases to perform each step of each test in the correct order, but if the user presses stop, the tests won't stop because some of the cases have a while loop inside the event structure (like you mentioned is a bad idea).  The user should be able to stop the test, reselect tests to perform, and re-start the tests. 
    When the start button is pressed for the event structure, I need all the cases to run in the proper order, unless stop is pressed.
    In the past I have indexed an array and used that to run the state machine, but it won't stop immediately.  
    I have sub VIs that are built in while loops because the outputs of the product needs time to stabilize.  The state machine stops and waits up to a certain number of iterations.  If it passes the test, the while loop stops and the next state starts.  If it takes too long, it exits and reports an error.  Maybe I need to just use the state machine and not an event structure?
    Is there a good example of an event structure?
    metzler CLAD
    Solved!
    Go to Solution.

    I'm not sure exactly what you are asking, but it sounds like you want to script a bunch of tests and if the user says stop, to immediately stop the current test and abandon the others?  I'm going to assume that you know how to clear the array so that it will abandon the others, so I'm guessing that you are having trouble abandoning the current test?  If this is indeed the case, then the problem is that you are not able to propagate the message from the main VI FP which is the GUI to the sub vi which is the test, where the test may or may not have a GUI (FP visible) of it's own.  Threading was the first thing to come to mind, but this may not be necessary using events.
    You can do this by passing a refnum of the stop button to the subVI, where you can then add that wait to the event case structure.
    I've attached 2 VIs, mainvi.vi which is just a loop displays the count*2 (number of seconds passed since running) that will call subvi.vi and then check to see if the stop button is pressed.  mainvi.vi is by no means a state engine, it is just a simple loop for demonstration purposes.  subvi.vi just waits 2 seconds and leaves, it is a better structured state engine with an init state to start a poll case to wait for events and an exit state to clean up.  You can modify this any way you wish to get it to do what you want.  You will note that even if subvi.vi is being executed, it will terminate immediately when the stop button is pressed.
    Hope this helps.
    A
    Attachments:
    mainvi.vi ‏17 KB
    subvi.vi ‏33 KB

  • Trying to use greater than in a case statement

    What is the correct way to write this case statement?
    Case
    F.NextOrder2
    > F.CutOff
    Then
    Else F.NextOrder2
    as NextOrder3

    You're missing END, e.g.
    CASE when F.NextOrder2 > F.CutOff then '' else cast(F.NextOrder2 as varchar(100)) end as NextOrder3
    All values in the CASE statement must be of the same data type.
    See this blog post why
    SQL Server Case/When Data Type problems
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth
    Naomi Nosonovsky, Sr. Programmer-Analyst
    My blog

  • Challenging--- How to use AudioFormat , AudioInputStream in my case

    I did a application extracting data in byte format from .wav file, storing them in byte array, and I also have to use those data to do signal processing ,such FFT, convolution,... and so on, In order to do so, i guess I have to convert byte data to double(but not one bye one translate) by using AudioFormat.frameSize,, AudioFormat sampleSizeInBits and so on,,, unfortunately, I don't know how to convert, can anyone help me, thanks a lot
    for more detail you can see another question of mine in this forum,say, "How to convert byte array to double array in this case"
    Thanks mate!
    Good luck

    Thanks bsampieri very much ,, oh,oh!
    what below is your code I embed in my program!
    // bsampieri 's code
    intArr = new int[numBytes/2];
    for (int i=0; i<numBytes/2; i++) {
    byteA = (int)tempBuffer1;
    byteB = (int)tempBuffer1[i+1];
    if(byteA < 0) byteA += 0x100;
    if(byteB < 0) byteB += 0x100;
    if(audioInputStream.getFormat().isBigEndian())
    intArr[i] = ((int)byteA) + (((int)byteB) << 8); // big endian (you think)
    else
    intArr[i] = ((int)byteB) + (((int)byteA) << 8); // little endian (you think)
    } //end for
    for(int j=0;j<numBytes/2;j++)
    System.out.println(intArr[j]);
    // bsampieri 's code
    the result is something like this
    let me show you....
    wait a moment...
    oh..
    16896
    67
    17152
    68
    17408
    69
    40704
    164
    41984
    172
    44032
    170
    44352
    169
    and what's that???!!! hehe, I love you so much, can tell me more....

  • How to use dynamic SQL in this case for best performance

    I have the table with following columns
    ID NUMBER,
    DATA LONG,
    TAG VARCHAR2(255)
    Records in this table will be like following
    1 this is an abstract ABSTRACT
    1 this is author AUTHOR
    1 100 PRICE
    2 this is an abstract ABSTRACT
    2 this is author AUTHOR
    3 contract is this CONTRACT
    Basically all the records with the same number constitute 1 record for another table. Tag in the above table indicates that what column it is and DATAwill have the actual data for that column. I need to populate the second table based an the above table but will not get the same number of TAGS all the time. I need to insert the values only for the columns provided in the TAG field. How will I accomplish this by dynamic sql. Do I create a loop and create two strings one with columns and one with values and then combine them and use execute immediate to insert into table? Is there an easier way to do this??
    Please respond quickly.
    Thanks
    Bhawna
    null

    > so which collection should i use to perform it..
    so that performance is best......
    Program to interfaces. That way, you can switch out implementations and test for yourself which performance is best in an actual production context. But first, write your program so that it works. Worry about refactoring for performance once your program is written and it works.
    > plz send me the logic....
    Give it a shot on your own first; we can help if you get stuck.
    ~

  • How to use keyfigure selection in such case

    Hi expert,
    Here is the case, data like below:
    material   plant   ordqty
    A              p1        100
    A              p2         50
    B              p1         30 
    I want a new keyfigure to show
    material      plant   ordqty     ordqty(all plant)
    A                  p1       100          150
    A                  p2        50            150
    B                  p1        30             30
    Could you please give me some idea,   thank you in advance.
    Edited by: YAODAN on Oct 9, 2011 9:30 AM

    Hi
    Please check if the below solution works for you.
    1. Have material and plant in rows
    2. Put ORDQTY in Key Figure
    3. Create a new Formula Key Figure . Use the available function SUMCT to generate Sum of all plants for a particular material.
    > SUMCT (ORDQTY) 
    SUMCT is available under Data Function folder.
    Regards
    Anindya

  • How to use the List in this case.

    I got sample code from http://developer.java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/. But when I compiled it, there was error message like "webcrawler.java:16: reference to List is ambiguous, both class java.util.List in java.util and class java.awt.List in java.awt match List listMatches; "
    I think it might be because it was written by JDK1.1.3. I am using JDK1.4 to compile it. Can any body tell me how to make it can be compiled by JDK1.4?
    Thanks a lot.

    Hi olivia16
    There is an interface called java.util.List and a class java.util.List :-)
    To correct source code just put java.util. prefix at lines 16 and 76:
    java.awt.List listMatches; // 16
    listMatches = new java.awt.List(10); // 76
    Regards.

  • How to use "referenced files" in MY case?

    I have a MacBook pro, which I bring with me between home and studio.
    Until now, I've been storing my shots on an external HD. This means that I cannot see my photos when I'm home.
    I've been looking into the "referenced files"-thing.
    I would like to be able to see a preview of all my shots also when I only have my MacBook and not the external drive. When I shoot, I would like to store NEW shots on my MacBook at first (to edit, tag etc.) but then put them on my external drive for storage.
    I haven't been able to figure out how to do this. Can anyone please explain or link me to a place where I can read about it?
    Thanks in advance

    I haven't done this yet, but soon I'll need to coordinate a laptop and a desktop machine. So don't take my word for anything!
    It sounds as though you have Aperture set up so that the laptop machine's library is on the external drive -- not just the images that make up the heart of the library. Is that right? The alternative would be to tell Aperture its library is on the laptop, but have the library reference master images on the external drive. Previews -- if you have Aperture set to create and/or maintain previews in any or all projects -- are in the library, which is on the computer whether or not you have the drive containing the masters with you.
    (Am I going wrong yet??)
    But I'm still not clear, when master images are referenced, where Aperture stores versions, adjustments, metadata; in the library or with the referenced images?
    Anyway, it seems as though this arrangement should allow you to import new images into a project in the laptop's library while on the road. Then I don't think you even have to export and re-import the project -- when you're hooked back up to the external you just "relocate masters" for the new project onto the external drive.
    Somebody please straighten me out if I've got all this wrong.

  • How to use the js in the case of not sure the file name into multiple files to PS?

    function place($path){
        var idPlc = charIDToTypeID( "Plc " );
        var desc28 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc28.putPath( idnull, new File( $path ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc28.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc29 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc29.putUnitDouble( idHrzn, idRlt, 0.000000 );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idRlt = charIDToTypeID( "#Rlt" );
            desc29.putUnitDouble( idVrtc, idRlt, 0.000000 );
        var idOfst = charIDToTypeID( "Ofst" );
        desc28.putObject( idOfst, idOfst, desc29 );
        executeAction( idPlc, desc28, DialogModes.NO );
    for(i=1;i<=4;i++){
        place ("E:\\aaa\\"+i+".jpg");
    目前我的解决方案是,把多个文件提前修改成数字序列,然后用for循环调用,我想问的是,如果我不更改文件名,是否也可以同时导入多个文件?
    At present my solution is to advance the multiple files modified into a sequence of Numbers, and then use a for loop calls, I want to ask is, if I don't change the file name, also can import multiple files at the same time?

    You could use a file or folder selection dialog and then feed the selected files into the for-clause.
    var aFile = selectFile(true);
    alert (aFile);
    ////// select file //////
    function selectFile (multi) {
    if (multi == true) {var theString = "please select files"}
    else {var theString = "please select one file"};
    if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog (theString, '*.jpg;*.tif;*.psd;*.png', multi)}
    else {var theFiles = File.openDialog (theString, getFiles, multi)};
    ////// filter files  for mac //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|png)$/i) || theFile.constructor.name == "Folder") {
            return true
    return theFiles

  • How to use INNER JOIN in such case

    when i program as below[CASE1]. the code is able to active.
    CASE1:
    ==========================
    DATA: WK_BUKRS LIKE T001-BUKRS,
          WK_BUTXT LIKE T001-BUTXT,
          WK_TABLE(4) TYPE C VALUE 'T001'.
    START-OF-SELECTION.
      WK_BUKRS = 'DECN'.
      PERFORM GET_BUTXT USING WK_BUKRS WK_TABLE
                     CHANGING WK_BUTXT.
      WRITE: WK_BUTXT.
      FORM GET_BUTXT USING I_BUKRS LIKE T001-BUKRS
                           I_TABLE
                  CHANGING O_BUTXT LIKE T001-BUTXT.
        SELECT SINGLE BUTXT
                 INTO O_BUTXT
                 FROM (I_TABLE)
                WHERE BUKRS = I_BUKRS.
      ENDFORM.                   
    ===========================
    but when I need to INNER JOIN another table [CASE2]
    CASE2:
    =======================
    DATA: WK_BUKRS LIKE T001-BUKRS,
          WK_BUTXT LIKE T001-BUTXT,
          WK_TABLE(4) TYPE C VALUE 'T001'.
    START-OF-SELECTION.
      WK_BUKRS = 'DECN'.
      PERFORM GET_BUTXT USING WK_BUKRS WK_TABLE
                     CHANGING WK_BUTXT.
      WRITE: WK_BUTXT.
      FORM GET_BUTXT USING I_BUKRS LIKE T001-BUKRS
                           I_TABLE
                    CHANGING O_BUTXT LIKE T001-BUTXT.
        SELECT SINGLE BUTXT
                 INTO O_BUTXT
                 FROM (I_TABLE) AS G INNER JOIN BKPF AS H
                   ON GBUKRS = HBUKRS
                WHERE G~BUKRS = I_BUKRS.
      ENDFORM.          
    =================================
    Syntax error:
    Wrong expression "INNER" in FROM clause. WHERE condition.
    Can anybody help me to solve the problem.
    My requirement is to use INNER JOIN with variable table

    hi slam,
    chk this sample code.
    hi,
    table emp
    empno name
    a sasi
    b xxx
    c yyy
    table sal
    empno salary
    a 1000
    b 2000
    Inner join
    select eempno ename
    s~sal
    into table int_table
    from emp as e
    inner join sal as s
    on
    eempno = sempno.
    if you made inner join between table a and b by emp no
    the selection retrives only if the condition satisfy the output will be
    a sasi 1000
    b xxx 2000
    rgds
    anver
    if hlped mark points
    Message was edited by: Anversha s

  • How to use analytical function in this case

    SELECT COUNT (rms.status_code) rms_status_count,
    rms.status_name rms_status_name,
    TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date, 'YYYY') month_year,
    MAX (rtd.add_date) date_for_sort
    FROM ri_mast_status rms, ri_tran_data rtd
    WHERE rtd.status_code = rms.status_code
    AND TRUNC (MONTHS_BETWEEN (SYSDATE, rtd.add_date)) < 36
    AND NVL (rtd.delete_flg, '0') = '0'
    GROUP BY TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date, 'YYYY'),
    rms.status_name
    ORDER BY MAX (rtd.add_date);
    it gives output for the last 3 years based on month and year.

    r you trying this ?
    select *from
    select rms.*,
    row_number() over(partition by TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date,rms.status_name 'YYYY') order by rtd.add_date) RN,
    MAX(rtd.add_date) over(partition by TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date,rms.status_name 'YYYY')  order by rtd.add_date) date_for_sort,
    COUNT(rms.status_code) over(partition by TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date,rms.status_name 'YYYY')  order by rtd.add_date) rms_status_count
    FROM ri_mast_status rms, ri_tran_data rtd
    WHERE rtd.status_code = rms.status_code
    AND TRUNC (MONTHS_BETWEEN (SYSDATE, rtd.add_date)) < 36
    AND NVL (rtd.delete_flg, '0') = '0'
    where rn=1

  • How to use Select in nested Else if statement.

    Hi ,
    I am validating a file . for that I placed conditions through Nested ELSEIF statment.
    Some fields in the file need to validate against a table.
    Can some one help me how to organise my below code so that I can validate the file using all my conditions.
    CALL FUNCTION 'RH_EXIST_OBJECT'
           EXPORTING
             plvar     = '01'
             otype     = wa_1000-otype
             objid     = wa_1000-objid
           EXCEPTIONS
             not_found = 1
             OTHERS    = 2.
         IF sy-subrc <> 0.
           wa_error-reason = 'Object does not exist '.
           APPEND wa_error TO it_error.
           APPEND wa_file  TO it_1000.
         ELSEIF wa_file-endda IS INITIAL.
           wa_error-reason = 'End date missing'.
           APPEND wa_error TO it_error.
         ELSEIF wa_file-infty IS INITIAL.
           wa_error-reason = 'Infotype Missing'.
           APPEND wa_error TO it_error.
         ELSEIF wa_file-begda IS INITIAL.
           wa_error-reason = 'Begin date missing'.
           APPEND wa_error TO it_error.
         ELSEIF ( wa_file-sclas IS NOT INITIAL
          OR wa_file-sobid IS NOT INITIAL )
        AND  wa_file-infty <> const_infty_1001.    " Cosk Centre
           wa_error-reason = 'Enter a valid infotype'.
           APPEND wa_error TO it_error.
         ELSEIF ( wa_file-persg  IS NOT INITIAL
               OR wa_file-persk  IS NOT INITIAL )
             AND  wa_file-infty <> const_infty_1013.   " Employee Group
           wa_error-reason = 'Enter a valid infotype'.
           APPEND wa_error TO it_error.
          SELECT SINGLE *  FROM t501 INTO wa_501 WHERE persg = wa_file-persg.
          IF sy-subrc NE 0.
            wa_error-reason = 'Invalid Employee Group'.
            APPEND wa_error TO it_error.
            ADD 1 TO gv_error.
            gv_error_flag = 'X'.
          ENDIF.
          SELECT SINGLE *  FROM t503 WHERE persk = wa_file-persk.
          IF sy-subrc NE 0.
            wa_error-reason = 'Invalid Employee SubGroup'.
            APPEND wa_error TO it_error.
          ENDIF.
         ELSEIF ( wa_file-bukrs IS NOT INITIAL
               OR wa_file-persa  IS NOT INITIAL
               OR wa_file-btrtl IS NOT INITIAL )
             AND  wa_file-infty <> const_infty_1008.    " Company Code
           wa_error-reason = 'Enter a valid infotype'.
           APPEND wa_error TO it_error.
          SELECT SINGLE *  FROM t500p WHERE persa = wa_file-persa.
          IF sy-subrc NE 0.
            wa_error-reason = 'Invalid Personnel Area'.
            APPEND wa_error TO it_error.
          ENDIF.
         ELSEIF wa_file-build IS NOT INITIAL
           AND  wa_file-infty <> const_infty_1028.    " Building
           wa_error-reason = 'Enter a valid infotype'.
           APPEND wa_error TO it_error.
         ELSEIF ( wa_file-trfar IS NOT INITIAL
             OR wa_file-trfgb IS NOT INITIAL
             OR wa_file-trfg1 IS NOT INITIAL
             OR wa_file-trfs1 IS NOT INITIAL
             OR wa_file-indda IS NOT INITIAL
             OR wa_file-trfkz IS NOT INITIAL
             OR wa_file-molga_pg IS NOT INITIAL )
           AND  wa_file-infty <> const_infty_1005.   " Pay Scale
    Endif.

    hi,
    here is what you need.
    LOOP AT itab INTO wa_itab.
      SELECT maktx
        APPENDING CORRESPONDING FIELDS OF TABLE it_makt
        FROM makt
       WHERE matnr eq wa_itab-matnr
    ENDLOOP.
    note: performance-wise, it is better to use FOR ALL ENTRIES that SELECT inside a LOOP.
    here is a sample code
    SELECT maktx
      INTO CORRESPONDING FIELDS OF TABLE it_makt
      FROM makt
       FOR ALL ENTRIES IN itab
    WHERE matnr EQ itab-matnr.
    regards,
    Peter

  • How to use variables in an sql select statement.

    Hi, I have seen examples using the update, but nothing using a select statement.
    I have four variables I am getting from drop down menus in my JSP I set the user selected items to strings.
    How would I create the select statement like this:
    .String XName = request.getParameter("UserInputX");
    rsInResult = stmtInResult.executeQuery("SELECT ColumxX FROM TableZ WHERE ColumnX = XName")Obviously it tries to read "XName" as a column and of course can't find it, how would I set it up to have it see the Value of XName and not the literal XName.

    read this:
    rsInResult = stmtInResult.executeQuery("SELECT ColumxX FROM TableZ WHERE ColumnX = '"+XName+"')
    {code}
    better way is PreparedStatement:
    {code}
         // example code to change password to an user in the USERS table
         String newPWD = "my password";
         String user = "luxjava";
         PreparedStatement prepStat;
         String updatePWD = "UPDATE LOGISTIC.USERS "+
                                  "SET logistic.users.password = ? "+
                                  "WHERE logistic.users.username = ?";
         prepStat = ql.conDb.prepareStatement(updatePWD);
         prepStat.setString(1, newPwd);
         prepStat.setString(2, user);
         int zeroNotFound = prepStat.executeUpdate();
         if (zeroNotFound==0)
              ql.conDb.rollback();
              prepStat.close();
         else
              ql.conDb.commit();
              prepStat.close();
    {code}
    ... use the SQLException to capture errors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to use 'OR'  & 'AND' together in SELECT statement.

    Hi All,
    I am a BW person. Dont know much about ABAP. But i m trying to write a start routine in BW Transfer Rules.
    I m stuck at one point where i need to check multiple values using a slect statement.
    My requirement is like
    SELECT single * into wa_MEMPLOYEE from /BI0/QEMPLOYEE
      where EMPLOYEE eq L_S_DATAPAK_LINE-PERNR AND
        EMPLGROUP EQ ('1 OR '2' OR '7') AND
       CNTRCTTYPE EQ ('01' OR '05' OR '09' OR '50' OR '60').
    I tried using 'IN' .But this works only partially.
    EMPLGROUP IN ('1', '2', '7') AND
        CNTRCTTYPE IN ('01' , '05' , '09' , '50' , '60').
    when i use 'IN', the code checks the EMPLHROUP properly.But it will allow all other CONTRACT TYPE records to be written to the internal table.
    Can any one tell me how can i achieve this please.
    Cheers
    POPS

    Hi,
    You can do as below:
    "Create ranges for EMPLGROUP  AND CNTRCTTYPE
    ranges : gr_empgrp for <tablename-fieldname>,
                 gr_cntrtype for <tablename-fieldname>.
    initialization.
    gr_empgrp-sign = 'I'.
    gr_empgrp-option = 'EQ'.
    gr_empgrp-low = '1'.
    append gr_empgrp.
    gr_empgrp-sign = '2'.
    gr_empgrp-option = 'EQ'.
    gr_empgrp-low = '1'.
    append gr_empgrp.
    gr_empgrp-sign = '7'.
    gr_empgrp-option = 'EQ'.
    gr_empgrp-low = '1'.
    append gr_empgrp.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '1'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '05'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '09'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '50'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '60'.
    append gr_cntrtype.
    SELECT single * into wa_MEMPLOYEE from /BI0/QEMPLOYEE
      where EMPLOYEE eq L_S_DATAPAK_LINE-PERNR AND
        EMPLGROUP in gr_empgrp AND
       CNTRCTTYPE in cntrtype.
    Thanks,
    Sriram Ponna.

  • How to use open query in oracle select statement

    hi i have a requirement like this. I need to use the output of a procedure ( pl/sql table ) in developing a report
    like  (  SELECT * FROM <procedure name >)
    please help me.

    You can do it by using classic report but I can't tell you without knowing complete detail. If possible can you post your procedure query which you want to use to create report.
    Thanks
    Lakshmi

Maybe you are looking for

  • How to refer to a protected class outside the enclosing package

    Hi all, At the page 357 of the book Java Language Specification(Second Edition), when saying about checking accessibility of Type and Method, they concern Let C be the class containing the method invovation T.m, if T is in a different package than C,

  • Almost invisible JTable column headers

    I'm writing an applet which contains a JTable within a JScrollPane. For a while the column headings (text) were visible, but recently the column headings have become very small in height. There is barely enough there so that the mouse can be used to

  • Error ID:CLIENT_RECEIVE_FAILED in ABAP PROXI

    Hi All, I am working on File to ABAP Proxy scenario. I am getting following error in SXMB_MONI when i tried to post some message. Error ID:CLIENT_RECEIVE_FAILED Error Category: INTERNAL error trace as follows:   <SAP:Category>XIServer</SAP:Category>

  • ESB runtime error

    Im having some problems with the WSDL for an ESB that I have developed. I did some more testing and I realized that I get the same errors when I use the SOA Order Booking tutorial WSDL. from the Oracle.com URL below: http://download.oracle.com/otn/nt

  • Relocation error sun workshop 6 C++ 5.3

    iam using the sun workshop 6 C++ 5.3 compiler on SunOS 5.8. iam building a shared object abc.so the build is fine but when this "so" is actually used in a process i get the following error: fatal: relocation error: file abc.so: symbol __1cDstdbG__RTT