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

Validation in Rap Late Save Phase using CL_ABAP_BEHAVIOR_SAVER_FAILED

abaper007
Explorer
0 Kudos
886

Hello experts,

We are using SAP standard function module "COBL_CODINGBLOCK_CHECK" in RAP Late Save Phase (exceptional case: CL_ABAP_BEHAVIOR_SAVER_FAILED/SAVE_MODIFIED) of custom ABAP Managed RAP /Fiori element app to validate the accounting lines and report errors back if occurred - this is perfectly fine.

https://community.sap.com/t5/technology-q-a/behavior-illegal-statement-during-validation-on-save/qaq...

But facing 3 issues:-
1. Standard function module has many AUTHORITY-CHECK, so application is getting crashed with error BEHAVIOR_ILLEGAL_STATEMENT.

Statement "AUTHORITY-CHECK" is not allowed with this status.

I can disable the authority-check by using authorization context in behavior definition but before that need to find all authorization objects used in function module (and in subsequent calls).

Is there any other simple way to avoid this error?

2. We have UI button "Check", since "COBL_CODINGBLOCK_CHECK" is performed in RAP Late Save Phase, accounting validations are not getting considered in "Check" action

3. When error received from "COBL_CODINGBLOCK_CHECK" in SAVE_MODIFIED by that time new number is already generated (late numbering), so new number is wasted as validation gets failed. (Number gap in transactional documents)

Do you have any suggestion to overcome these issues?

Accepted Solutions (0)

Answers (1)

Answers (1)

MioYasutake
Active Contributor
0 Kudos

@abaper007 

Calling COBL_CODINGBLOCK_CHECK from RAP behavior method might not be a good approach. Can you check if the validate action of I_JournalEntryTP can be used in your scenario?

 

abaper007
Explorer
0 Kudos
Hi Mio Yasutake,
abaper007
Explorer
Hi Mio Yasutake, Yes - you are correct, It should have been used released api instead of COBL_CODINGBLOCK_CHECK, and I_SupplierInoviceTP could have been used but it does not fulfill my requirement completely. I created function to call coding block and called that function from "validation on save", it solved my problem