CAN WE HAVE IF CONDITION IN QUERY GENERATOR

Hi friends,
am, trying to make use of if condition to obtain a set of values in query generator.  Its possible to retrieve the required result set using query analyser but not in query generator.  am trying to execute the following query
if exists (select owor.u_reactor from owor,oitt where oitt.code=owor.itemcode and owor.u_reactor = 1 and owor.itemcode = '100-100')
begin
                select itt1.u_reactor1 from oitt,itt1 where itt1.father = oitt.code and itt1.father = '100-100'
end
else
if exists (select owor.u_reactor from owor,oitt where oitt.code=owor.itemcode and owor.u_reactor = 2 and owor.itemcode = '100-100')
begin
     select itt1.u_reac_23 from oitt,itt1 where itt1.father = oitt.code and itt1.father = '100-100'
end
else
if exists (select owor.u_reactor from owor,oitt where oitt.code=owor.itemcode and owor.u_reactor = 3 and owor.itemcode = '100-100')
begin
     select itt1.u_reactor4 from oitt,itt1 where itt1.father = oitt.code and itt1.father = '100-100'
end
if it is not possible to write such query in query generator  can someone help me with a workaround solution.
Thank u
Vaitheeswaran

Hi,
I dont think Nested IF Statements are allowed in PLD. The reason that u get the result in Query analyser and not in Query Generator is that SAP supports Transact SQL and many SQL Server 2000 functions are not supported.
However there is a work around in Print Layout Designer for using IF condition by having Linked Objects. Kindly see some tutorials regarding Linked fields available on SDN site and think of some other way of implementing this nested IF query.
Regards
Rizwan Hafeez
Team Lead
SAP Addon Development Section
Abacus Consulting - Pakistan

Similar Messages

  • Can SplitJoin have a condition to choose in OSB?

    Hi There,
    I am wondering can Split-Join in the message flow contain a condition with in the one .flow?
    let says i have a split join that doing parallel flow. flow A and flow B.
    Than on top of the splitting can i have a conditions something like this?
    If condition = A route to flow A only
    If condition = B route to flow B only
    If condition = AB route to flow AB

    found the solution. yes there is a if then process function to be used.

  • Can I have a conditional javascript:apex.confirm when column is null

    Hi All,
    I am relatively new to the product but am picking up things all the time. I was recently asked to create a confirmation on submit dialog which I did quite easily using javascript:apex.confirm. I was then asked to only display the confirmation message if a comment column was empty. The column is optional but it is preferred if something is added. I am using 4.1.1. Is this possible? Any ideas would be appreciated
    Regards
    Chris

    Hello Chris,
    >
    user4023958 wrote:
    I am relatively new to the product but am picking up things all the time. I was recently asked to create a confirmation on submit dialog which I did quite easily using javascript:apex.confirm. I was then asked to only display the confirmation message if a comment column was empty. The column is optional but it is preferred if something is added. I am using 4.1.1. Is this possible? Any ideas would be appreciated.
    >
    How have you implemented the apex.confirm?
    <ul>
    <li>If you have done it in dynamic action on button click then you have to make the dynamic action conditional by using Item/Column value is not null condition with expression as your comment item say P1_COMMENTS</li>
    <li>If you have done it in Button Action as Redirect to URL then simply you can write a javascript function in your page header as :
    <script type="text/javascript">
    function f_showConfirm () {
      if ($x('P1_COMMENTS').value == '') {
        apex.confirm('Do you want to submit this page?', 'SUBMIT');
      } else {
        apex.submit('SUBMIT');
    </script>and call this javascript function in Button Action - Redirect to URL with URL Target set as:
    javascript:f_showConfirm();</li>
    </ul>
    In order to get accurate/appropriate response you should include relevant details from following information with your question:
    <ul>
    <li>Full APEX version</li>
    <li>Full Database version</li>
    <li>APEX Web server architecture (EPG, OHS or APEX listener)</li>
    <li>Browser(s) and version(s) used</li>
    <li>Operating system with version, architecture(32/64)</li>
    <li>Theme</li>
    <li>Template(s)</li>
    <li>Region/item type(s)</li>
    </ul>
    The above information will help the forum members to ascertain the problem context and post most relevant response.
    Please read the [url https://wikis.oracle.com/display/Forums/Forums+FAQ]FAQ and [url https://forums.oracle.com/forums/ann.jspa?annID=1324]forum instructions for more information on using OTN forums effectively.
    Please update your forum profile with a real handle instead of user4023958.
    Hope it helps!
    Regards,
    Kiran

  • Can i have vat condition on freight charges

    Hi,
    One of my client requirement is a special one we . As per the requirement he needs VAT to be calculated on freight only.
    Example
    This is my pricing proceedure
                                                                                 10 Pcs
    P001     Gross Price     175     INR       1750
         Net Including Price     175     INR       1750
         Net Value Incl. Disc     175     INR       1750
    JEXS     Taxes on the PO     288.4     INR
    JEXC     IN Manual Excise     0     %
         Net Value Including     203.84     INR
    JOCM     IN Octroi     0     %
    FRB!     Freight     200     INR
    SKTO     Cash Discount     0     %
         Actual Value     203.84     INR        2038.40
    Here the taxes are calculated on the materail  JEXS only
    My tax calculation are
    BASB     Base Amount                                    1,750.00
         Calculated Call     175     1     1,750.00
         Sub total     175     1     1,750.00
    JMOP     IN: BED setoff %     16               280
    JMX1     IN: A/P BED setoff     100               280
         Total excise duty     28     1     280
    JEC1     N: ECS setoff %     2               5.6
    JSEP     IN: HEcess setoff %     1               2.8
    JEX1     IN: A/P ECS setoff     100               5.6
    JHX1     IN: A/P SECES setoff     100               2.8
         Sub T: ED + Ecess +     28.84     1     288.4
         Copy Net Price     175     1     1,750.00
         Price + ED + Ecess +     203.84     1     2,038.40
         Net Value After Tax     203.84     1     2,038.40
         Net Price + ED + ST     203.84     1     2,038.40
    The freight value Rs. 200 should have a tax of Rs. 24 my final proce will be Rs.2062.40
    How can i go ahead with
    Sunil

    Do you need that? If you hide (best) or disable the Next button until they have opened the URL this is not necessary. A button has also Success/Failure/Hint captions (see Options accordion) but the Success caption appearing will not prevent the action on the button to be executed.
    If you want to do that instead of hiding the button, there are several possiblities. Do you use Captivate 6: use a smart shape as text container and turn it into a rollover shape, with the area over the Next button. When the user moves over that Button he will see the message. In previous versions and in CP6 as well you could use a rollover caption for that goal. Bit more complicated because it will need a conditional advanced action is a Hide/Show action for a text caption or a shape as text container when the next button is clicked. To track the click on the other button that opens a file/URL you'll have to create a user variable that will have to change from 0 to 1 if it is clicked (with the same standard action you already discovered), and on the Next button you'll check first if the variable has been set to 1, if not you show a warning, if it is changed you'll proceed to the next slide.
    Lilybiri
    PS If your question is answered, could you please mark the thread as answered?

  • Can I have mannual condition value as zero in Sales order

    Hi
    I need to enter a mannual condition type in sales order in %, but it should not give me any value and it should be zero. In Pricing procedure I haven't maintained any values in from & to column, but then it is taking the value either from the base price or from some other value. Can any one tell me how to control this....and get zero as value in sale order though I enter in %.
    Regards,
    Ragu

    Hi,
    What is the function of the condition type if its effect is not to be evaluated in the pricing screen.
    anyways if thats the case, in the pricing procedure you can specify the counter no. in the from and to fields related to the condition type.
    you can enter the counter no. of the base price on which you want the percentage of the particular condition type to be executed.
    hope it would solve your problem.
    regards,
    Siddharth.

  • Declarations in SAP QUERY generated ABAP Programs

    hi,
    i had created a ABAP Program through ABAP Query (SQ01,SQ02,SQ03) but i have a issue that when i transport it to the PRD server i got the run time error. The Z program which i had created is the copy of the SQ01 generated program and i had done all the includes declarations in this program. but there is a problem that it is consist of the declarations of the structures,quries .
    I want to know is it necessary to always transport the Infoset and user group and the structure which is present in the program generated .
    Please provide me guidelines for this problem  .
    Edited by: ricx .s on Jul 6, 2009 5:31 AM
    Edited by: ricx .s on Jul 6, 2009 8:07 AM

    hi,
    i had copied the program bcoz i want to chekc that it is really necessary to transport the user group and infoset so that it can achieve functionality similar to the SAP QUERY.
    is there any other way without whichi can ahieve the functionality of SAP QUERY generated program and take it into the ABAP Porgram?

  • About query generator.

    SAP B1 2007 A PL46
    Hi All,
    I have many questions about query generator :
    1. It is possible to use or to call a stored procedure ? If yes, how can we implement this ?
    2. I try to use this query :
    declare @commercial integer
    set @commercial = [%0]
    declare @prjbegin nvarchar(20)
    set @prjbegin = '[%1]'
    declare @prjend nvarchar(20)
    set @prjend = '[%2]'
    SELECT T2.[DocNum], T2.[DocDate], T2.[CardCode], T2.[CardName], T3.[ItemCode], T3.[Dscription], T3.[Quantity] FROM [dbo].[OINV]  T2 INNER JOIN [dbo].[INV1]  T3 ON T2.DocEntry = T3.DocEntry WHERE T2.[SlpCode] =@commercial AND  T3.[Project] >=@prjbegin AND  T3.[Project] <=@prjend
    but it don't work. How can we do to use this ?
    Thanks for your help.
    Best regards.
    Michael

    Hi,
    I try this but it's not working :
    declare @commercial integer
    set @commercial = (SELECT SlpCode FROM OSLP WHERE SlpCode=[%0])
    declare @prjbegin nvarchar(20)
    set @prjbegin = 'N000001'
    declare @prjend nvarchar(20)
    set @prjend = 'R000003'
    SELECT T2.[DocNum], T2.[DocDate], T2.[CardCode], T2.[CardName], T3.[ItemCode], T3.[Dscription], T3.[Project] FROM [dbo].[OINV]  T2 INNER JOIN [dbo].[INV1]  T3 ON T2.DocEntry = T3.DocEntry WHERE T2.[SlpCode] =@commercial AND  T3.[Project] >=@prjbegin AND  T3.[Project] <=@prjend
    I have an error that is : you must specify a table name where execute the selection ...
    I think we can't use %0 and the statement DECLARE.
    Thanks
    Michael

  • Using Variables in Query generator

    I'm using the following query to pull a report together later to be used in a query print layout. When i specify the specific part number and customer code it returns what i expect but as soon as i add a variable it says "Must specify table"!
    SELECT T0.U_ACI_CAPT, T0.U_ACI_VDS1, T0.U_ACI_VDE1, T0.U_ACI_VSS1, T0.U_ACI_VSE1, T0.U_ACI_VDS2, T0.U_ACI_VDE2, T0.U_ACI_VSS2, T0.U_ACI_VSE2, T0.U_ACI_KWT1, T0.U_ACI_KWT2, T0.U_ACI_SPD1, T0.U_ACI_SPD2, T0.U_ACI_RNC1, T0.U_ACI_RNC2, T0.U_ACI_RNC3, T0.U_ACI_RNC4, T1.ItemCode, T1.Substitute, T0.U_ACI_VDS3, T0.U_ACI_VDE3, T0.U_ACI_VSS3, T0.U_ACI_VSE3, T0.U_ACI_KWT3, T0.U_ACI_SPD3, T0.U_ACI_RNC5, T0.U_ACI_RNC6, T0.U_ACI_ACDC, T0.U_ACI_PHSE, T0.U_ACI_50HZ, T0.U_ACI_60HZ, T0.U_ACI_OFRQ
    FROM   ((OSCN T1 INNER JOIN ITT1 T2 ON T1.ItemCode = T2.Father) INNER JOIN ITT1 T3 ON T2.Code = T3.Father) INNER JOIN "@ACI_MRBK" T0 ON T3.Code = T0.U_ItemCode
    WHERE T1.ItemCode = '[%0]' AND T1.CardCode = '[%1]'
    Anyone know how to get these things working?

    Hi,
    if your problem is similar with this symptom :
    Using SAP Business One Survey Variables (parameters) in a 'Set' SQL Statement can give an error in the Query Generator.
    here the solution I've got from SAP notes:
    In such cases you need to put in an SQL remark statement a reference field in the DB for the Survey Variable (any field).
    For Example: (to make the above query work)
    Declare @Num as numeric(2)
    Set @Num = /* T0.DocNum */ [%0]
    Select T0.DocNum
    From ORDR T0
    Where docnum = @Num
    Good luck
    Rgds,,

  • Qyery problem in query generator

    Hi friends,
    I have one problem regarding query generator.
    I want to take the field value from the active form for query generator. I got in the demo that u have to use $[table.field]. But still I got the error.
    Query which I tried.
    SELECT 'TRUE' FROM OCRD T0 WHERE $[OCRD.CardCode] = '[%0]'
    any one who take the value from active form as a parameter and pass to the query in the query generator please send my the sample query.
    Thanks in advance.

    hi,
    Thanks for your reply.
    When I try to execute the first query from the query generator I got the error.
    Error :-
    Incorrect syntax near $4.0.0
    statement 'Received Alerts' could not be prepared.
    When I try to execute the second query from the query generator I got the error.
    Error :-
    Incorrect syntax near 'Ocrd.cardcode'
    Statement 'Search function (CSHS)' could not bne prepared.
    What would be the reason.
    Please help me in solving this problem.

  • How to not have your view objects query before the page comes up?

    Hello. I have a view object that is part of a LOV. This view object always gets queried on bringing up the page (I need it to happen on the LOV click) How can I have the VO not queried initially? I tried setting the Iterator to refresh never, but it still does it. Here's the log before the page comes up:
    [363] BindingContext.put( ContactsAMDataControl@irepair_DataBindings_cpx, oracle.jbo.uicli.binding.JUApplication )
    [364] Resolving VO:ContactsVVO1 for iterator binding:ContactsVVO1Iterator
    [365] Changing iterator range size from :1 to :25
    [366] ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [367] Column count: 13
    [368] ViewObject: ContactsVVO1 Created new QUERY statement
    [369] ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [370] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [371] Bind params for ViewObject: ContactsVVO1
    [372] DCUtil, returning:oracle.adf.model.binding.DCParameter, for ContactsAMDataControl
    [373] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [374] Column count: 13
    [375] ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 Created new QUERY statement
    [376] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [377] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [378] Bind params for ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1
    Thanks!
    Edited by: user621288 on Jun 17, 2009 4:11 PM

    There are two ways:
    1. Uncheck "Query List Automatically" under List UI Hints in the view object overview xml.
    2. In the query add "where 1=:bnum and 1 is not null" and execute the query in the LaunchPopupEvent
        public void userIdId_launchPopupListener(LaunchPopupEvent launchPopupEvent) {
            DCIteratorBinding myListIter = (getItrtBindings("MyLovViewObj1Iterator"));
            ViewObject vo = myListIter.getViewObject();
            NavigatableRowIterator myItemList = myListIter.getNavigatableRowIterator();
            Row row = myItemList.first();
            Object[] val = row.getAttributeValues();
            ViewRowSetImpl vor = (ViewRowSetImpl)val[row.getAttributeCount() - 1];
            vor.setNamedWhereClauseParam("bnum", new BigDecimal(1));
            vor.executeQuery();
        }

  • How can I have the pricing conditions at the item and header level of the d

    How can I have the pricing conditions at the item and header level of the delivery? There exist "condition" tabs both the header and the item level of the delivery but the contents of the tabs are empty. I'll be happy if you can help me. Thanks in advance....

    Hi
    If you want to have the pricing procedure at delivery level then you need to assign a pricing procedure at delivery level also
    Just go through the path to maintain the pricing procedure at delivery level.
    IMG -> Logistics execution -> Shipping -> Basic Shipping Functions -> Pricing -> Pricing Procedure. for Delivery.
    But can you be more clear if the above one is not your query ?
    Regards
    Srinath

  • How can i have Query trace results in a table format?

    How can i have Query trace results in a table format?

    Are you referring to reading the trace files generated under udump folder?
    Well, you can make use of external tables, but you really need to be a master in understanding that cryptic data.
    Check out following link for an alternative.
    http://www.oracle.com/technology/pub/articles/gallagher_tfm.html

  • I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query parameter to report parameter i need to pass distinct values. How can i resolve this

    I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
    parameter to report parameter i need to pass distinct values. How can i resolve this

    Hi nancharaiah,
    If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
    None
    Specify values
    Get values from a query
    If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
    sample is for your reference:
    Select distinct field_name  from table_name
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • I have a satellite m55-s331 and I can't get my modem to "Query".

    I have a satellite m55-s331 and I can't get my modem to "Query".My modem is a Toshiba V.92.I think I need another driver even though it shows OK in my device manager.
        The error I get when I try to go on-line is "Modem (or other connecting device)is already in use or is not configureed."

    Satellite M55-S331
    See these Microsoft articles.
       Error Message: Error 633 Modem Is Already in Use
       Resources for troubleshooting modem problems in Windows XP
    -Jerry

  • Can we have triggers that get fired when we Query a table?

    Hi All,
    What could be the pricise answer to the following question?
    1. Can we have triggers that get fired when we Query a table?
    2. What the relation of triggers and delete, truncate statement in one line?
    3. What is data modelling? Why is it necessary?
    4. Which are not mandatory but essential files in Oracle?
    Regards,
    AAK

    1. Can we have triggers that get fired when we Query a table?for INSERT, UPDATE and DELETE statement, yes
    for SELECT statement, no.
    Question 2 is not clear for me.
    Question 3 is very very general ...
    4 >Which are not mandatory but essential files in Oracle?
    all database files (initialization file, control files, datafiles, redo log files) are mandatory. What is not mandatory but considered as a (very) bad practice is
    to have only 1 control file and only 1 redo log group with 1 redo log file.

Maybe you are looking for

  • Report based on parameter values

    Morning all, I have to create a report which includes Account Number, Account Name, Sales prices. There has to be two optional parameters, Account number (Static) and Product Description (Dynamic). I have setup the report with Account Number (Grouped

  • Datatable outputext parameter

    I have a t:datatable that shows severalfields of a pojo. There's a requirement to show additional data from that bean in a 'flattened' way: The pojo has a Set of other objects, say, a Person has a Set of Pets and every Person in the system has at lea

  • AS2 Drag and Drop - Completion Response

    I am making a drag and drop alphabet learning game. There are 27 Movie Clips (letters) in total that are able to be dragged.  I've made it so that 12 of the Movie Clips will drop in a specific DropZone, while the rest will just snap back to their ori

  • How to count the number or rows in file

    Hi Experts, I am file as source and Oracle as target. My file containing the some data which is going to load to the target. My requirement is that I want to count the number of rows which my file contains. Please help me how to count the total numbe

  • More on the pivot table processing in coherence

    hello, all: I posted a question regarding how to create a pivot table in coherence (coherence and pivot table Now I am on a project that my mgr wanted me to query a coherence cache and return a subset in "pivot" structure. Suppose I send a request fr