2023 May 10 7:38 AM
Hi folks,
Is there any way to update multiple records of WCOCOH table in single go through ABAP code? BAPI_CONDITION_CONTRACT_CHANGE takes contract number as input and updates only single record.
Thanks,
Raj
2023 May 10 7:56 AM
pankaj_p
Yes, there is a way to update multiple records of WCOCOH table through ABAP code. You can use UPDATE statement to update multiple rows 1.
Here is an example of how you can use UPDATE statement to update multiple rows:
UPDATE WCOCOH SET field1 = value1 WHERE condition;
You can replace field1 with the name of the field you want to update and value1 with the new value you want to set 1. You can also replace condition with the condition that must be met for the rows to be updated 1.
If this answer satisfies your question, kindly accept it and could you close the thread. Have a great day! 🙂
2023 May 10 7:59 AM
Hi Yogananda,
Thank you for the answer. Normally for standard sap tables we use bapi to create, delete or update records. So using update query directly on standard is recommended?
2023 May 10 8:14 AM
Hi Raj P, no using UPDATE keyword directly on standard table is not recommended... Prefer BAPI. And for your question I think you have to loop on the BAPI and update records one by one.
2023 May 10 12:42 PM
2023 May 11 9:04 AM
I'm not sorry this time. I cannot understand how a SAP employee can give that sort of answer. To mess with a standard SAP table having alternatives (like the LOOP used by the OP) is not just dangerous, it's not just not recommended, it's against the basic foundations of SAP workbench. Or it should be.
The answer is "right", but to give that answer is not "correct", so I downvoted it.
I will, maybe, de-downvote it if the answer begins with a neon sign advicing AGAINST itself.
2023 May 10 12:42 PM
2023 May 10 2:36 PM
Hi Dominik, I am calling this Bapi in loop and updating data of WCOCOH table. But I just wanted to know if there is any way to update multiple records at a time. Thanks
2023 May 11 8:18 AM
2023 Jun 27 7:52 AM
Hi all, Thank you for your replies. I have created parallel processing approach for this requirement. Closing this now.