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.
Similar Messages
-
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. -
QM In-Process Inspection for Batch Managed Material
Hi,
I have a issue related to UD of In-Process inspection for batch managed material. The production process is discrete manufacting for a cold rolling mill. A production order can have mutiple coils as per the production amount. To track the individual coil , batch management has ben activated. We have both in-process as well as inspection after production here.
For inspection after production we are fine as we are doing partial confirmation after every coil and have separate inspection lot having different batch number.
But for in-process I can have only one inspection lot for the production order (created on release of the production order). I can do the result recording but while trying to do UD u2013 it is asking for a batch number as the material is batch managed. W/o entering the batch number system is not allowing me to do the UD.
Is there any solution/work around of this problem.
-Regards
ashimHi Ashim,
you raised a very good question? i am helpless here to execute same scenario,
but i disussed with my QM guy here, he said, once the material is batch managed then it has to ahve batch in UD.
so i discussed ur case, which is very much valid for heavy ind like cement and all,
so what i suggest, u create a dummy batch in the UD for in process (no inventory posting)
and at confimation give ur usual batch (if system propose the dummy batch which u give in the UD for inprocess, try to change there--- i hope it should allow)
i would really like to here answer from u for this.
try to do as suggested, and let me know the results.
REgards,
Pravin mukkawar -
Process recordset in batch of 10
Hi,
I've got a query that returns more than 1000 records.
Now, for each record, there are several methods to be called
and much processing to be done.
If I just do
<cfloop query="queryName">
<!--- Invoke all methods here --->
</cfloop>
This will take too long and will cause major performance
issues on the server.
Therefore I want to process the recordset in batches of 10
(I've tested with 10 records and it's fine).
i.e. Loop 1st 10 records -> for each record call the
appropriate methods, etc. When 1st 10 are finished, proceed to the
next 10.
Any idea how to do this please?
Thanks and regards,
Yogesh MahadnacHi Dan,
I have a program that manages hotel representatives.
Each representative has a number of hotels that he is
assigned to, and several agencies can be assigned to each hotel.
We have around 350 hotels and around 1200 agencies in all.
Take the worst case scenario (I've tested with much less than
that and I got a JRUN Error).
Let's say that 1 representative does ALL Agencies on ALL
hotels.
Therefore you need to loop each hotel and assign each agency
to it so that you can record them.
The code attached below shows the basic process that occurs.
When I run it with more than 10 hotels, the program crashes.
That's why I wanted to process it in batches of 10 i.e. process the
1st 10 records, send a message to the user that the database is
processing the request and then when it completes everything, he
gets a message e.g. All records successfully saved and logged.
What do you propose as an alternative solution to process all
those records without causing too much performance degradation?
Regards,
Yogesh Mahadnac -
A better way to delete IT2001 records in batch.,
Hi Gurus,
A little problem here. Due to data source error, I need to delete IT2001 records in batch.
Currently I am using standard report RPUREOPN to do this. But RPUREOPN will not update those deduction in IT2006 quota. So I've to delete & reupload cooresponding IT2006 quota data which is inconvenient.
Is there a better way to do this job? I mean deleting IT2001 in batch and also update the deductions in IT2006.
Thanks in adv!
Br,KeeAfter running the report you mentioned above to delete absences/attn you can try running the report RPTUPD00 to revaluate the attendance and absence.
Regards,
Divya -
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 -
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 kiranhi,
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 -
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 GeraHi 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 -
Hi Team,
To set the Bulk picking process to happen for created batches and when executed no batch order number is getting defaulted for selecting it.
Kindly let me know is there any set up missed for this feature.
Regards,
PAMCould you please explain me what steps need to be done for picking process in OPM batch?
-
how to get the list of error records from batch input method.
u can record them using bdcmsgcoll and also in t100 table.
*& Form prepare_bdc_tab
Prepare BDC Table for updating Copack Purchase Prices
FORM prepare_bdc_tab .
REFRESH gv_bdc_tab.
*MEK1 intial screen
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RV13A-KSCHL' 'PB00'.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RV130-SELKZ(03)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(01)' ''.
PERFORM bdc_field USING 'RV130-SELKZ(03)' 'X'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1018'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RV13A-DATBI(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'KOMG-LIFNR' gs_data-lifnr.
PERFORM bdc_field USING 'KOMG-MATNR' gs_data-matnr.
PERFORM bdc_field USING 'KOMG-EKORG' gs_data-ekorg.
PERFORM bdc_field USING 'KOMG-ESOKZ(01)' '0'.
PERFORM bdc_field USING 'KONP-KBETR(01)' gs_data-kbetr.
PERFORM bdc_field USING 'KONP-KONWA(01)' 'USD'.
PERFORM bdc_field USING 'KONP-KPEIN(01)' gs_data-peinh.
PERFORM bdc_field USING 'RV13A-DATAB(01)' gs_data-datab.
PERFORM bdc_field USING 'RV13A-DATBI(01)' gs_data-datbi.
PERFORM bdc_dynpro USING 'SAPMV13A' '1018'.
PERFORM bdc_field USING 'BDC_CURSOR' 'KOMG-ESOKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
ENDFORM. " prepare_bdc_tab
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR: gs_bdc_tab.
gs_bdc_tab-program = program.
gs_bdc_tab-dynpro = dynpro.
gs_bdc_tab-dynbegin = gc_x.
APPEND gs_bdc_tab TO gv_bdc_tab.
ENDFORM. "bdc_dynpro
Insert field
FORM bdc_field USING fnam fval.
CLEAR: gs_bdc_tab.
gs_bdc_tab-fnam = fnam.
gs_bdc_tab-fval = fval.
APPEND gs_bdc_tab TO gv_bdc_tab.
ENDFORM. "bdc_field
*& Form call_transaction_mek1
Call Transaction for updating CoPack Price entries
FORM call_transaction_mek1 .
*Local Data Declaration
CONSTANTS:lc_e TYPE c VALUE 'E',
lc_mek1(4) TYPE c VALUE 'MEK1',
lc_mode(1) TYPE c VALUE 'N',
lc_update(1) TYPE c VALUE 'U'.
REFRESH: gv_bdc_msg.
*Call MEK1 Transaction
CALL TRANSACTION lc_mek1
USING gv_bdc_tab
MODE lc_mode
UPDATE lc_update
MESSAGES INTO gv_bdc_msg.
IF sy-subrc NE 0.
IF gv_bdc_open_flag IS INITIAL.
PERFORM bdc_open_group.
gv_bdc_open_flag = gc_x.
ENDIF.
PERFORM bdc_insert_group.
DELETE gv_bdc_msg WHERE msgtyp NE lc_e.
REFRESH:gv_bdc_msg,
gv_bdc_tab.
ENDIF.
CLEAR:gs_data.
ENDFORM. " call_transaction_mek1
*& Form bdc_open_group
Subroutine for Open BDC Group
FORM bdc_open_group .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_esnm
user = sy-uname
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
IF sy-subrc <> 0.
WRITE :/ text-040. "Error in BDC_OPEN_GROUP
EXIT.
ENDIF.
ENDFORM. " bdc_open_group
*& Form BDC_INSERT_GROUP
Subroutine for calling BDC_INSERT for inserting BDC Table
FORM bdc_insert_group .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'MEK1'
TABLES
dynprotab = gv_bdc_tab
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
IF sy-subrc <> 0.
WRITE :/ text-041. "Error in BDC_INSERT
EXIT.
ENDIF.
ENDFORM. " BDC_INSERT_GROUP
*& Form BDC_CLOSE_GROUP
Subroutine for Closeing of BDC group
FORM bdc_close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE :/ text-042. "Error in BDC_CLOSE_GROUP.
EXIT.
ENDIF.
ENDFORM. " BDC_CLOSE_GROUP
if u can see gv_bdc_msg is holding the messages
hope this helps
dont go through the code as it is ...it is only part of it
Message was edited by:
Durgaprasad Kare -
No matching records found 'Batchs and Serial Numbers' (OSRD) (ODBC-1028)
Hi experts,
These days In our 2007 system, we had a serial number maintain problem on 'Recipt from Production' transaction.
When we open 'Serial Number Management' form, we can not update S/N by 'Complete' operation mode for some items. but it works for 'Update' operation mode.
The system show 'No matching records found 'Batchs and Serial Numbers' (OSRD) (ODBC-1028)' in the status bar.
How could I fix it ?
thanks for your help.Hi Wilson,
Do you manage the serial number transaction for respective item with "On Every Transaction" or "On Release Only" (in Item master data)? Because, when you manage those item with "On Every Transaction", you should already filled the serial number when you tried to receive those item whether by Goods Receipt PO or Receive from Production transaction.
"Complete" operation in Serial Numbers Management only works for item which you manage by "On Release Only", it doesn't work for item which managed using "On Every Transaction". Hope I don't misunderstood your question.
Best Regards,
Hendry Wijaya -
How to select records in batch?
Hi Friends.
I want to select 10 lacs records. But if i used for all entries also it is giving error of time out. now i want to select records ina batch og 100000. Means forst it will select 100000 records and move in a internal table ..after that it will again fetch next 100000 records and append in that internal table like that..Is it possible..how to do this? i am selecting BELNR from BKPF and using FOR ALL ENTRIES fetching records from BSEG. requirement is such as i have to fetch records from BSEG only and not from BSID,BSIK... like tables..
Please help me...its urgent friends....Hi ..
My program is not a normal abap program..it is a RFC. actually requirement is to fetch data from sap and send it to squ server database. So non sap application execute the RFC. so i cant run this it in background...is it possible to run RFC in background.. -
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,
JatinHello 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 -
ESB Process reads a Batch file for a limited set of records only..?
Dear All,
I am having an ESB process that reads a Batch file (csv) that has around 10,000 Products information.
I have another BPEL process that will create the Product in Oracle Apps through standard API (Main BPEL process that calls a child process for creating product).
I am invoking the BPEL process from ESB, and that works fine.
Now, the Issue is: I am able to create at a time around 10 Products (the main process calls the child process in a loop.). The main process instance is not getting created but the child process instance is getting created for a set of records, afterwards the child process instances get stops creating. The main process instance could not be found in the console. Not getting why the process is not getting visible as well it is not completing the process.
What could be the problem for this... Am I need to change any environment configurations...?
Please update...
Many Thanks in advance...Does this apply to you?
https://social.technet.microsoft.com/Forums/en-US/9ccd8e50-b0af-4f58-9787-6435834e4c52/dfsr-not-working-on-new-windows-2008r2-server
Thanks for the link, but no - not the same scenario although the error is the same. The RGs I'm working with are all in sync and communication is working, it's just getting the backlog reported correctly.
To reiterate, I can paste two versions of the exact command into the DOS window buffer; one copied from OneNote and one copied from my batch file. Executing the one from OneNote succeeds and reports the RG in sync and the one copied from the batch
file fails.
I can repeat the results by up arrow once to the command pasted into the buffer from the batch file and see it fail. Then up arrow twice to retrieve the command pasted from OneNote into the buffer and it will report correctly (illustrated in the grahic).
Let me add that the command in the batch file was originally copied from OneNote and pasted in to the batch file; as if going into the batch file somehow corrupts it.
- a -
Maybe you are looking for
-
I've just updated my iPhone to the new iPhone OS and now it won't work and iTunes won't recognise that it's there. I've uninstalled iTunes and reinstalled twice and it's not working. Please help.
-
How do I access files within projects of the same web application?
Using JDeveloper Studio 11.1.1.1.0 I'm creating a web application using the Model-View-Controller design pattern. Model represents data, View represents data display, and Controller is control... In my application, I created two projects: EJBModel an
-
How to use Javascript to load random pages?
I wonder if anyone knows how to use Javascript to load a list of links stored in the text file. Every address will take a line, and the Javascript will randomly select one of the addresses to load. The user will click the button "random" and access t
-
Word 2013 Email merge not working
Hi, i have tried for some time to send personalized emails to a number of persons. everything works fine, except that the emails are not sending :) windows 8.1 on surface pro and office 2013 updated.
-
When do we use RFC destination Type T versus Type 3? While creating RFC destination Type T, the program ID, blogs says we should use "Registered server program" and can give any free text. I tried that but says there is no registered server program c