cancel
Showing results for 
Search instead for 
Did you mean: 

BEHAVIOR_ILLEGAL_STATEMENT during Validation on Save

abaper007
Explorer
0 Kudos
270

Hello experts,

We are using SAP standard function module "COBL_CODINGBLOCK_CHECK" in custom ABAP RAP application to validate the accounting lines, but application gets crashed during the validation phase with error saying BEHAVIOR_ILLEGAL_STATEMENT.

Statement "EXPORT TO DATABASE" is not allowed with this status.

Actually, function module "COBL_CODINGBLOCK_CHECK" internally calls the function module “FM_ACCOUNT_DERIVE” which tries to save the fund management derivation rule (FMDERIVE) trace log in data cluster (TABADRX) using statement "EXPORT TO DATABASE".

We know that database commands are not allowed in RAP Early Save Phase and only allowed in RAP Late Save Phase.

We can perform coding block check during RAP Late Save Phase, but then error messages would not be shown in UI, so it must be done in RAP Early Save Phase.

Do you have any suggestion how to resolve this issue?

View Entire Topic
MioYasutake
Active Contributor
0 Kudos

Hi @abaper007

According to the document below, by using saver class CL_ABAP_BEHAVIOR_SAVER_FAILED instead of the default CL_ABAP_BEHAVIOR_SAVER, save_modified method will include failed and reported parameters.

https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabp_cl_abap_beh_s...

 

abaper007
Explorer
0 Kudos
Thank you Mio Yasutake 🙂