If condition logic

Need ur help in writing a IF condition logic.
I have written a code like
  IF itab-amt between 100 and 200.
  Result = itab-sales.
endif.
Now i want to change the logic to
If itab-amt between 100 and 200 excluding 110 120 122 134.....
result = itab-sales.
endif.
can u give me the code with correct syntax
Regards..
Balaji

Hello,
Try to do it using a range table:
* After the declaration of the data object itab.
DATA:
  lr_range LIKE RANGE TABLE OF itab-amt,
  ls_range LIKE LINE OF lr_range.
ls_range-sign = 'I'.
ls_range-option = 'BT'.
ls_range-low = '100'.
ls_range-high = '200'.
APPEND ls_range to lr_range.
ls_range-sign = 'E'.
ls_range-option = 'EQ'.
ls_range-low = '110'.
APPEND ls_range to lr_range.
ls_range-low = '120'.
APPEND ls_range to lr_range.
ls_range-low = '122'
APPEND ls_range to lr_range.
ls_range-low = '134'.
APPEND ls_range to lr_range.
IF itab-amt IN lr_range.
ENDIF.
Regards.

Similar Messages

  • Advanced Search using conditional & logical operators+ sharepoint 2010

    Hi Team,
    We have an requirement something like this. we have to search values from Custom SharePoint List using Conditional & Logical Operators in SharePoint 2010. how can i achieve this ? if some one has worked on something like this, can you please share the
    details to my email id ([email protected]
    Thanks in Advance.
    Cheers, San

    Hi Santhosh,
    If you have only one list, then you can use CAML query to perform search in that list. You can write code to generate dynamic CAML based on selection in the filter.
    If have to perform the search function on multiple list then you can use Search object model and create dynamic query and execute it using Search OM.
    http://msdn.microsoft.com/en-us/library/office/dn423226(v=office.15).aspx
    Best Regards,
    Brij K

  • AC 5.3 - CUP - initiator attributes - conditional logic

    Is there a trick to making the conditional logic work correctly in CUP when trying to define/select the initiator attributes?   Even when I specify to use AND, it seems to still be adding the attribute with an OR condition.
    For our non-production provisioning,  I have a role that needs to be approved by different people depending on which system (i.e. Dev, IT, QA) it is being requested.  I am trying to set up the 2 initiators as follows:
    Initiator 1:  Application/System = DEV and  Role = Role 1
    Initiator 2:  Application/System = IT or QA    and    Role = Role1
    Edited by: Jane Yap on Oct 22, 2009 5:12 PM

    After playing around with this more,  it appears that if I am selecting Role as the attribute and use the search functionality (i.e. click on the magnifying glass) to specify/select the actual role/role name,  the conditional logic does not get set accordingly.   In order to get the correct conditional logic set (i.e. populate the one I actually selected),  I need to type the role name or pattern of the role name instead of selecting the role using the search functionality.  
    I guess everywhere else within GRC AC it's always best to use the seach functionality when setting/selecting field values  (as opposed to manually typing/entering the values) EXCEPT for when creating/changing CUP initiators.   Documented feature? Perhaps...
    Thank you to those who responded to my post.

  • Hiding conditional logic using JSF tags

    Hi
    I'm trying to encapsulate some logic which, dependent on a true / false validation, outputs either one component or another containing a value.
    For example...
    when the validation is true, output <h:selectOneMenu... containing all available values with selected value highlighted.
    when the validation is false, output <h:outputText... containing selected value.
    I've tried custom tags but I'm using this to write out very basic tags and I'd prefer to use the JSF HTML tags.
    The only option I can see is to write conditional logic in the JSPs to say:
    if valid = true
    <h:selectOneMenu...
    else
    <h:outputText...
    endif
    ...but this means the developers must do this for every occurrence and the pages contain lots of conditional logic.
    Is there any way to create a custom JSF tag which outputs JSF HTML tags as this seems to be what we want to do?
    Thanks D

    There is no tag for this, but every HTML component has a 'rendered' attribute which accepts a boolean expression. If it's outcome is true, then the component will be rendered, otherwise it will be hidden.
    Here are some basic examples:
    <h:someComponent rendered="#{myBean.booleanValue}" />
    <h:someComponent rendered="#{myBean.intValue > 10}" />
    <h:someComponent rendered="#{myBean.objectValue == null}" />
    <h:someComponent rendered="#{myBean.stringValue != 'someValue'}" />
    <h:someComponent rendered="#{!empty myBean.collectionValue}" />
    <h:someComponent rendered="#{!myBean.booleanValue && myBean.intValue != 0}" />
    <h:someComponent rendered="#{myBean.stringValue == 'oneValue' || myBean.stringValue == 'anotherValue'}" />

  • Conditional logic in sqlplus??

    Hi,
    Is it possible to put a condition around an SQLPLUS command? or run an sqlplus command (such as PAUSE) from within a PL/SQL block? do any packages allow this?
    I would like to be able to set a variable in a script which would override/bypass the pause command.
    Example: (if sql allowed conditional logic...)
    define(var) do_prompt = true;
    if do_prompt
    prompt Warning you are about to drop the database! press Enter to continue.
    pause
    end
    Thanks

    One way to do it is to select into a variable using
    col ... new_value ...
    and then use the variable as the name of another sqlplus script to run using START.

  • Conditional logic?

    Hi Everyone,
    I am attempting to add some conditional logic to a query. The basic premise is as follows (this query snippet does work!) -
    DECLARE @choice int
    SET @choice = 0
    IF @choice = 1
    BEGIN
    SELECT 'True'
    END
    ELSE
    BEGIN
    SELECT 'False'
    END
    I now want to go one step further by adding a SELECT statement that will ultimately determine how the @choice variable is set. 
    For example if a product code exists in the appropriate database table I want to set @choice to 1, otherwise set it to 0.
    If anybody can suggest how I can go about this it will be greatly appreciated.
    Kind Regards,
    David

    DECLARE @choice int
    IF EXISTS (SELECT * FROM TABLE WHERE Product = 'Product Name')
    SELECT @choice = 1
    ELSE
    SELECT @choice = 0
    You can make use of IF EXISTS as above.
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • Dreamweaver template and conditional logic

    I would like to create a DW template and show or hide content using conditional logic. Can this be done?
    Thx!

    tangonovember wrote: I would like to create a DW template and show or hide content using conditional logic. Can this be done?
    If the following quote is of interest to you, check out Chapter 14 of the CS3 DW manual.
    "An optional region is a region in a template that users can set to show or to hide in a template-based document. Use an optional region when you want to set conditions for displaying content in a document.
    When you insert an optional region, you can either set specific values for a template parameter or define conditional statements (If...else statements) for template regions. Use simple true/false operations, or define more complex conditional statements and expressions. You can later modify the optional region if necessary. Based on the conditions you define, template users can edit the parameters in template-based documents they create and control whether the optional region is displayed.
    You can link multiple optional regions to a named parameter. In the template-based document, both regions will show or hide as a unit. For example, you can show a “closeout” image and sales price text area for a sale item."
    Roddy

  • Conditional logic in Spry based on date?

    I have a list of links with expiration dates. All the links
    have expiration dates. If the link is expired, I still need to show
    it, but simply reformat the link so that it's just text, and grayed
    out.
    I have the date coming in XML in the format "mm/dd/yyyy". I
    also have a javascript function that gives me today's date in
    "mm/dd/yyyy", but I can't figure out any way to get the dates
    compared. Basically, I need something like, somewhere:
    "If expireDate =< todaysDate, then change the link style"
    As of right now, I've written a function that brings in the
    formatted date and does a document.write to write the Spry code,
    where I'm inserting the javascript date into a spry:if. However,
    that's not going to get me there as it's just comparing strings and
    not really dates. I need to find a way get Javascript (todays date)
    and Spry (date field from XML) to talk to one another (compare
    dates) and then decide what to do (change or not change link) and
    am stumped.
    I can't think how filtering the data will get me anywhere,
    since all the dates in the record set need to show up in one format
    or another. So it seems the logic for date comparison has to happen
    in Spry, but Spry appears unable to do this kind of logic. This
    lead me to writing a function, but then again how to get the Spry
    data and Javascript logic to converse....help!

    Hi,
    You can apply PPR on salary field. Then catch the event and based on condition, set the value of commission field.
    Also, you can check this link for PPR:
    http://sushantsharmaa.blogspot.in/2012/12/11-ppr-partial-page-rendering-in-oaf.html
    --Sushant

  • Conditional logic execution

    Hi folks,
    I'm pretty sure that, strictly speaking, this isn't possible, but I'm hoping someone has found a workaround.
    I want to run logic on a set of data ONLY if the dimension members used contain certain flags (for example, only run logic when the CATEGORY.ID property is "PLAN2").
    Sounds easy enough, but when the *WHEN / *IS statement hits a value that is TRUE, I want to trigger another script, rather than a simple *REC statement.
    Does anyone know a way to do this? We are using BPC MS version 7 sp7.
    Thanks,
    Jason

    You can try using the *TEST_WHEN command and also some *INCLUDE command for what you are trying to do:
    The instruction TEST_WHEN
    Sometimes it may happen that a condition could be tested only once, because such condition is not dependent on the records being scanned. For example one might want to test that in the selected set of members for a given dimension there is a specific keyword or that a certain cell of the cube has a specific value. Instead of applying the condition to the entire set or records to scan, the condition may be evaluated before the WHEN / ENDWHEN loop, with the following instruction:
    *TEST_WHEN( )
    The is a string that the logic engine will pass to VB script for evaluation. If the returned value is TRUE the subsequent WHEN / ENDWHEN loop will be processed. Otherwise the entire loop will be skipped.
    Example:
    // skip the loop if Budget is not among the passed categories
    *TEST_WHEN(instr("%CATEGORY_SET%","BUDGET")>0)
    *WHEN *
    //u2026..
    *ENDWHEN
    *GO
    // skip the loop if account FLAG is zero for a certain time,intco combination
    *TEST_WHEN(GET(ACCOUNT="FLAG",INTCO="NON_INTERCO",TIME="2004.JAN")<>0)
    *WHEN *
    //u2026..
    *ENDWHEN
    As shown in the above example, the instruction supports the use of the %_SET% keyword. It also supports the GET instruction, to retrieve a value from the recordset. When one or more GET instructions are used in the evaluation of the condition, it must be remembered that all required dimensions must be specified. The non specified dimensions will default to the values they have in the first record of the source record set. In other words, the user can only omit dimensions that do not vary in the recordset being scanned.
    Another syntax supported anywhere in this instruction is the FLD( ) keyword. Here is a valid example:
    *CALC_EACH_PERIOD                         // handle periods one by one
    *XDIM_MEMBERSET TIME=PRIOR, %TIME_SET%     // include prior period to selected dates
    // This will test that the evaluated period is not the prior period
    *TEST_WHEN(instr("%TIME_SET%","FLD(TIME.ID)")>0)
    *WHENu2026.
    The TEST_WHEN instruction is specific to the current GO section. If no GO section is specified, it is specific to the current COMMIT section.

  • CUP Initiator Conditional Logic

    Hi All,
    How can I create an Initiator with below logic using 2 attributes "Request Type" and "Functional Area"?
    Initiator = (RequestType1 or RequestType2 or RequestType3) AND (FunctionalArea1 or FunctionalArea2 or FunctionalArea3)
    If this is not possible then is my option to create multiple initiators by splitting the above logic and then create a separate workflow for each initiator?
    Regards,
    Jay

    Dear Jay,
    You can use the logic as below
    Request type 1 or Request type 2 or Request type 3 or Functional Area 1 or Functional Area 2 or Functional Area 3
    If you use AND then the logic will take Request 1,2,3 AND Functional Area 1 ONLY and futher OR logic will not work for the other functional areas.   
    Thanks and Best Regards,
    Srihari.K

  • How can I create a landing page with conditional logic?

    I'd like my laning page to only show to new visitors. After visiting the landing page once, I'd like the visitor to go straight to my normal homepage. I'd like the landing page to only show to a visitor once every, let's say, 14 days. Can I do this in Adobe Muse?

    I'd like my laning page to only show to new visitors. After visiting the landing page once, I'd like the visitor to go straight to my normal homepage. I'd like the landing page to only show to a visitor once every, let's say, 14 days. Can I do this in Adobe Muse?

  • Need help on my conditional logic (to switch or not to switch, that is the question)

    I'm trying to write a function that will evaluate two variables, $misc1 and $misc2, they may or may not contain text. Essentially the possible outcomes are this:
    1) $Misc1 is blank and $Misc2 is blank
    2) $Misc1 is blank and $Misc2 has data
    3) $Misc1 has data and $Misc2 is blank
    4) $Misc1 has data and $Misc2 has data
    if 1, return $null
    if 2, return the value of $misc2 + 5 blank spaces
    if 3, return the value of $misc1 + 5 blank spaces
    if 4, return the value of $misc1 + 5 blank spaces + $misc2
    Can I switch this, or does that only work on a single variable?
    [email protected]

    Thank you mdkelley, ended up with this:
    Function Misc-Blank
    Param
    [string]$Misc1 = $Misc1,
    [string]$Misc2 = $Misc2
    if(([string]::IsNullOrWhiteSpace($Misc1)) -and ([string]::IsNullOrWhiteSpace($Misc2))){return,$null}
    if(([string]::IsNullOrWhiteSpace($Misc1)) -and (-not [string]::IsNullOrWhiteSpace($Misc2))){return, " $misc2"}
    if((-not [string]::IsNullOrWhiteSpace($Misc1)) -and ([string]::IsNullOrWhiteSpace($Misc2))){return, " $misc1"}
    if((-not [string]::IsNullOrWhiteSpace($Misc1)) -and (-not [string]::IsNullOrWhiteSpace($Misc2))){return, "$misc1 $misc2"}
    [email protected]

  • Script with two conditions

    hi friends
     I am new to PowerShell and i am studying hard since I've found it excellent to automate administrative tasks in my network.
    I am trying to write an script whichchecks if ADDS service (which its service name is NTDS) exist & also if it is running, then my command which creates a set of objects in AD be executed (new-ADobject
    I am familiar with get-service Cmdlet & also with basic "if statement", which is
    if (my condition) {
    do stuff
     but I don't know how to combine these things to make the final code.
    may someone please write me the code, so that a begin to study about the different parts of the final code?
    thanks a lot

    I would start by studying hte very basic compnents of PowerShell.
    You can write an if statement after only a few minutes of studying.  Itis easy.  Try it:
    Start here:
    http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx
    For the absolute beginner:
    http://www.powershellpro.com/powershell-tutorial-introduction/powershell-tutorial-conditional-logic/
    ¯\_(ツ)_/¯
    hello thanks. I studied and I learned how to use multiple conditions in my code,
    but still have problem with writing the condition itself in this certain circumstance.
    so am I on the right way by this:
    $myservice = get-service -name NTDS | select status
    if ($myservice -eq "running") {
    New-ADObject.......

  • PO Form with Terms & Conditions that Change Depending on a Value in Another Field

    Hi - I have read through the relevant topics in this forum and have attempted several of them without luck. I am currently working on a form in which there is an empty JFMain (I do not want to populate fields on this page since I don't want things in this page my "static" header - logos, title, etc. since the Terms and Conditions pages should not show any of this.) On my page 2, I have subforms for all my fields except my Terms and Conditions. (These fields are controlled by a data file.) On my remaining pages I have 3 sets of Terms and Conditions - all about a page long - hard-coded as text and placed in subforms with a dummy field off page to ensure they print. What I want to do is print the subforms from page 2 and then the applicable terms from page 3, 4, or 5 depending on the value in a field located in one of the subforms on page 2. What I currently get is my subforms and then ALL my terms printing. Any thoughts?
    My preamble overrides look like this:
    ^define group:D_HEADER \field$POSITION\reserve".11",in\subformHEADER.
    ^define group:G_HEADER @group:D_HEADER.
    ^define group:dummy!FldNotAvail \groupG_Terms_Private_Commodity
    ^define group:dummy2!FldNotAvail \groupG_Terms_Private_Services
    ^define group:dummy3!FldNotAvail \groupG_Terms_Public
    ^define group:JfEndData!EndData @group:D_end.
    I had to place the JFEndData! statement into the Preamble since the last subform with fields called before the Terms subforms has a global field from another subform above it. For whatever reason, it was duplicating this subform after printing the Terms and Conditions.
    I tried adding a nested if statement into field that will control when I want each subform to print but it was ignored. I also tried hardcoding a group call into the preamble with the logic as well with no results. If someone has example code they can share, this would be great.

    I receive Adobe help forum posts via email and I've been saving a few for the pointers they contain. I have some saved that might help you out a bit...
    A reply to the "Please can some one help me out......." post by Mr BoJangles on 10/29/2007 gives some information about forcing a subfield to be displayed.
    A reply to the "Conditional logic" post by Marco Degl'Innocenti on 8/2/2006 gives information on initiating a subform based on the value of a field in the data stream.
    A reply to the logic post by Marco DeglInnocenti on 2/22/07 also gives information on initiating a subform based on the value of a field.
    I hope these can be of help. If you can't access them on the forum I can repost them.

  • Need help with conditional display

    I found a older thread (704012) that explains how to conditionally display a link using style.  Which is what I want to do.  The part I'm having trouble with is that part of the instructions say to put
    class="row_has_values_#HAS_VALUES#"
    in the Link Attributes which I have done.  I also have a column in the report called HAS_VALUES and I'm properly populating it in my select.  I know because I left it displayed while I'm testing.  I can run the report and I have Y's and N's showing up in that column but the conditional part does not work.  When I look at the page source (below) I see that in the html the #HAS_VALUES# has not been replaced by the actual Y or N.  I think that's where I'm having trouble?  I think it might work if there was a Y or N in that but I don't understand why that didn't happen.
    <tr class="odd"><td headers="LINK"><a href="f?p=125:3:12628966088981::NO::P3_PROGRAM_KEY:2" class="row_has_values_#HAS_VALUES#"><img src="/i/e2.gif"  border="0"></a></td><td  align="left"

    LawrenceJ wrote:
    I've continued to snoop around and see lots of posts on conditional display in reports.  Common desire I guess.  I saw some stuff that I interpreted to suggest that what I'm trying to do may not work in interactive reports, only in classic reports.  Does that sound familiar?
    That would certainly apply to anything template-related. However there have been enhancements to IRs (like adding HTML Expressions) that might supersede information in older posts. If you provide a link to the sources you've found and the APEX version you're using someone will be able to confirm whether that information is relevant.
    Many other posts on doing things conditionally in reports seemed to lean towards "selecting" the html based on data values and then just letting that get put in the report column.  That looks promising but sure is a bit ugly.  I've very little apex experience but lots of mod pl/sql and that sort of solution was pretty common when I did stuff with it.  I saw a little suggesting using templates as a solution but I'll confess to not understanding it at all.
    As I pointed out in the original thread, if the conditional display of the link is in any way security related then CSS or JS/jQuery methods are not acceptable. If the user is not supposed to be able to click the link or see any data contained in it, then you have to use a method that ensures that the link element never reaches the browser.
    Hard-coding the link HTML in the report query is the common approach, but is as you say a bit ugly. Using a custom report template (my favourite APEX subject) enables clean separation of the report query, conditional logic and HTML structure. If you know HTML then you're advised to get familiar with using templates in APEX. You'll find this a major advance on the PL/SQL web toolkit. What is it that you're not understanding about using templates?

Maybe you are looking for