2008 Mar 19 8:01 AM
hi experts,
is it a good practice to update a sap delivered
table directly using abap keyword update , i.e
without using bdc or bapi?
IF yes then why & if not then why?
regards
pankaj
2008 Mar 19 8:08 AM
Its definitely not advisable to update SAP standard tables using UPDATE statement directly in your Z-program.
SAP is not recommending the direct update because:
1. Authorization checks are not supported by the UPDATE statement. You must include these in the program yourself.
In the UPDATE <tablename> will not support the authority check.
2. You have to use SAP Locking mechanism before the UPDATE.
3. A SAP transaction updates not just 1 or 2 DB tables. So direct update might
result in DB inconsistencies. So its not highly recommended.
Hope this helps.
Thanks,
Balaji
2008 Mar 19 8:03 AM
Hi,
Use UPDATE keyword to update customized Ztables.
For standard tables, use bdc/bapi.
reward if helpful.
Regards,
Ramya
2008 Mar 19 8:05 AM
generally not...
the reason being that most of sap transactions do not just update a single table. There is a whole set of a tables that might get updated when you run a transaction or a bapi in SAP. If your program logic can take this into account and provide the same consistency of data then sure...you can update the tables the way u want.
However, having said that, it really depends on what your requirement is and how critical is your update. For example, you could go with updates on master data through your programs. So it depends on the kind of update your program is doing and also the table which is being updated.
2008 Mar 19 8:12 AM
hi priyank,
thanks for your advice , but is it possible to mention in programs all the sap delivered tables to be updated............
a single update can reflect in 100 tables(guess)......
regards
pankaj
2008 Mar 19 8:16 AM
I don't understand what you mean by :
"a single update can reflect in 100 tables"
If you are asking a way to know which tables does a program updates then yes there is definitely a way to know this.
SQL trace comes to your help here. you can activate the SQL trace through transaction ST05, thereafter run your program. Once the execution is finished, deactivate the sql trace and analyze it. You will get to see a hell lot of things that the program has done on the database level. Here you can make out which are the tables updated by the program.
Does that help? Is that what you were looking for???
2008 Mar 19 8:26 AM
hi priyank,
yes thru sql trace i will get all the table names,......
but i think bdc or bapi will be better as data integrity will be maintained..............thanks
regards
pankaj
2008 Mar 19 8:30 AM
Indeed!!
If you are convinced with the answers, then please close the post.
2008 Mar 19 8:05 AM
Hi
If you custom/ Z table table it would be better to use insert modify or update
if you updating master / SAP standard table then it is recommended to use BDC BAPI or FM so that all the related tables should updated
regards
Shiva
2008 Mar 19 8:08 AM
Its definitely not advisable to update SAP standard tables using UPDATE statement directly in your Z-program.
SAP is not recommending the direct update because:
1. Authorization checks are not supported by the UPDATE statement. You must include these in the program yourself.
In the UPDATE <tablename> will not support the authority check.
2. You have to use SAP Locking mechanism before the UPDATE.
3. A SAP transaction updates not just 1 or 2 DB tables. So direct update might
result in DB inconsistencies. So its not highly recommended.
Hope this helps.
Thanks,
Balaji
2008 Mar 19 8:12 AM
Hi Punkaj,
It is not good practice to update standard tables. In SAP all tables will be linked with many tables. We ll have related data stored in multiple tables. If we change one record in one table, remaining related will not be changed. If we use BDC (screen flow like va01) or BAPI, all the related tables will be updated.
Regards,
Subbu