‎2005 Jun 28 11:03 AM
Hi All,
I tried to use the SQL update statement to directly update a database field in my program.
But my boss said it is a poor practice.
Instead of using the SQL statement, we should use the batch input method.
Could you guys tell me why shouldn't we use the SQL statement directly?
Thanks.
‎2005 Jun 28 11:10 AM
Hi Marcy,
if you are using batch input, you make sure that you are posting consistent data, because during batch input all field and program checks are processed. Using a simple update or insert statement might lead to inconsistencies.
But anyway there are still options/problems/requirements where it makes sense to do a insert or update by sql.
Hope this helps
regards
Siggi
Message was edited by: Siegfried Szameitat
‎2005 Jun 29 2:59 AM
Hi Siggi,
Could you tell what kinds of inconsistency there would be?
Could you elaborate it?
(For example, I'd like to update the lab/office (LABOR) in MARA.)
Thanks.
‎2005 Jun 29 6:18 AM
Hi Macy,
e.g. no change documents are written - with transaction MM02 (or MM42) CDHDR and CDPOS entries will be created - and further on change pointers be written - which can be used to trigger interfaces...
There might be a long list of dependent functions.
Regards,
Christian
‎2005 Jun 29 6:34 AM
MARA mainly deals with your Material Management(MM). For e.g. if you create a material using transaction MM01, there are a number of tables involved with this. Some of them are :
a) MARA
b) MAKT
c) T134
d) T024L
and the list goes on.
You have got the Basic View1, Basic View2, Purchasing and a number of views associated with the material. And since you and I have not developed this material management(MM) module, it would be ideal to have the basic checks provided by SAP to take place and then insert the data, since we only have a broad idea in which table, data goes.
So in case you update T024L directly , that deals with Lab/office details, chances are you have not made:
a) Sufficient validation
b) Not updated other tables related to lab/office
And thus you have an inconsistent database at your disposal.
Hope things are a little clearer.
Regards,
Subramanian V.
‎2005 Jun 28 11:14 AM
hi,
which table do you want to update? standart table? or your own table?
If it is standart table of curse you need to use batch input or bapi or function.
Why? because the system will update all the necessary tables and make all checks necessary to the update
.
You <b>can't</b> say, for exemple, I want to update table <b>MARA</b> with a matarerial number, by using SQL, because there are more than one table you have to update and you even don't know theire names. But they have to be update for other processes.
And by updating yourself SAP table you may loose SAP support....
‎2005 Jun 28 11:30 AM
Hi Macy,
have a look to that link :
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/69/c250274ba111d189750000e8322d00/frameset.htm">Process Overview: Batch Input</a>
regards Andreas