tags:

views:

162

answers:

1

What is sy-oncom used for?

I've the following explanation from SDN but in my program I'm getting a value of 'T' and 'X'.

SY-ONCOM

On Commit flag. This system field is set to different values depending on the call status of an ABAP program. Of these, only the value of ‘P’ is guaranteed. If at all, SY-ONCOM must only be queried for ‘P’.

The value 'P' means that the program is already executing a subroutine started using PERFORM … ON COMMIT and therefore a further subroutine call using PERFORM ... ON COMMIT would cause a runtime error.

A: 

It's a largely undocumented field, I wouldn't rely on it. I know that it should be set to 'V' (Verbucher) when an update function module is run in the update task after COMMIT WORK. Before this, the PERFORM foo ON COMMIT calls are executed, and during these routines, the field should be set to 'P'.

Just out of curiosity, what do you need it for?

vwegert
I'm not too sure as well, I found it inside an user exit and it's causing problem with the checking of this variable for value 'X'. So I'm trying to figure out what does this field do.
SteD