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

commit required in BAPI / RFC

Former Member
0 Likes
1,353

Hi,

Can any one tell me where can I set a custom RFC as commit required?

And in BAPIs, where is it done?

I want to call a RFC from a external system, but I want to control the commit, but the RFC always performs the commit.

Can any one help me?

Regards

Miguel

8 REPLIES 8
Read only

Former Member
0 Likes
1,051

Hi,

Where ever you will use the function module after that just write the commit statment.

In the function module there is no facility like that.

Regards,

Janardhan

Read only

Former Member
0 Likes
1,051

Use FM BAPI_TRANSACTION_COMMIT to commit

Read only

Former Member
0 Likes
1,051

What is the BAPI are you using? In some of the RFC, there will an option as a parameter for commit functionality.

Otherwise we need to use this FM BAPI_TRANSACTION_COMMIT for commit.

Thank you,

Regards,

ASOK

Read only

christine_evans
Active Contributor
0 Likes
1,051

>

> Hi,

>

> Can any one tell me where can I set a custom RFC as commit required?

> And in BAPIs, where is it done?

>

> I want to call a RFC from a external system, but I want to control the commit, but the RFC always performs the commit.

>

> Can any one help me?

>

> Regards

> Miguel

If the remote function controls the commit, then there is nothing you can do except to change the function module to send back a return code rather than do the commit - which you shouldn't do if the function module is SAP standard.

Read only

0 Likes
1,051

The fact is that even if I use the rollback FM, the changes are still commited.

The exemple is this:

In SAP I have a ZRFC that simply inserts a record in a DB table and does not make un implicit commit.

It simply insert and ends.

Now, I'm calling that ZRFC FM using the .NET connector. After the ZRFC call I do the rollback. But the insert is done any way.

Other Scenario.

In SE37 I call the same ZRFC and it inserts.

If, in SE37, I execute the FM BAPI_SALESORDER_CREATEFROMDAT2, It ends succesfully but the inserts are not done.

Where/how can I say for my ZRFC not to do the commit, like the BAPI_SALESORDER_CREATEFROMDAT2 FM?

Is it possible? Is only for BAPIs and not for simply RFC? If So, where is it on the BAPIs, because I can't find it?

Thanks and Regards,

Miguel

Read only

0 Likes
1,051

Hi,

This might help. [Click here|http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4e3a79e11d1950f0000e82de14a/frameset.htm]

regards,

Advait

Read only

Former Member
0 Likes
1,051

Miguel, you have to create two function modules, the fisrt (EX. zfm1), in his attributes have to set the processing type in remote-enabled mode this is the RFC function. Inside this you have to call the second FM (EX zfm2) in update task. In the attributes of the zfm2 have to set Update Module and Start inmmed.

EX.

FUNCTION zfm1.

CALL FUNCTION 'ZFM2' IN UPDATE TASK

ENDFUNCTION.

FUNCTION zfm2.

modify zxxx from yyy.

ENDFUNCTION.

Read only

0 Likes
1,051

Thank you for the answers.

Does any one know how to call an RFC in update task from an external system?

I'm using the LibRfc32.dll.

What I want is not use 2 FM like Carlos sugested, but call directly the zfm2 from outside SAP.

And then, controll it with the commit or rollback.

Regards

Miguel