Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Reply from Pierre_Richer on Mar 18 at 1:49 PM Hi Jean, First of all, I think 1 Million records for a commit is too much (redo log limits). Split your load in batches of n records (like the package concept) for the second concept. Your first approach is far from being efficient but safe. First step in your program is to select Undeleted Reservations. In fact, a million commit is heavy. But if time does not matter, run it in a batch job and it will run for a long time. The program skips the Reservation that could not be deleted (lock by other), no abend. Rerun the job until no more reservations are to be deleted (no record selected). In the other hand, your second approach is more efficient but split in batches. Skip only batches for those a commit could not be done. Run it in background during night when nobody is logged in...or rerun until no more records are to be deleted. In both ways, you can execute many jobs at the same time with different ranges of Reservation number. Pierre
| | | ---------------Original Message--------------- From: Jean Sagi Sent: Monday, March 18, 2013 12:12 PM Subject: Mass Delete of Reservations Using BAPI_RESERVATION_CHANGE Hi everyone, I need to set the "Deletion Indicator" of a given group of reservations. I want to use the bapi BAPI_RESERVATION_CHANGE for that purpose and I tested it and it has worked well. Lets say I want to use this BAPI with say 1 million reservations... What might be the best approach to do this? I've thought these approaches: - it_res <- all the reservations to mass delete say 1 million
LOOP AT it_res INTO... _____Set needed values for BAPI _____CALL FUNCTION 'BAPI_RESERVATION_CHANGE' _____IF no-errors. __________CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. _____ELSE. __________CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. _____ENDIF. ENDLOOP. - it_res <- all the reservations to mass delete say 1 million
LOOP AT it_res INTO... _____Set needed values for BAPI _____CALL FUNCTION 'BAPI_RESERVATION_CHANGE' _____"No Error Check !! ENDLOOP. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'. The first approach is that for every reservation passed to BAPI_RESERVATION _CHANGE a COMMIT or ROLLBACK is issued depending on the result of the bapi. I'm concerned that this could be very heavy if I'm dealing with a lot of reservations. The second approach is based on the fact that almost all of the reservations are not been worked (or locked) by anyone so one may fairly assume that the BAPI won't fail because of locks or something like that. I think this approach might be faster that the first one.But the COMMIT at he end could be very heavy too. In the first approach I don't know if using BAPI_TRANSACTION_COMMIT in asyncronous mode might be of help considering there would be a lot of reservation to deal with. All in all, Please can you provide some recomendations or what approach might be best suited for. Thanks in advance. J. PD: I've tryed standar transaction MBVR (Administer - [Reservation]) but this fisically deletes the reservations and I don't want that. I just want to set the "Deletion Indicator" of a given group of reservations (a lot of them indeed). | | Reply to this email to post your response. __.____._ | _.____.__ |