cancel
Showing results for 
Search instead for 
Did you mean: 

SAP RAP: BEHAVIOR_ILLEGAL_STATEMENT

lars_kr
Participant
0 Kudos
943

Hello Community,

I need your help with one thing. 

I am currently implementing a “managed” RAP Fiori application and have encountered the following error in the course of my implementation:

 

Runtime Errors: BEHAVIOR_ILLEGAL_STATEMENT

Statement "CALL FUNCTION IN UPDATE TASK" is not allowed with this status.

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.


I don't have much experience in integrating existing SAP ABAP classes into my RAP application, as I have only been performing operations using EML. In this case and also in future transactions I will not always be able to avoid developing everything greenfield, so I have to use existing code.

Stupid question, but can someone explain the error to me exactly?
It seems that I can't write anything to the database outside of the “Save” method. Which can't always be avoided, especially if I use standard code.

How can this be prevented in the future? Do RAP applications then have to be implemented exclusively “unmanaged”? We haven't had much experience with this yet.

Many thanks for your help

regards,

Lars

View Entire Topic
DiegoValdivia
Active Participant
0 Kudos

.

lars_kr
Participant

Hi Diego,

Thanks for your comment, even though you've practically deleted it, I've read it. I am grateful for any experience regarding RAP and LUW.
My particular problem seems to have been solved. After a lot of research, I solved my action by outsourcing the class that calls the update task to an RFC.
Apparently it is important to call the function with “ CALL FUNCTION .... DESTINATION 'NONE' to create a new LUW. In other words, the call should take place outside the RAP LUW.

It remains to be seen whether this is best practice. The main thing is that it works for now.

reynaldo_tupio
Explorer
0 Kudos
Hello Diego i have same problem when i try tu use FI_DOCUMENT_CHANGE in RAP please let me know how i fix this.