Strategy for rejecting rows

Hi,
I have a problem that would like to bring up for discussion. I have a solution in mind, but would like to listen to other suggestions.
Product   Type   Test1   Test2   Test3   Test4   Test5
YTP1       A        1.0       2.0      3.3
YTP1       A        8.0       9.0      7.0
YTP1       B        5.0       6.0      7.0
BBP1      C         2.1      4.7       6.7
BBP2      A        4.5       4.7      6.8The problem statement is:
Suppose the table A above shows the testing results of a particular Product,Type group. Test1, Test2, Test3, Test4...Test10 are the test attributes. A product,type group is said to pass the test if Test1, Test2, Test3, ...Test10 all satisfied a certain criteria.
The criteria for Test1, Test2,...,Test10 are found in 10 seperate table for a Product,Type group. So, the tables look like this:
For Test1-Test10 look like this:
Product   Type   Pass_criteria
YTP1       A       2
YTP1       B       3
BBP1      C       4
BBP2      A       5So, let's assume that pass when the test attribute is less than the pass_criteria. (this criteria may change to less than, greater than etc)
What are the ways to scan the table A(1 million rows) and get those rows that pass?

Would doing this in SQL faster than say, in pl/sql using row by row checking?PL/SQL is usually slower than SQL. If the vast majority of rows are likely to fall at the first hurdle then possibly the time you would save by avoiding subsequent lookups might be quicker.
Which suggests an alternative approach:
SELECT product, type
FROM
    ( SELECT product, type FROM tablea a, test1 t1
     WHERE a.product = t1.product and
           a.type = t1.type and
           a.test1 < t1.pass_criteria
      INTERSECT
      SELECT product, type FROM tablea a, test2 t2
           WHERE a.product = t2.product and
                 a.type = t2.type and
           a.test2 < t2.pass_criteria
     INTERSECT
      SELECT product, type FROM tablea a, test3 t3
           WHERE a.product = t3.product and
                 a.type = t3.type and
           a.test3 < t3.pass_criteria
     INTERSECT     
     INTERSECT
           SELECT product, type FROM tablea a, test10 t10
                WHERE a.product = t10.product and
                      a.type = t10.type and
                a.test10 < t10.pass_criteria
)With cases like these the easiest way of saying whiich is the faster approach comes down to trace and benchmarking. I wouldn't like to say the above is faster than John's suggestion; I hesitate to bet agaibnst JWS.
Cheers, APC

Similar Messages

  • How to process a block for each row in an internal table....

    Hi experts....
    In po approval workflow the scenario is like this.... for each po there may be more than one approver. approvers list i am maintaining in the ztable. list of approvers(no of approvers) is decided by the po value. I have collected these approvers into internal table. now i have to process a block ( approving or rejecting the po... )in the workflow for each row in the internal table.
    how can i do this. based on the decision of the 1st approver  approves the po then it should go to next approver in the internal table...otherwise end the workflow.....
    Please help me......

    i have created an internal table in the workflow container in which i am getting the list of approvers....
    how can i loop the internal table in the workflow...?
    how can i know the index of the loop in the workflow.....(will sy-index work here....? so that i can use loop until step in the main workflow to call the subworkflow..so that if sy-index is greater than no of entires in the itab then i can come out of the loop)

  • Re-set release strategy of rejected PO,after doing respective changes to po

    Hi friends,
    I have created release strategy for Purchase order with release indicator 6 (Changeable, new rel. if new strat. or value change/outputted), and with 3 release codes (3 approvers)..
    Now in this case, After Rejection of a approver (creator of po will get an mail telling that its rejected). After rejection, the creator has did required changes and save the PO.
    However the release strategy is not reset...So i want to know how to reset the release strategy in this case..
    Where as in case after the approval, if creator do any changes in purchase order then release strategy is resets...  
    Here PO printout is possible only after the final approval...
    Pls give some inputs in fixing this issue..
    Thanks in advance....
    Regards
    Shashidhar...

    Hi
    What are the characteristics of your strategy?
    Try to change one of them save and then rechange it to the original
    eg.
    If the strategy depends for example on the Purchasing Group (PG)
    i mean according to different PG's different strategies working
    then with ME22N change the PG save and rechange it again to the original.
    or
    for example If the strategy depends on Materail Groups (MG)
    then do the change with MG
    With ME22N change the MG save and rechange it again to the original.
    I guess this will trigger the strategy again.
    Hope it helps
    Best Regards

  • Roles and Authorization strategy for SAP BIBO

    Hello All,
    We are doing an implementation where Source is a Oracle, SAP BI warehouse and BO XI3.1 as reporting solution.
    Our customer has asked for the authorization strategy that will be implemented in SAP BI. Currently the users belong to different companies or plants or countries
    Current structure is like,
    User 1 belongs to Plant1 of Country1
    User 2 belongs to Plant2 of Country2
    user 3 belongs to Plant3 of Country1 etc..     
    We have more than 500 users who will use the reports. The user belonging to a particular plant should only see the plant data/Country data he belongs to.
    As I understand, we need to create the roles in BW and these roles to be imported into BO to use for the row and column level security.
    The options we considered are,
    1. Use Bex queries in BW to with ABAP code in CMOD to identify the user belongs to Plant  1, 2 or 3 and provide necessary authorizations.
    2. Create user groups based on the country or company they belong to and create as many roles as required. This will however impact the maintenance of so many roles in the BI system.
    We are also forced to avoid Bex queries in BW and hence,  trying to connect Multiproviders directly in BO universe.
    How should we go forward in designing the authorization concept? Any better ideas?
    Thanks and Regards,
    Srinivas

    There are two ways which we can implement this kind of authorization based on my knowledge.
    1. Data Security purely at BW
    If the data is secured based on roles and users, there is no  need of additional authorization from BO side except at report and folder level if you go for SAP Authentication.
    Once you use SAP authenication and enable single sign on option in universe connection, the SAP users can access data based on their profile set at BW.
    2. Data Security from BO
    Let's assume that, if nothing is set at BW and every thing to be take care from BO.
    Then you could create one multiple provider for each plant / country. Create one connection for each multiprovider
    Create restrictions (Tools--> Manage Access Restrictions) for each plant/country. There you can change connection names.
    So you would need to create many restrictions for different permutations and combinations.
    I never tries this option with Multiprovider. But It worked well with NON-SAP data.
    Hope this helps!
    Regards
    Gowtham

  • Release strategy for Purchase order

    Hi Friends,
    My client was using Release strategy for purchase order. Now we want to know the T-code for showing list of Rejected Purchase orders,  T-code for for showing list of approved purchase orders, T-code for showing list of blocked purchase order.
    Thanks and regards
    Krishna

    HI,
    You can go to SE16N view table name EKKO
    FRGKE   Release ind.  = B 
    FRGZU   Release status = <blank> 
    mean, this PO yet to approve/ rejected.
    FRGKE   Release ind.  = R
    FRGZU   Release status = X
    means, this PO has been approved.
    Hope this helps

  • Mass change of reason for rejection

    I need to show a list of all the orders on teh basis of sales order date.
    the user will select few from the list and click "reject".
    this will popup a window showing all the reasons.
    after selecting a reason the program should change
    all the line items from all the sales docu with the
    selected reason of rejection.
    The obvious choice will be to call VA02 in BDC session in the background.
    But can it be done without BDC.
    I have given it a shot using  FUNCTION module 'SD_SALES_DOCUMENT_READ' but I am unable to send the new reason for rejection to the fn module . Also the fn module SD_BULK_CHANGE is not helping as for as my understanding goes.
    TABLES: vbap, vbak, vbakkom.
    DATA:   BEGIN OF xvbap OCCURS 125.
            INCLUDE STRUCTURE vbapvb.
    DATA:   END OF xvbap.
    SELECT SINGLE * FROM vbak INTO vbak
      WHERE vbeln = '0000012065'.
    SELECT SINGLE * FROM vbap INTO vbap
      WHERE vbeln = '0000012065'.
    SELECT * FROM vbap INTO TABLE xvbap
      WHERE vbeln = '0000012065'.
    DATA wa_vbap LIKE LINE OF xvbap.
    wa_vbap-abgru = '02'.
    Alter all rows in one go
    MODIFY xvbap FROM wa_vbap
    TRANSPORTING abgru WHERE vbeln <> space.
    EXPORT xvbap TO MEMORY ID 'XVBAP'.
    vbap-abgru = wa_vbap-abgru .
    CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
      EXPORTING
        document_number = vbak-vbeln
      IMPORTING
        evbak           = vbak
        evbakkom        = vbakkom
      EXCEPTIONS
        error_message   = 01.
    vbap-abgru = wa_vbap-abgru .
    CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
    EXPORTING
       synchron                         = 'X'
       status_buffer_refresh            = ''
       requisition_buffer_refresh       = ''
    IMPORTING
      EVBAK                            =
    TABLES
      EFXVBEP                          =
       efxvbap                          = xvbap[]
      ATTR_TAB                         =
      EFXVBPA                          =
    COMMIT WORK.

    Hi,
    Look at the table ORDER_ITEM_IN
    Regards.

  • Valuation strategy 2 rejected by activity valuation

    Dear all,
    I wish to close the PM order.Balance of the PM order is ZERO.
    System displays the error
    Valuation strategy 2 rejected by activity valuation
    Message no. CK295
    Diagnosis
    Price strategy 2 is not allowed for the application.  It is not possible to find average standard rates with an actual cost estimate.
    Kindly suggest any possible solution!
    Thanks and regards,
    Satyajit

    Satyajit,
    I'm fairly sure it just cannot find a rate to use that is valid for the time period in which the posting date falls. Long text of your message says:
    It is not possible to find average standard rates with an actual cost estimate
    Look at KP26 but maybe another transaction. Also check with your CO people.
    -Paul

  • Return Code - Query for Multiple Rows as XML

    Hi,
    I'm executing an MSSQL stored procedure through the "Query for Multiple Rows as XML" activity in LiveCycle ES. I do this through a call statement such as this:
    { call MyStoredProc(?) }
    This works great, the stored procedure always returns a record set (with or without records). I use this activity rather than "Call Stored Procedure" because I can transform the record set into XML right away within this activity. Unfortunately any exception arising from invoking this stored procedure cannot be handled within the workflow as this activity does not have an exception handler (lightning bolt). In an attempt to handle at least some exceptions we have decided to use try/catches within the stored procedures and return different error codes. Now the problem I am faced with is that there is no way to retrieve the returned code within any of the SQL activities. We don't want to have to write an execute script for each of these SQL calls. Is there any way to do this? Seems like I'm 95% there.
    Thanks
    Nic

    Thanks for the offer, unfortunately we would need something certified by Adobe.
    Nic

  • Release strategy for PO and Contract

    Hi,
    I maintain characteritic for PO
    Plant
    Doc Type
    Net Order Value
    Purchasing Group
    I maintain characteristic  for contract
    Company code
    Target Value
    Doc Type
    Purchasing group
    My class consist of
    Plant
    Doc Type
    Net Order Value
    Purchasing Group
    Company code
    Target value
    Q1: Do i need to maintain ALL characteristic value when i define my release strategy for PO or Contract as some characteristic only apply to PO only or contract only?
    Q2:  What option do i have if i need to maintain all characteristic value ? leave it blank ? empty
    Currently my PO release is working fine but when i try to maintain the contract release inside the class . my PO release is not triggering . I maintained diffrent release group for both PO and Contract .
    Thank for your advice

    First of all
    For purchasing like PO,pr,contract you can able to get in ekko table.No need to maintain separate release unless if it your business requirement.Take Document type as one of the characteristics it will distinguish whether it is PO or contract.
    You have to maintain all the characteristic value then only it will trigered release.
    Check the release indicator as well.
    Hope it will help.

  • Release strategy for quantity contract

    Hi Gurus,
    In quantity contract ..  target value will not filled by the value(in header details) as it is quantityt contract.
    We may have different line items with different cost..
    my doubt is how the release strategy will be triggered for the quanityt contract and how the system will consider the whole value of the contract..
    please explain/clarify
    regards
    subbu

    Hi,
    The release strategy for the contract will work in the exact mechanism as for the PO i.e. it will be determined  based upon the total net value of the entire purchasing document.
    Cheers,
    HT

  • Release Strategy for SA/Contract/PO

    Hi friends,
    Should we have different release groups and release codes in contracting/ SA/ PO.
    Because...
    I have maintained 4 characteristics in release strategy for PO _[ Comp Co, plant, porg, total net order value].
    But i want to maintan only 2 characteristics in release strategy for contract  [plant, total net order value]
    because the same is reflecting in contract config also.
    Is it possible..please help me frnds.
    Prabhu

    Hi Prabhu,
    Unfortunately you need to maintain characteristics of all possible values for company code and plant for contractsu2019 to subject the release.
    Wish that SAP would be more flexible with release of PO, Contract and RFQ but it does not.
    Regards

  • Release Strategy for Contract is not getting picked whereas it is ok for PO

    Dear Experts,
    I have created release strategy for PO with doc type, p.org, net value as chars and frg_ekko as class and release group as 02.
    I kept NB,FO,MK and WK as char values. it is working fine for PO's whereas it is not getting picked for Contracts. we need same release strategy for PO as well as for Contract.
    Kindly resolve the issue.
    Satish

    S0004830404 wrote:
    Dear Experts,
    >
    > I have created release strategy for PO with doc type, p.org, net value as chars and frg_ekko as class and release group as 02.
    > I kept NB,FO,MK and WK as char values. it is working fine for PO's whereas it is not getting picked for Contracts. we need same release strategy for PO as well as for Contract.
    >
    > Kindly resolve the issue.
    >
    > Satish
    hi,
    use create other characteristic for value CEKKO-GNETW in this use the mk , wk values in value field and assign this characteristic to your class and save.
    Thanking you

  • Check Box for each row in report -- all rows deleting when pressing DELETE

    Hello experts! I have set up a report with a check box for each row. When I click the DELETE button to delete the selected rows, every single one of the rows get deleted...even the ones that are not selected. I have my process point set to "On Submit - After computations and validations".
    This is my delete process (SHG is the table and SHG_ID is the primary key):
    FOR i in 1..HTMLDB_APPLICATION.G_F01.count
    LOOP
    DELETE FROM SHG
    WHERE SHG_ID = HTMLDB_APPLICATION.G_F01(i);
    END LOOP;
    Also, I've added to query in the region source this line:
    htmldb_item.checkbox(1, SHG_ID) del,
    Where does the "1" come into this? Not sure what I am doing wrong!
    Message was edited by:
    user477193
    Message was edited by:
    user477193

    The 1 (first argument to all the htmldb_item.* APIs) corresponds to the array number in htmldb_application.g_fNN. So 1 will populate array g_f01, 2 will populate g_f02 and so on.
    Your code seems fine, it should delete only the checked rows. Are you sure there is no other process on the page that might be deleting the rows? See if you can put up an example on htmldb.oracle.com

  • Reason for rejection for sale order stock existing line item

    Hi,
        I am giving reason for rejection for a line item where there is already sale order stock. Then I am getting a warning message like " there is sale order stock assigned". I want this message to be as error message. Any customisation (SPRO) is there for this?
    Kindly update.
    Ratna

    Dear Rama Rao
    I think, there is no problem you can ignore the warning message and go ahead give reason of rejection and close the order
    There wont be any problem absolutely
    The reason  of warning message is, (it is sales order created with item category with special stock indicator as E )  that means the system tells you that it is extra special stock which you have created and now you are trying to reject hence it alerts you by giving a warning  message
    The item category of the items which you are trying to reject  is marked  or should have been marked with special stock indicator (you can check that in VOV7)
    By double clicking warning message if it is of V4 message class in t code OVAH you can make that as no message
    But i doubt that this is available in OVAH
    Regards
    Raja

  • Sales report based on Reason for Rejection

    Hi Guru's,
    I have a requirment to get the list of sales orders( Open/ Close) report based on Reason for Rejection.
    Please makesure it should be standard not customization and using tables.
    Thanks & Regards,
    Subbu.

    Hi subburamaiah
    If you want the report you can create a separate SIS report . In that take the input field  as a Reason for rejection.. and ask for the output the list of sales orders .Now when you check this user defined report you will give the reason for rejection and check what all orders got rejected on that reason for rejection.
    Regards
    Srinath

Maybe you are looking for