Parallel Block (ParForEach) end condition doesnt work

hello
I have a parallel block in my workflow (multiline) .
In this defintion i have also configured an end condition.
( &Approved& = 'X'  for example)
My intention was that the workflow continues after  the block when:
1) all parallelblocks are processed.
2) the end condition was met.
But this second scenario( end condition was met) doesnt work.
When approve = X in one block, the other parallel blocks arent logically deleted.
is my assumption wrong? has anyone ever experienced this behaviour?
thanx
Hayo

Hello,
In fork normally you define how many branches are required to complete a job.
Let say u have 3 approvers for one work item  say A,B, and C.
If one of these approve you move on to the next step so in this case branches are 3  but necessary branch required is 1.
I believe that u must be setting flag 'X' when it is approved correct.
So just play with the necessary branches and you will be available to do it.
Regards,
Nabheet Madan

Similar Messages

  • Unwanted ABAP Code Block Triggering - IF condition not working

    Friends,
    I am facing weird issue in my production system i.e. one of the code block which was bounded in IF condition is getting triggered. However, as per the data that I have in my system this IF condition should skip that code block.
    Let me give you code and execution flow here:
    I have Program A in which I am submitting Program B in background mode to selected server. This Program A will be executed by end user in Background mode.
    call function 'JOB_OPEN'
         exporting
           jobname          = job_name
         importing
           jobcount         = job_number
         exceptions
           cant_create_job  = 01
           invalid_job_data = 02
           jobname_missing  = 03.
    if sy-subrc = 0.
         submit program B
                  via job job_name number job_number
                  with p_sched  = sched
                  with period_p = period
                  with fyear_p  = fyear
                  with username = ruser
    and return.
    call function 'JOB_CLOSE'
         exporting
           jobcount             = job_number
           jobname              = job_name
           sdlstrtdt            = start_date
           sdlstrttm            = start_time
          targetserver          = l_targetserver          "V05++
         exceptions
           cant_start_immediate = 01
           invalid_startdate    = 02
           jobname_missing      = 03
           job_close_failed     = 04
           job_nosteps          = 05
           job_notex            = 06
           lock_failed          = 07.
    endif.
    As you can see in code, I am passing job to run on l_targetserver. This program also releases some other jobs on other programs.
    In Program B, I have code like this:
    Top Include.
    start-of-selection.
    perform routine1 using p_fyear. "THIS HAS SOME SELECT QUERIES  AND  OTHER CODE and THERE IS NO ISSUE WITH IT. THIS ROUTINE IS
    ALSO HAVING ONE AND ONLY 'CLEAR' statement on DELTA_FLAG.
    perrform routine2.
    form routine2.
    loop itab into wa.  " This itab was populated in routine1
      perform get_flag." WE ARE PASSING VALUE TO DELTA_FLAG VARIABLE HERE. YOU CAN CHECK CODE BELOW.
    perform process_data. "CHECK THIS ROUTINE
    peform update_records.
    endloop.
    endform.
    Form Get_FLag.
    select * from dbtable into localtable where <condition>. " THIS QUERY RETURNS SOME DATA AND MY FLAG WILL BE SET AS 'X'.
    if sy-subrc = 0.
    delta_flag = 'X'. "THis one declared in top include.
    endif.
    EndForm.
    Form Process_Data.
    Perform get_dataset1.
    while counter <> 0. " Variable Counter declared in top include and default value is 20. Value will be decreased in side this loop. No issues with it.
    if wa-fld1 = '1'. "Check value of one of the field.
      continue.
    endif.
    perform get_delta_data. " We have Unwanted ABAP code (for my scenario) here.
    endwhile.
    Endform.
    form update_records.
    call function 'FUNCTION' in update task exporting par1 = itab.
    commitwork
    endform.
    form get_delta_data.
    if delta_flag is initial.
    select data from BSEG into i_bseg where <condition>. " This query is getting triggered in my system.
    endif.
    endform.
    All my data objects were declared in Top include of the program. Subroutines with their parameters were same as above code. I am not using any sub-routine second time or out-side of this program. As shown, this program updates records to one of the table with UPDATE function module IN UPDATE TASK and there is COMMITWORK after that. This task is part of
    As you could understand, DELTA_FLAG is having 'X' but query on BSEG is getting triggered. We are not clearing this variable after populating 'X' to it. I can see this query from Program B captured in ST12 trace results. (Verified it multiple times)
    I did this analysis:
    1. Ran this process in foreground with debugging, then there is no issue.
    2. Debugged 'Finished' job of my production system, but I dont see this code triggered in Debug mode.
    3. Replicated same execution process in our non-production environments, but there is no issue.
    Let me know if you need any other details.
    Thanks for your time.
    Regards,
    Naveen

    I forgot the one bit, which might actually have been useful: I'd be moving the if delta_flag is initial. out of form get_delta_data, before perform get_delta_data.Since you are calling in nested loops there, every little bit of run-time counts, and "philosophically" I feel - procedure should do what its name promises it will, and not check whether it's "appropriate time" to do it
    cheers and good luck
    Jānis

  • Set up pricing - Group condition doesnt works

    Hi Gurus,
    Please provide me your inputs.
    Can SAP determine the sales price as described in the below two cases.
    Case 1:
    Sales price for material M1, from 01.01.2011 u2013 31.07.2011
    Quantity         Price
    0                         100
    25      90
    100      75
    Sales price for material M1, from 01.08.2011 u2013 31.12.9999
    Quantity      Price
    0      105
    25      94
    100      78
    Sales order (note the difference in pricing date)
    Total quantity = 38, second scale should be used
    Item      Material      Pricing date      Quantity      Price
    10      M1      31.07.2011      17      90
    20      M1      31.08.2011      21      94
    Many Thanks for your answers
    Sharan

    Dear Sumanth,
    Thanks a lot for your answer. I am relatively new to this subject. Please elaborate your answer for me to maintain the settings in copy control.
    The scenario is - New condition type ZPR0 is created with group condition. And the scales are maintained as mentioned in the problem.
    Lets say Order is created on  date - 23/11/2011 with two lines
    Line 1 - Material M1 - Quantity 17 - Pricing date 31.07.2011(Maintained at item level)
    Line 2 - Material M1 - Quantity 21 - Pricing date 31.08.2011(Maintained at item level)
    With scales maintained, because of the pricing date , system picks up individual scales and it doesnt accumulates the quantity. How to tell system to accumulate quantity and then check scale based on the pricing date.
    Thanks for your help again,
    Sharan

  • Row Template Condition doesnt working

    Hi all,
    i have a self made "row template" for my report:
    "Before Rows":
    <table cellpadding="5" cellspacing="0" border="0" summary="">
    <tr>
    <th>ID</th>
    <th>ID_SHOW</th>
    <th>TITEL</th>
    <th>DOCUMENT</th>
    <th>status_external</th>
    <th>status_internal</th>
    <th>action</th>
    <th>tage_action</th>
    <th>crreated_on</th>
    <th>tage_anlage</th>
    <th>creator_name</th>
    <th>editor_hotline_display</th>
    <th>prio</th>
    <th>color</th>
    <th>erledigung_bis</th>
    <th>histo</th>
    <th>arbeitskorb</th>
    </tr>
    "Row Template 1"
    <tr class="#1#">
    <td >#2#</td>
    <td>#3#</td>
    <td style="background-color: yellow;">#4#</td>
    <td>#5#</td>
    <td>#6#</td>
    <td>#7#</td>
    <td>#8#</td>
    <td>#9#</td>
    <td>#10#</td>
    <td>#11#</td>
    <td>#12#</td>
    <td>#13#</td>
    <td>#14#</td>
    </tr>
    "Row Template 2"
    <tr class="#1#">
    <td>#2#</td>
    <td>#3#</td>
    <td>#4#</td>
    <td>#5#</td>
    <td>#6#</td>
    <td>#7#</td>
    <td>#8#</td>
    <td>#9#</td>
    <td>#10#</td>
    <td>#11#</td>
    <td>#12#</td>
    <td>#13#</td>
    <td>#14#</td>
    <td>#15#</td>
    <td>#16#</td>
    <td>#17#</td>
    <td>#18#</td>
    </tr>
    "Row Template 2 Condition" - use based on PL/SQL Expression
    '#DOCUMENT#' is null
    The "Row Template 1" is to be show only if Column "DOCUMENT" is not null, otherwise "Row Template 2" is to be show if Column "Document" is null. I have test various examples:
    '#4' is null, '#4#' is null and '#DOCUMENT#' is null. Without effect. Only "Row Template 1" is showing.
    Can anybody help me?

    Hi,
    null in conditions would return no value rather than 'null' - you can catch this by using an empty string - so:
    '#4#' = ''Andy

  • Parallel processing end condition problem

    Hi,
    i use a block with parallel processing for each row (parforeach). In every branch i create a workitem where a user has to input something. This is stored in my field status.
    Now i want that if the status is 'X' all branches will be closed like it would be in a fork.
    I entered the end condition &status& = X
    But the end condition of parallel processing doesn't work. I tested it and it works but into the workflow the branches won't be ended.
    Does someone has a solution or can explain me the problem?
    Thx

    Hi,
    The dynamic parallelism using 'parforeach' is not the same as fork with multiple branches with number of required branches to end the fork !! Its like this, when you use dynamic parallelism , for each index of your multiline container element used for parallelism, the sub-workflow ( or the associated Task having dynamic parallelism) will be called parallely and each branch ( parallely called sub workflow or task ) is independent now having no relation ( by default ) and workflow will not continue to next step until unless all these branches are completed.
    However, to solve your probelm i suggest the following
    1. How are you handling the process in each branch, is it through a sub workflow? if yes, in your sub workflow you can create a fork parallel to your normal process. In that fork, create a 'Wait for Event' step and wait for a new custom event ( for this you have to define a new custom event on your BO) . Put the necessary branches required as 1 and Join this branch to end of this sub-workflow. and
    2. Whenever your requirement to end all the branches is fulfilled ( say in your case status=X) raise this new custom event using Create Event and this will be captured by 'Wait Event' step in the fork of your sub-workflow and it will end that sub workflow ( meaning, your branch is ended now) .Make sure that you pass the BO Object Instance to your sub-workflow through binding from your main workflow. !!
    Hope this helps you !!
    Regards
    Krishna Mohan

  • END CONDITIONS IN BLOCK STEP

    In approval process  how many agents are determined at run time in multiline container, i used block for this  if any one rejects i should come out of block i created one container element in local container of the block  , in rejected branch i assigned some value using container operation, the same thing i given as a end condition  in block,  when i checked if any one rejected it is not coming out of the block can any one sugge

    why end condition is not working in block step i have given like this
    In rejected branch   container operation -
    flag = x (local container of block)
          end condition is flag = x.
    I tried like this also  flag = x,
       I Binded to workflow container  flag -
    > flag1(workflow container).
       i have given end condition is  flag1 = x.
    both are not working, I have seen in the workflow log it is executing till the container operation when i click on reject.

  • Weblogic 8.1SP4 Db2 "Abnormal end unit of work condition occurred"

    I am getting the following error when calling resultSet.next()
    java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]Abnormal end unit of work condition occurred.
    at weblogic.jdbc.base.BaseExceptions.createException(Ljava.lang.String;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(I[Ljava.lang.String;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
            at weblogic.jdbc.db2.drda.DRDARequest.processSQLCA(Lweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.processCodePoint(IILweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDAStatementRequest.processCodePoint(IILweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDAResultSetRequest.processCodePoint(IILweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.processReply(Lweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.ensureBytes(ILweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.processSQLCA(Lweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDAResultSetRequest.getNextRow(Lweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.DB2ImplResultSet.fetchAtPosition(I)Z(Optimized Method)
            at weblogic.jdbc.base.BaseImplResultSet.next()Z(Optimized Method)
            at weblogic.jdbc.base.BaseResultSet.next()Z(Optimized Method)
            at weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_base_BaseResultSet.next()Z(Optimized Method)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    chk this link ::
    http://www.dbforums.com/db2/1635479-sql-error-911-sqlstate-40001-rollback-due-deadlock-timeout-reason-68-a.html
    http://businessintelligence.ittoolbox.com/groups/technical-functional/brio-l/db2-error-from-scheduled-job-1061846
    might be useful for u.ang google it.

  • Error: Abnormal end unit of work condition occurred

    I using Weblogic 8.1 sp4, Db2/NT 8.2.9, JDK 1.4,JDBC in multithreaded environment
    When i issue resultset.next(), sometimes (very few times that too when number of units of processing is a bit high) it give me the following error:
    java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]Abnormal end unit of work condition occurred.
    at weblogic.jdbc.base.BaseExceptions.createException(Ljava.lang.String;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(I[Ljava.lang.String;Ljava.lang.String;I)Ljava.sql.SQLException;(Unknown Source)
            at weblogic.jdbc.db2.drda.DRDARequest.processSQLCA(Lweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.processCodePoint(IILweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDAStatementRequest.processCodePoint(IILweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDAResultSetRequest.processCodePoint(IILweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.processReply(Lweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.ensureBytes(ILweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDARequest.processSQLCA(Lweblogic.jdbc.base.BaseWarnings;)V(Optimized Method)
            at weblogic.jdbc.db2.drda.DRDAResultSetRequest.getNextRow(Lweblogic.jdbc.base.BaseWarnings;)Z(Optimized Method)
            at weblogic.jdbc.db2.DB2ImplResultSet.fetchAtPosition(I)Z(Optimized Method)
            at weblogic.jdbc.base.BaseImplResultSet.next()Z(Optimized Method)
            at weblogic.jdbc.base.BaseResultSet.next()Z(Optimized Method)
            at weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_base_BaseResultSet.next()Z(Optimized Method)
    Please let me know the solution to this problem..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    chk this link ::
    http://www.dbforums.com/db2/1635479-sql-error-911-sqlstate-40001-rollback-due-deadlock-timeout-reason-68-a.html
    http://businessintelligence.ittoolbox.com/groups/technical-functional/brio-l/db2-error-from-scheduled-job-1061846
    might be useful for u.ang google it.

  • Restrictions password doesnt work

    Today for the first time since 2007, my 4 digit passcode for the iPhone Restrictions doesnt work. I have not changed it. I have not forgotten it. Why? Is there an iCloud type problem today? How do I fix it and reset this password? I was already at my wits end with IOS7 and this just about finishes me off, but if anyone knows how to fix it, that would be very helpful. Thanks

    what about restoring from backup? There has to be something I can do besides trash aboslutely everything and destroy 6 years of perfectly crafting the best iphone setup! I havent forgotten anything!! Is there an iCloud glitch today? I mean it seriously wouldnt be the first one. After all since the dreaded IOS 7 update it still wants me to 'confirm iCloud terms and conditions' and then claim its 'unabe to connect to the server', which is clearly a BUG... Again, are these types of errors in some way connected?

  • After upgrading to ios 8.1.1 my ipad 4 camera doesnt work i just got blank screen, but i still can use it for facetime, i supposed after upgrading to ios 8.1.2 it will fix but it doesnt work. i cannot restore to ios 7. hopefully, any suggestion to co

    after upgrading to ios 8.1.1 my ipad 4 camera doesnt work i just got blank screen, but i still can use it for facetime, i supposed after upgrading to ios 8.1.2 it will fix but it doesnt work. i cannot restore to ios 7. hopefully, any suggestion to correct it?  thank you

    Hello pichastos,
    Thanks for using Apple Support Communities.
    To troubleshoot this issue where your camera is displaying a black screen, please follow the information outlined below.
    You see a closed lens or black screen
    If you see a closed lens or black screen when you open the Camera app, try these steps:
    Make sure that there’s nothing blocking the camera lens. If you’re using a case, try removing it.
    Force the app to close, then open the Camera app again.
    Restart your device, then open the Camera app again.
    If your device has a front and rear camera, try both cameras by tapping  (camera swap icon). If you see the closed lens or black screen on only one camera, take your device to an Apple Retail Store or Authorized Service Provider for more help.
    Get help with the camera on your iPhone, iPad, or iPod touch - Apple Support
    Take care,
    Alex H.

  • Canon Scan to Folder (Server 2008 R2) suddenly doesnt work

    Canon Scan to Folder (Server 2008 R2) suddenly doesnt work
    We have a few Canon Multi Functionals who have been able to Scan to Folder to our Server 2008 R2 File Server.
    Since last Windows Updates(13 sep 2012) it doesnt work anymore...
    Nothing has changed to the folders or shares. Shares are like:
    \\fs01\scans\IT
    Shared folder is \\fs01\scans
    Share permissions are Full for Everyone
    On the folder IT, only the IT department and the Canon Scan user have full conrol...
    When I turn off the Windows Firewall on the FS01, it works.
    Then i get a SMB = OK on the Multi Functional.
    When I turn on the WIndows Firewall, i get a SMB = NG on the multifuntional
    I checked the rules, and everthing concerning File and Printer Sharing is allowed...
    Can anyone please think what to do?
    Because  really don't want to go on with the Windows Firewall Disabled.
    The Endpoint Protection 2010 Anti Virus is installed on the FS01, but since disabling the Windows Firewall works, i don't think the Anti Virus has anything to do with it.
     Update: I just tried it to two other  Servers 2008 R2 (with also the Windows Firewall on) and it works! So there is something wrong with that one Server... But as far as I can see, the firewall has all File and Printer Sharing things open...
    And when i log on with the Canon Scan user on a PC i can browse to them locations just fine. I also reset the firewall setting to default and reopened the printers and sharing settings

    The canon surelly do a check on another port that is not allowed in your firewall.
    Run a wireshark on that server. Filter ip.src == ip of a canon.
    Check on what port the canon talk to your server and open it.
    Last option, does your printer are in another vlan/lan ? Maybe a firewall rule that does not see the printer in your local lan. Thus the rule might block it now.
    MCP | MCTS 70-236: Exchange Server 2007, Configuring
    Want to follow me ?  |  Blog:
    http://www.jabea.net | http://blogs.technet.com/b/wikininjas/

  • Pattern generation doesnt work - DIOHS96

    Hello
    I have a trouble getting the DAQmx to do a pattern generation as expected.
    the first mode of operation, is when i set the clock configuration to "sample clock": the card should support 2MHz operation, however, above about 2KHz, the card spits out everything BUT the last 16 samples! . the error i get is underbuffer, when i force the task to stop after having waited too long. above 1MHz the output operation dies in the middle, underbuffer error.
    to note, i monitor all the time the data written to buffer, and the actual nb of samples generated. i see that i have written a nb of samples, that the memory has filled, that it recovers as the data is spit out, and that suddenly, 16 bits from the end it stops.
    the second mode of operation, is by setting the clock configuration to " burst (input)", after the recommendation of Johannes from this same forum (by the way, i still want to understand why first mode of operation doesnt work). then, on most computers installed with same card the system works nicely, and i get 2MHz operation working.
    But for one computer: a new HP, which had a bug already not recognising the NI card first, but after the bug fix from knowledgebase it recognised it. it seems this card work using traditional DAQ now on this specific computer.
    What happens on this computer is that the "sample clock" configuration works as on any other computer, meaning badly. and the "burst input" mode, doesnt work at all. it spits out only the first 16 samples, then dies. i have to stop the task manually.
    so you can check that i make no mistake, i attach my piece of code that does the work.
    Hope that i get help fast! thanks
    OOPS! this should have gone to hardware board! - disregard!
    Message Edited by Gabi1 on 05-10-2007 04:56 AM
    ... And here's where I keep assorted lengths of wires...

    This will get you most of the way there:
           Pattern p = Pattern.compile(".+@[A-Za-z0-9\\-_]+(.com|.net|.edu)$");
           Matcher m = p.matcher(email);
           if (m.find()) { System.out.println("Match - Email Address OK"); }
           else { System.out.println("No Match -  Email Address Bad"); }

  • Fork End condition problem in BPM

    Hi All,
    I am collecting three different types of idocs (consider A, B and C). For collecting idocs I am using BPM. BPM Steps are
    1.Block1
           a.Fork u2013 3 branches
               i. Loop(3 Loops)  Receive u2013 Container Operation(Assign) -- Container Operation(Append)
    2.Block2
       a.Fork- 3 branches
          i. Transformation
          ii.Send
    In one of the field in idoc (C) I am getting the sum of idocs sent from the source. If the collected idoc count is equal to t he idoc (C) field value then fork condition is true otherwise the fork will be waiting up to the count equals.
    This is working fine whenever I am sending idocs in A, B and C or B,A and C. If I am sending idocs A,C,B  or B,C,A then it is not coming out of the fork end condition even though the condition is true. Can you please let me know how can we resolve t his.

    I kept Fork end condition in Loop also so its got worked

  • End condition in FORK step

    HI Experts,
    I am working on BPM scenarios.Anybody plz explain about how end condition works in FORK step.
    Please provide examples for that end condition in FORK step.
    Regards,
    Bhuvan.

    Hi,
    Refer this links...
    http://help.sap.com/saphelp_nw04/helpdata/en/24/e2283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/77/0737133012b24b9d0a12c6df2b1054/content.htm
    /people/prasadbabu.nemalikanti3/blog/2006/02/24/collecting-and-bundling-vendor-records-from-different-multiple-interfaces-file-systempeoplesoft-and-sending-to-sap-r3-system-part-1
    Hope it helps..
    Thanks,
    Kumar.

  • OR condition not working correctly in SQL

    I am adding the folling condition to a sql statement and
    AND (status_code IS NULL or status_code <> 'T'
    or (status_code IN ('A','B','C','D') and TRIM(order_type) NOT LIKE '%9999')
    or (status_code IN ('A','B','C','D') and order_type IS NOT NULL)
    or (status_code NOT IN ('A','B','C','D')))
    but the or condition work...
    if i change it too
    AND ( (status_code IN ('A','B','C','D') and order_type IS NOT NULL) )
    then this portion of the OR condition work but when I use the OR condition something weird is happening that the condition not working... and i dont see a record that meets that condition...

    Hi,
    It's not the "trim" that implies "not null", but rather the fact that:
    - "not like" operator works only on non-null values and
    - "not like" operator disregards null values.
    Consider this:
    test@ORA92>
    test@ORA92>
    test@ORA92> l
      1  with x as (
      2    select null as y from dual union all
      3    select 'a9999' from dual union all
      4    select 'bxx' from dual
      5  )
      6  select * from x
      7* where y not like '%9999'
    test@ORA92>
    test@ORA92> /
    Y
    bxx
    1 row selected.
    test@ORA92>
    test@ORA92>Here, trim function was not used, but still the first row (that had null for y) was not returned. That's because Oracle disregarded the first row for comparison and out of the next two rows, it returned the third row because it satisfied the condition.
    As for your query, do the following conditions hold true:
    1. if status_code is null      - show the row regardless of order_type
    2. if status_code <> 'T'       - show the row regardless of order_type
    3. if status_code in (a,b,c,d) and order_type is not null and order_type ends with something other than 9999 - show the row
    4. if status_code in (a,b,c,d) and order_type is null                           - do not show the row
    5. if status_code in (a,b,c,d) and order_type is not null and it ends with 9999 - do not show the row
    6. if status_code is anything other than (a,b,c,d)                              - do not show the rowpratz

Maybe you are looking for