01-28-2011 2:39 PM
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
01-28-2011 2:58 PM
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.
01-28-2011 3:02 PM
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
01-28-2011 4:13 PM
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.