Application Development 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: 

Issue with Commit Work after calling RFC Function module

Former Member
0 Kudos

Hi All,

I have a RFC Function module to create a Special LedgerDocument(Tcode:GB01).When I execute standalone its creating document but not its line items.So I called Commit work immediately after calling the FM,so it worked Perfectly fine.

The issue is if any error message appears ,its not returning to the calling program.So I have added Destination to FM

as follows.

Call Function 'FunctionModuleName' Destination 'NONE'

So the Control is returned to Calling program and error message is present in SYST Fields.

But the issue is its not updating the Database with lineitems.

Eventhough it created Document number Line items are not updated.

Is there anyway to execute Commit work after executing the COMMIT WORK.

Thanks in Advance,

Madan

3 REPLIES 3

brad_bohn
Active Contributor
0 Kudos

If there's an error message terminating the call in your local system, you should catch it with the general exception ERROR_MESSAGE = NN, where NN is some number you assign. Why don't you address the error directly? It sounds like you expect the data to commit regardless of the error? What exactly is the error and the function that you're using? Also, your question about COMMIT WORK after COMMIT WORK doesn't really make sense; maybe you should rephrase it.

Former Member
0 Kudos

Thanks for your Reply Brad..

The Function Module i am using is JV_GB01_DIRECT_INPUT.

When I execute this FM standalone it will create Document but with no line items..

Coz,Inside this FM we have a Perform XXX on Commit.

So until I use Explicit Commit..Its not creating line items.

How do we capture error messages by Passing Error_MESSAGES = 'NN'.

Can you please elaborate on this??

Thanks

brad_bohn
Active Contributor
0 Kudos

Do a where-used on the function to see how it's handled. The calls actually use the 'ERROR_MESSAGE' technique I described since the function issues error messages directly without raising exceptions.