Process records in LOOP

My logic is
cursor c1 is
SELECT col1,col2,...
FROM tab1
BEGIN
FOR c1_rec in c1 LOOP
IF some condition is satisfied THEN
delete the record
-- exit out if the condition is satisfied and go to next record in loop
END IF;
BEGIN
SELECT (some date)
INTO variable
FROM table 2
IF variable = some value THEN
DELETE operation
UPDATE operation
-- exit out if the condition is satisfied and go to next record in loop
END IF;
END;
END;
What i am trying to acheive is after i enter the loop i am working with a set of records based on the explicit cursor declared. Suppose i am with my first record and it has satisfied the condition of the first DELETE statement and i want to exit out and process the next record in the set instead of going further in the logic. How do i do this?
Thanks in advance.

This is the code i have the end loop at the end and i dont want to bail out of the loop i need to go to the next record as soon my first delete is done as the second delete/update is based on another logic check from the first one. So if i use EXIT then i am exiting out of the loop which i dont want to do rather be in the loop and process the next record. I hope that explains. Sorry for the confusion.
Thanks
cursor c1 is
SELECT col1,col2,...
FROM tab1
BEGIN
FOR c1_rec in c1 LOOP
IF some condition is satisfied THEN
delete the record
-- exit out if the condition is satisfied and go to next record in loop
else
BEGIN
SELECT (some date)
INTO variable
FROM table 2
IF variable = some value THEN
DELETE operation
UPDATE operation
-- exit out if the condition is satisfied and go to next record in loop
END IF;
END;
end if;
end loop;
END;

Similar Messages

  • Post Processing records in BAPI_PRODORDCONF_CREATE_TT

    Hi All,
    I am using BAPI_PRODORDCONF_CREATE_TT for Production Confirmation with Auto Goods receipt(GR) Feature.
    But, in case any error in goods movement occurs system creates a post processing record( Visible in transaction COGI).
    We don't want entires in COGI.In case, any error occurs system should terminate the session. The same control is maintain in SPRO. But, BAPI overrules that.
    Kindly let me know which settings to be used in BAPI, to avoid COGI.
    In Post Wrong entries field of BAPI , I have used ' " ( Blank) value.
    Please suggest.

    Hi Stuti,
    What I suggest you is to use 2 BAPI's instead of 1.
    First use BAPI_GOODSMVT_CREATE to carry out goods movements.
    If this BAPI is successful then only execute the BAPI you are using only to carrying out the confirmations
    This is the best way to control your confirmation for failed goods movements.
    Regards,
    Yogesh

  • Calling Synchronous process in a loop

    Hi
    I am facing a problem while I am tring to call Synchronous process in a loop. I am having a parent process that fetch batches numbers (list of batches) and loop for each of them and call a child Synchronous process to do some activity.
    the issue here is that the output variable on the process is taking the value that returns from the first batch call and keep repeating it for all the rest batches. I tried to initialize it to null every time I am entring the loop but strangly it has been overrided with the output variable of the first batch and then for the rest it just initialized to null and not had been overriden.
    any body face this before or knows about it
    thanks and best regards,
    Baraa

    This is Arun (working with Baraa in same Company)
    Let me eloborate the situvation
    Facing problem while I call a Sync process from an Async process using while loop.
    When I call sync child multiple times from a parent process using a While loop the response msg from child process is not correct.
    Meaning for instance let say
    Parent process : P
    Child processes : C1, C2, C3     (assuming the loop goes for three iteration)
    The expected response msg of the individual process where
    C1: 10000
    C2: 999
    C3 :           (null)
    But when I go through the audit of the parent process I could see all responses as 10000, meaning the response of the child process is not getting reflected in Parent process correctly
    Whereas when I inspect individual child process response; I could see the correct values.
    Note: I am using End Point Reference technique to call the child process
    Any Idea.
    Requirement:
    Parameter: Source System Name
    (this parameter decides which child to call, basically this will be the SERVICE on WSDL pointing to the child process)
    A parent Async process has to call a Sync child process “n” number of times (“n” get derived at run time) WHILE loop
    The parent will decide which child process to call at runtime (Dynamic call using EndPointReference)
    Some thing like below:
    <Set END POINT REFERENCE>
    <WHILE>
    Invoke Child (synchronize process)
    <END LOOP>

  • Post processing records deletion log in MF47 -reg

    Hi...
    How to know the MF47 post processing records deletion by users  ?
    some of the post processing records in MF47 are being deleted by the users with out processing in time
    we would like to know where this log will be there and we should be able to see the log like
    which user deleted which records on which date
    regards,
    madhu kiran

    hi,
    i have posted earlier on deletion of MF70 records -backdated backlogs which could not be processed
    now i have asked for tracking of post processing records deletion in MF47
    if some record is deleted then no way to track when and who has deleted  them ?
    regards,
    madhu kiran

  • Post processing records in MF47 and COGI

    Hi All,
    I have a query....
    In STD SAP will the postprocessing records created by Repetative Mfg. be visible in transaction COGI???
    And will the postprocessing records created by Descrite Mfg. be visible in transaction MF47???
    Regards,
    Vinayak.

    Hi ,
    In general for Discreate Mfg the post processing records are checked and cleared in Tcode : COGI.
    Whereas for REM Mfg it is : MF47.
    You will be able to view the REM postprocessing records in MF47, it is a standard behaviour of SAP , hence I can say there is no bug in your system.
    Hope this will help you.
    Regards
    radhak mk

  • Process chain that loops itself

    Hi experts,
    I have a process chain here that will be triggered by event, and at the end of the process chain it will trigger the same event so that the process chain will loop itself.
    But I have a problem here, I need to run the process chain only on working days (Mon - Fri), and I have a factory calendar for it.
    However, if the process chain is triggered by event, I cannot restrict it by factory calender.
    Any ideas?
    Thanks
    Ivy

    hi,
    Create a new chain which is scheduled daily and in it add ABAP program to if the process chain (loop) is still active, if it is not then check the factory calendar and raise the event if it is a working day. In case of active run do nothing.
    The process chain with loop can have the existing variant where it is triggered by event. In the loop chain add the program to check the working day from calendar and only raise event if it is.
    This way the loop will also be maintained and the chain would stop on a non working day and automatically be triggered on the next working day.
    regards,
    Arvind.

  • Interrupt process and Debug loop

    Hi,
    What is the difference between Interrupt process and Debug Loop in the process chain if both are used to delay the a process
    Thanks
    krish

    hi,
    Interrupt is a process type which is used in the process chains to trigger the chain after completion of specific steps in another process chains or to pass the process chain up to specified certain time is reached based on the requirement.
    Debug loop can be used to debug a process chain,you will have to specify here the gap between one event been triggered and the next subsequent process also you have to Enter a wait time
    regards
    laksh

  • Process records in a transaction table in real time

    We are currently designing a new system which basically needs to process records from a transaction table. We are envisaging to have approximately 100000 records per hour. There is no need to process each transaction independently as the external process will process all records residing in the table which have not been processed as yet.
    We are basically looking at various options:
    1) have the external process run continuously, select all records in the table, process them and delete them and then start the process again
    2) have the external process run continuously, select all records in the table, process them, update a status flag and then start the process again processing only those records with their status not yet updated
    3) fire a trigger for each record launching the external process (if it is not running yet)
    4) have a separate table containing a timestamp which is updated via trigger for every transaction that is inserted in the transaction table. Have the external process run continuously and only process those records which have exceeded the previous timestamp.
    Would appreciate any ideas you may have how to tune this process and your views regarding the options mentioned above(or others you might have)
    Thanks a lot.

    user9511474 wrote:
    We are currently designing a new system which basically needs to process records from a transaction table. We are envisaging to have approximately 100000 records per hour. There is no need to process each transaction independently as the external process will process all records residing in the table which have not been processed as yet.My busiest table collects up to 50 million rows per hour (peak periods in the day) that also needs to be processed immediately (as a batch) after the hour. I use partitioning. It is a very flexible and there are very few (if any) performance knocks.
    The entire data set has to be processed. With a partition that means a full scan of the table partition - and the ability to do it using parallel query. No additional predicates are needed, except the to have the CBO apply partition pruning. In other words, the predicate enables the CBO to narrow down the SQL to the previous hour's partition only.
    No additional predicates needed like a STATUS flag to differentiate between processed and unprocessed rows - as the entire data set in the partition is unprocessed at that time. (such a flag approach will not be very scalable in any case)
    Also, I do not use external processes. Too expensive performance wise to ship data all the way from the Oracle buffer cache to some external process. And parallel query is also not an option with an external process as the OCI does not provide the external process with a threading interface in order to hook into each of the data output streams provided by the parallel query clients.
    I stay inside PL/SQL to perform the data processing. PL/SQL is even more capable than ProC/C++ and Java and .Net in this regard.
    The execution interface to drive the scheduling of processing is DBMS_JOB. Straight forward and simple to use.
    The basic principles of processing large data volumes in Oracle is to effectively use I/O. Why use indexes when an entire data set needs to be processed? Why perform updates (e.g. updating a status flag) when the data model and physical implementation of that can eliminate it?
    I/O is the most expensive operation. And when dealing with a large volume, you need to make sure that every single I/O is actually required to achieve the end result. There's no room to waste I/O as the performance penalties are hefty.

  • IView for Activating Compensation Process Records (IT 759)

    Does anyone know the iView for activating compensation process records (IT 759). There are iViews for compensation planning and compensation plan approval in the stndard MSS package but don't see one for activation.
    Regards,
    Sanjay Gera

    Hi Sanjay,
    Unfortunately, we do not have an iView for activation. You may need to develop a custom iView to pull in report RHECM_CHANGE_PROC_STATUS. Since that report is intended to run from R/3 and in bulk (read: background), you would want to consider data volume, browser compatibility to display results and last but not the least, security.
    Donnie

  • Dynamic List - Error processing insertText tag: 'loop' parameter arrays must be...

    Hi, I'm using Dreamweaver CS3 and ADDT (PHP/MySQL).
    I have many forms that I created with "Create Dynamic List Wizard", and All it's working fine until now, suddendly when I enter an any form, click Application / Server Behaviors, I saw a red symbol "!" next to Dynamic List Layout, I clicked it in order to make any changes, and then when I tried to save I got the following error message:
    "Error processing insertText tag: 'loop' parameter arrays must be the same length. The 'loop' parameter 'tableCSSWidth' does not have the same length as the previous 'loop' parameter(s)."
    This is happening with others form in my application. I can made some changes through "code", but others no...
    I would like to know what its' happening with then "dynamic List" server behavior?
    I appreciate your help. Thanks!
    Ernesto

    Hello Ernesto,
    Please follow these exact steps:
    - go to this location on your disk (enable view of hidden files):
    - "c:\Documents and Settings\XP_user\Application Data\Adobe\Dreamweaver 9\Configuration"
    ( if you are on Windows OS)
    or:
    - "Macintosh HD:Users:MAC_User:Library:Application Support:Adobe:Dreamweaver 9:Configuration"
    ( if you are on MAC OSX)
    - rename the "Configuration" folder to "Configuration_old"
    - open Extension Manager and remove all extensions
    - install Developer Toolbox extension
    - start DW and check if the problem still occurs
    regards,
    Ionut

  • Skip error record within loop

    Hi all,
       How to skip error records within loop.
    Regards,
    bala

    Hi krithika,
    1. we can use this logic
    2. Loop at itab.
      check field1 = 'wrong value'
      check field3 = 'wrong value'
      *--- OTHER GOOD CODE
      ENDLOOP.
    regards,
    amit m.

  • TECO status for Prod order for which Post processing record exists

    Dear PP Gurus,
    We use  BAPI_PRODORD_COMPLETE_TECH to TECO production order. Program doesn't TECO orders , if there are Post processing records exsiitng for order giving message "Postprocessing records for order 1000068 prevent technical closing" .  I think this is standard BAPI msg.
    When same BAPI is run in Foreground mode, it gives "Confirmation Prompt" , 'Order 1000068 : There are still reprocessing records . Set order to Technically Complete" with YES/NO/Cancel option. You can save TECO by selecting YES
    Is there a way to achieve this in Background mode.
    Thank you much in advance for help,
    Regards,
    Jatin

    Hello Jatin,
    Call function DIALOG_SET_NO_DIALOG before the BAPI, then system handles the BAPI as in the non-dialog mode and the pop-up does not appear
    Refer KBA 1986661 - PP-SFC: BAPI_PRODORD_COMPLETE_TECH Popup
    Best Regards,
    R.Brahmankar

  • How to process records in a block without navigating (forms45)

    Hi.
    I use multi-record block with check boxes to allow operator select row they want to update. How can I process this task? Do I have to use:
    First_Record;
    loop
    when../*record doesn't exist */... exit;
    If /*checkbox selected */ then process_record
    end if
    Next_Record
    end loop
    But after that I have to navigate to the row I was before and I don't know how to do it.
    Or maybe (it would be much better) there is some way to silently process all rows in a block without employing the navigation process. Any advice?
    Thanks,
    Gregor

    DECLARE
    currentRecord number := get_block_property('YourBlock', CURRENT_RECORD);
    BEGIN
    First_Record;
    loop
    when../*record doesn't exist */... exit;
    If /*checkbox selected */ then process_record
    end if
    Next_Record
    end loop
    go_record(currentRecord);
    END;

  • Processing Record by batch

    Hi Experts,
    I have an scenario, In the internal table suppose If I  have a 50,000 records ( fifty thousand records) , suposse I want to process the records in the batch of 5000 ( five thousand ) , I need to process 10 times to compelete this 50,000 records.
    or if I need to process 50,000 records in  the batch of 2000 then ,I need to process it 25 times...
    The number of records per batch will be given by the user ...
    But how to calculate the iterations and process all the records in ABAP langauage...
    Thanks in Advance...
    Regards,
    IFF
    Edited by: IFF on Feb 18, 2008 6:15 PM
    First Iteration : 1-5000
    Second Iteration : 5001-10000
    Last iteration:45001-5000
    The batch size may be directly given by the user
    Regards,
    IFF

    hi
    after the user inputs the no. of records per batch..
    using usual code send those number of records to the batch and delete it from the internal table..
    as u put it in the loop, the process continues until all the records are processed (that is the internal table become empty).
    Regards,
    K.Tharani.

  • Asp code does not render for first record in looped recordset

    I have posted this question on a javascript forum as it
    contains javascript code however it was believed to be an asp
    issue.
    The following head section javascript code contains the
    function showBigImage( isource,bigImage,header ) function call of
    discussion:
    var currentImage;
    function showBigImage( isource,bigImage,header ) {
    var theImage = document.getElementById( 'largeimage' );
    theImage.src = isource;
    currentImage = bigImage;
    document.getElementById( 'photoHeader' ).innerHTML=header;
    document.getElementById( 'largeimage' ).alt=header;
    The following rendered looped recordset code illustrates how
    the "header" parameter of this showBigImage(
    isource,bigImage,header ) function call does not render ONLY FOR
    THE FIRST RECORD OF THE RECORDSET as it is blank:
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/portable_stage.jpg&width=250','images/portable_stage.jpg',''
    )"> <img
    src="imagescript.asp?path=images/portable_stage.jpg&width=36"
    border="0" alt="" /> </td> </a>
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/seated_riserset.jpg&width=250','images/seated_riserset.jpg', 'Portable
    stage configuration using 9 units of the 3 ft x 8 ft platforms in 3
    different heights' )"> <img
    src="imagescript.asp?path=images/seated_riserset.jpg&width=36"
    border="0" alt="" /> </td> </a>
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/Stageset.jpg&width=250','images/Stageset.jpg','Portable
    stage configuration using 16 units of the 4 ft x 8 ft platforms'
    )"> <img
    src="imagescript.asp?path=images/Stageset.jpg&width=36"
    border="0" alt="" /> </td> </a>
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/Runset.jpg&width=250','images/Runset.jpg','Portable
    stage runset configuration' )"> <img
    src="imagescript.asp?path=images/Runset.jpg&width=36"
    border="0" alt="" /> </td> </a>
    Because of this problem, the caption text does not display
    for this first image record once the thumbnail images are moused
    over. You can view this page example at
    http://www.canchair.com/new_web_product_detail.asp?ProductID=198&ProductFamily=1&ProductFa milySub=10

    Please help with this issue!!!

Maybe you are looking for

  • How to install Windows 8.1 on Haswell MBP

    How do you get Windows 8.1 to do a clean install on a Haswell based rMBP?

  • Delete Asset Master with Sub-Assets

    Hi Gurus, A client of mine has an Asset with out any values, but it has sub-assets under it with values and depreciation. Is it possible to delete the main asset and still have sub-assets? If not what is the way I can delete the main asset and still

  • Cenvat related tax code cannot be used with freight

    Hi Error Cenvat related tax code cannot be used with freight . When i am try to save A/R Invoice i am getting this error. Scenario is           Amount = 389000           Packing Charges = 12000           Sub Total = 401000           BED = 64080      

  • Phone will not backup in order to perform iOS 5 update

    I have been trying dice 1pm EST today to update my iPhone and it will not complete backup. It started once and set for over an hour and then just stopped and it has currently been on the " backing up iPhone" screen for almost 2 hours and it's not eve

  • Moving to new laptop.

    Hi, I got new laptop. My iTunes is installed & configured with my iPhone4S on the old laptop. How can I migrate to new laptop having all data & configurations intact including back-up so that the transition to the news laptop will be smooth? iOS: - 6