Whatever we can do with OData, we can able to do using BAPI right?
So,what's the main thing which OData is having compared to BAPIs ?
Please let me know your views
BAPI
OData
The main thing OData gains over BAPIs are flexibility, open standards, and machine-readability. This may come at the price of speed.
This comparison is slightly off. While BAPI was invented to connect servers, OData is rather used to connect servers to clients. Even though OData's inventors may have had server connections in mind, pure REST has become the de facto standard for connecting this level. It would therefore be cleaner to compare BAPI to REST, and maybe related standards such as web services.
It is possible to emulate OData over a BAPI interface: (URL query) string in, (JSON result) string out. You could therefore conclude that the two are equivalent in terms of power. However, the underlying protocol is different, and systems are more likely to recognize the HTTP protocol underneath REST than SAP's proprietary RFC protocol.