Hello,
I have always wondered what the "best practice" is in this case, so I am looking for input. When writing custom reports etc. in SAP, is it generally regarded as better practice to write a SELECT statement to get a line from say a Txxx configuration table, or is it best to use an associated BAPI or call to function module? I know in some cases perfomance must obvioulsy be considered, but in terms of SAP's recommendations or upgrade considerations, which is typically better?
Assume for example something as simple as getting company code data... Is it best to do <b>SELECT * FROM T001...</b> or to call a BAPI like <b>BAPI_COMPANYCODE_GETDETAIL</b>?
Any feedback would be greatly appreciated.
I use table,
- When I want to fetch a table array, not only one entry.
- When I'm sure that the data is coming from that table/tables
-When I'm sure about that this is the best from performance point of view.
I use FM,
- when it's released for customers (eg BAPI)
- when I need only one entry
- when I need RFC
- when the data is fetched in a complicated way, and I can see that this FM used in standard transaction.
FM is a higher level approach, if it's released for customers, then probable you can use in the next release also. It's very unlike (however sometimes happens eg Ibase tables), that SAP change the way of data storing in db. FM should work after it also.
Peter
I would say that 95% of the time, if I need to hit a "T" table, I just write a select statement, I don't bother to look for a FM/BAPI which essential will do the same thing.
Regards,
Rich Heilman
Add a comment