cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

I_JOURNALENTRYTP issue BEHAVIOR_ILLEGAL_STATEMENT

fgfgfg3r43456534
Explorer
0 Kudos
1,199

Im executing the action Post of this BDEF inside of a Determination on save as mentioned in this blog
How to use I_JournalEntryTP in custom RAP BO - SAP Community

determination Post on save { create; }

METHODS post FOR DETERMINE ON SAVE

IMPORTING keys FOR zi_test_journal~post.



Execution takes place in a transactional context: A BO implementation
is active for "R_JOURNALENTRYTP". Statement "CALL FUNCTION IN UPDATE TASK" is therefore forbidden. In the case of
statement MESSAGE, the message text is as follows: "???" The actual error
is probably not located in the program where the termination occurs but
at a higher call level from which the program was called in an illegal
BEHAVIOR phase.


The reason for the runtime error (see the list below) is: (0)
Runtime errors in connection with contract violations can occur for the
following reasons: (0) This contract violation always causes an error
to occur. (1) It is required by the "strict” specification in the
current BO. (2) It is required by the "strict” specification in the BO
that is called. (3) The contract violation occurs in Restricted ABAP.
(4) The corresponding checkpoint group is set to "error". (5) The
violation occurs in a BO enhancement in Restricted ABAP.
The statements
- CALL FUNCTION IN UPDATE TASK
- CALL FUNCTION IN BACKGROUND TASK/UNIT
- PERFORM ON COMMIT/ROLLBACK
are not allowed outside of the "Save" method.
action implementation for example): - CALL FUNCTION IN UPDATE TASK
- CALL FUNCTION IN BACKGROUND TASK
- CALL FUNCTION IN BACKGROUND UNIT

 

fgfgfg3r43456534_1-1729782606002.png

Accepted Solutions (0)

Answers (3)

Answers (3)

fgfgfg3r43456534
Explorer
0 Kudos

No commit at all, the behaviour definition itself its triggering the update task FM within its call stack... it may be related to some note/enhancement in the system not sure...

AbhishekSharma
Active Contributor
0 Kudos

You may Create new RFC function module for your Action code and call it with DESTINATION ‘NONE’

Hope this helps…

Thanks-

fgfgfg3r43456534
Explorer
0 Kudos

Thanks... will try this

Would the parallel processing framework work instead of using RFC? cl_abap_parallel or something similar

AbhishekSharma
Active Contributor
0 Kudos
Not sure why you want to implement parallel Processing must be some reason behind this... but RAP framework doesn't allow COMMIT and so we just call FM with DESTINATION 'NONE' which starts a new LUW and COMMIT will work... when you implement Parallel you also need to take care of no of worker processes check...
MBartsch71
Participant
0 Kudos

Hi,

as the short dump says, all implicit and explicit commits are not allowed in the additional save scenario. However there are some other possibilities.

- You can call the function with "... STARTING NEW TASK"

- You can use some other asynchronous way to execute the function module, e.g. ABAP Push Channels

 

Kind regards

Matthias

fgfgfg3r43456534
Explorer
0 Kudos
Thanks, will try this as well