‎2012 Feb 08 4:16 PM
Hello friends,
I am doing a mass update using batch input program. The issue is that my program completes before actual database commit.My requirement is to create info records and after calling the standard batch input program , i am checking the standard tables if the info record is created or not. If yes, am updating the numnbeer else am updating an error message,
The problem is that for some 200 odd records there is no issue but if the no of records exceeds say 1000 or more, the background process of batch input program continues and then my code to check if the info record is created gets called. At this time,the database is still getting updated and there is no info record getting filled( info record actually gets updated in the standard tbale after few mins).
I am pretty sure this is to do with database commit issue and can actually use wait statement but then i cannot always expliciltly say wait up to 100 seconds because the user can choose 1000 records or 1 record at a time. How to ensure that the database gets updated before my checking of the info record in the table.
Please help.
Regards,
Prem
‎2012 Feb 08 5:45 PM
‎2012 Feb 08 5:12 PM
Hi,
Try the following command before looking for info records in the database..
COMMIT WORK AND WAIT.
WAIT UP TO 2 SECONDS.
If this doesnt work.. then i feel you should split the program...
1st create all info records..capture the success/error messages.. once done
call the 2nd part which is related to validation of info record in database.
Thanks,
Best regards,
Prashant
‎2012 Feb 08 5:50 PM
Hello,
I have tried with commit statement and also commit work and wait but still before the database update the select query is called and the output is that no data exist in the internal table. Are there any solution to fix this without having to modify the program or split the program into two?
The program is working as expected except for this issue.
Regards,
Prem
‎2012 Feb 08 5:45 PM
‎2012 Feb 08 6:34 PM
Hi,
Put your code in a FM..in FM attributes declare it as Update FM..
Now in place of your code, call this FM in update task.
In this way, it will be called after the Commit.
Your problem will be solved.
Please revert for any queries.
Regards,
Harsh Bansal
‎2012 Feb 17 1:08 AM
Thanks all. Your answers were helpful. I used while endwhile to fix this.