I'm running a Z program which at a certain point needs to execute a process in background.
The function I need to call is L_TO_CREATE_SINGLE I've coded this into an RFC enabled Z FM to call in background.
When the main program calls this Z FM in foreground, it works everytime. However, when I change it to call in background task it only works on occasions. L_TO_CREATE_SINGLE sometimes returns a not authorised exception message.
I can run this program, using my userid and it'll work, then work, then fail, then work (with the same data that previously failed) then work, then fail, then fail, then work.
The initial thought was timing, but given that in foreground it works everytime, I dn't think it's that.
It's almost as if the user ID changes.
Can anyone think of a reason for this ?
First one of the easy guesses:
you have to use L_TO_CREATE_SINGLE with option I_COMMIT_WORK = space, because in background task no second commit work is allowed.
Which update option did you chose? In case you took a V2 or V3, you might have an independent user. So I would only go for one of the V1 (immediate) options. In general this has to be the correct user, otherwise 50% of all entries would be created by wrong user-ids.