Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10548

Re: SAP Released Interfaces for Custom Code

$
0
0

Hi Leandro,

 

I am not sure where are you coming from but if you don't use SAP objects in custom code, then you will have to develop equivalent custom objects to meet the requirement. And, that would not just mean extra effort but will also be risky as any gaps could lead to inconsistencies in the system. So, it is very much advisable to use SAP objects in your code. In fact, that's what APIs are meant for - not just in ABAP but in all programming languages. Normally, during upgrades etc. it is taken care to not change the interface of APIs until it's utterly necessary.

 

In addition to BAPIs and FMs, you can also use classes and methods.

 

If I understand your other question correctly, you are interested in knowing how to find an API for writing to a particular database table. So, yes, one way would be to do a where-used on the table and then sifting through the results to reach an appropriate API. However, from my experience, more often than not, this approach does not lead you to the right API. (That's because where-used search is a static search meaning that it can find only those places where the table name is actually being used in the code. It cannot find those places where the table is being accessed dynamically. Moreover, it's often the case that there are layers of APIs/objects and the actual place where the database update is happening may be a very low level object which you should not be making use of in your code).

     Another way to find the API would be to view the object hierarchy of the table. It would display all the objects in the package to which the table belongs to and you can look through the function modules/classes available in that package.

     Yet another way is that of hit and trial. You can simply do a wildcard search in SE37 using the relevant search terms. If you are looking for an API to write data to a table, then search terms could be 'WRITE', 'MAINTAIN', 'INSERT', 'UPDATE' etc.

     And, since we are living in the age of Google, it never hurts doing a good search for the API. In fact, since it can save a lot of time, it makes a lot of sense to do a Google search before investing time in the other techniques.


Viewing all articles
Browse latest Browse all 10548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>