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

BAPI vs FM

Former Member
2,127

Hi experts,

Can you please try answer me for the following questions

1) 'IDOC_INPUT_DELVRY' is it a RFC function module or can we call it as BAPI.

2) Can we use BAPI_TRANSACTION_COMMIT any number of times in the program, ofcourse even if you use number of times there wont be any benefit but can i use like that - i want to know the disadvantages if i use multiple times.

3) Exactly what will happen in the data base if i use COMMIT WORK / BAPI_TRANSACTION_COMMIT ? If it do COMMIT / ROLLBACK then what is the need of using these statements for 'SYNCHRONUOS BAPI's

Thanks

Jaya

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
966

Hi Jaya,

BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK can be used to finish the database update (or rollback) process.

BAPI_TRANSACTION_COMMIT will trigger all pending update processes, all PERFORM ON COMMIT, just all database changes in current LUW.

Generally, BAPI_TRANSACTION_COMMIT or COMMIT WORK should be the last action in the logical unit of work. If you do it multiple times, you can't rollback anything in case of error occurred after COMMIT.

NEVER use BAPI_TRANSACTION_COMMIT in a function module because you don't know what has been done before the call and what will come later.

Regards,

Clemens

7 REPLIES 7
Read only

Former Member
0 Likes
966

IDOC_INPUT_DELVRY is RFC Function module to update delivery data.

You should not use BAPI_TRANSACTION_COMMIT

Note : BAPI Function module start with BAPI_

BAPI Function will not allow Comiit work so we use BAPI_TRANSACTION_COMMIT .

COMITT - It update the data into database tables suceessfully..

Rollback _ it reverse the data...

Reward Points if it is useful

Thanks

Seshu

Read only

0 Likes
966

Hi Seshu,

Thanks for your information, i knew the points you mentioned. ya BAPI function modules will start with BAPI_, but those are also RFC enabled function modules right, so how can we differenciate them.

Thanks

Jaya

Read only

0 Likes
966

BAPI is Remote enable Function module

RFC is Remote enable Function module

The only diffrenece is BAPI is interlink Business Object repositry ( BOR)

rest of the same

Read only

0 Likes
966

Hi Jaya,

The BAPI are genreally used to load the data into SAP system (such as customer data, vendor, asset, etc). They are always linked with database changes. BAPI's are created by SAP after lots of research and generally remain untouched by SAP in Upgrade.

RFC is just FM which is remotely enabled so that it can be used to connect from other SAP or other system.

Regards,

Atish

Read only

0 Likes
966

Hi,

If i write the code to update the data base with in RFC function module, it will be executed when non sap system calls that RFC from outside. Is it not ?

I think BAPI will be created based on OOPs techniques, in this case RFC is just based on normal ABAP but functionality wise both will be same.

More over BAPI is Object oriented, the same BAPI will be used for different applications, since it is not static where as RFC will work only for one particular application.

Please let me know if i am wrong.

Thanks

jaya

Read only

0 Likes
966

Hi Jaya,

It is not that BAPI are based on OOPs technologies.

As I mentioned earlier they are made after lots of research and they are generally used to load lots of data in SAP system either from Legacy system or from other SAP systems.

Reward points for all helpful answers.

Regards,

Read only

Clemenss
Active Contributor
967

Hi Jaya,

BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK can be used to finish the database update (or rollback) process.

BAPI_TRANSACTION_COMMIT will trigger all pending update processes, all PERFORM ON COMMIT, just all database changes in current LUW.

Generally, BAPI_TRANSACTION_COMMIT or COMMIT WORK should be the last action in the logical unit of work. If you do it multiple times, you can't rollback anything in case of error occurred after COMMIT.

NEVER use BAPI_TRANSACTION_COMMIT in a function module because you don't know what has been done before the call and what will come later.

Regards,

Clemens