cancel
Showing results for 
Search instead for 
Did you mean: 

Consistency error while saving draft in Fiori elements list report

0 Kudos

I followed the below blog and created a fiori elements list report.

https://blogs.sap.com/2020/01/02/multiple-level-multiple-child-draft-enabled-fiori-elements-list-rep...

I'm getting the below error while saving the draft.

'Error - You can't save. The draft is not consistent.'

The draft is working fine but during actual save I'm getting error.

Though entries are there in my draft table but the field ''draftconsistencystatus' is currently empty.In some forum they suggested to modify the field 'draftconsistencystatus' of the draft table.I'm not sure how to modify it.Please Support.

Accepted Solutions (0)

Answers (1)

Answers (1)

ivo_vollrath
Active Participant
0 Kudos

Pressing the “Save” button on a Fiori UI should trigger the BOPF actions PREPARATION and ACTIVATION in two distinct ChangeSets (within the same OData request). There must be no other operation in the ChangeSet which contains the ACTIVATION action. Check your browser’s network trace to see whether this is the case.

Action PREPARATION sets the DRAFTENTITYCONSISTENCYSTATUS to consistent (‘3’) or inconsistent (‘2’), depending on the result of the evaluation of all validations. As soon as any validation returns a failed key, the status is inconsistent, otherwise it is consistent.

Any modification of the draft instance which happens after the execution of PREPARATION would reset the conistency status to pending (‘1’).

Action ACTIVATION evaluates the DRAFTENTITYCONSISTENCYSTATUS and fails if it is not found to be consistent.

Btw.: failed validations are expected to send a message of lifetime state. Failing to do so will leave the user without a clue why the activation fails.

0 Kudos

Thank you for the response.

Only ACTIVATION action is visible in the network trace.Should I include any annotation in CDS to trigger PREPARATION action?

ivo_vollrath
Active Participant

There is no CDS annotation for this purpose. Every Draft-enabled UI must follow this pattern. If your UI does not send a separate PREPARATION request it may either be out-dated or faulty. I can only speak for the backend perspective. Maybe someone else can comment on the UI part…

But when I think about it again, I am not really sure if the missing PREPARATION is the reason for the error you reported: usually the ACTIVATION action should implicitly call PREPARATION in case it has not been called before. Maybe this does not work reliably. What is your SAP_BASIS release, by the way?

0 Kudos

Thanks for the quick response.

SAP_BASIS - 751 SP level -0002.

Can you please tell whether it is possible to call PREPARATION action through custom code in BOPF?

ivo_vollrath
Active Participant
0 Kudos

Calling PREPARATION from within your BO implementation is generally possible but would not make much sense in your scenario. There is no point-in-time which would be suitable.

Does your BO contain validations? If any validation returns a failed key (check with the debugger), this would explain the error message you observe.