Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Released Interfaces for Custom Code

Former Member
0 Likes
992

Hi,

Direct access to SAP objects in a custom code program should be avoid in order reduce the effort during upgrades of the SAP.

What else beyond BAPIs and Function Modules with status 'Released for customer' can be used? What are the other interfaces released by SAP?

What's your approach if you need to do some manipulation of a standard table in your program? Do you go to the table, then where used list and try to find a FM or program to call?

Thank you!

1 ACCEPTED SOLUTION
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
887

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.

6 REPLIES 6
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
888

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.

Read only

Former Member
0 Likes
887

Hi Kumar,

You mentioned classes and methods, but do classes and methods also have the label indicating if they are "Released for customer" as function modules have?

The note below explains that there are some FM "released for customers":

https://websmp130.sap-ag.de/sap%28bD1wdCZjPTAwMQ==%29/bc/bsp/spn/sapnotes/index2.htm?numm=109533

Can you give me an example of a FM that is "released for customer"? How can I know if a FM is "released for customer" or not?

Thank you!

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
887

No, I don't see the 'Released' label for classes.

Coming back to function modules, this was brought up recently by Ram B in http://scn.sap.com/community/crm/blog/2013/02/07/crmordermaintain-simple-example-to-create-an-order-.... Although his question was in the context of CRM_ORDER_MAINTAIN (which is an FM in CRM), there are several other FMs in SAP which are commonly used in custom developments but are not released as such. Given the fact that they are very widely used and without issues, that is, to my mind, solid evidence that it's pretty safe to use them. In fact, I don't think I've ever seen anybody worrying about the status 'Released' or 'Not released' before using an FM in their code (not to say that it does not make sense).

As mentioned on the link I posted above, CRMXIF_ORDER_SAVE (again in CRM) is one FM which is 'Released'.

Read only

0 Likes
887

Thank you, I understand you. Although I don't agree that if a FM not released is widely used, means that it's safe to use it.

Read only

0 Likes
887

Hello,

I was looking into transaction /SDF/CD_CCA > "SAP Interface Analysis" and the output list shows in column "SAP Reference Text Type" for SAP Global Classes the value "Usage" / "Usage (Released for Customers)" / "Usage (Object Not Released)" / "Usage (Released SAP Internally)"

- very interesting but where does it come from?

After some research I found table RODIR "Released Objects Directory" with this definition:

OBJECTTYPE Key

OBJECT Key

CLIOBJECT

RELEASED - if marked then customers can use it

REWORKED

OBSOLETE - you should know what it means

RODIR_CHANGED_BY

RODIR_CHANGED_ON

RODIR_CHANGED_AT

That table contains these object types:

CLAS

DOMA

DTEL

FUNC

INTF

TABL

TTYP

TYPE

VIEW

For me that sounds promising and maybe that is useful for you as well.

Bye Thomas

PS: Our development system is SAPKB74011

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
887

Google: 'BAPI + <whatever you need>' or 'FM <whatever you need>' will answer 99% of the questions. Otherwise there is either no FM/BAPI/anything or the <whatever you need> part is incorrect. From what I see, many times people just don't use the correct terminology when searching and hence are not finding anything.

Also as a side note - in the SAP world even an ABAPer needs to know what the transaction is and what it does. If you're just searching "how do I put something in this table" then it's just not a good approach. E.g. instead of 'update BSEG' search for 'BAPI accounting document'. Understanding what is it that you need exactly (and how it's called properly in SAP terms) is half of the solution.