Hi community,
I am implementing a demo RAP program which calls BAPI for creating accounting documents with unmanaged save. I am referring to the following blog post. We're on S/4HANA 2022 SPS00.
https://blogs.sap.com/2023/08/01/exposing-bapi-as-odata-api-using-rap-facade/
The accounting document has 3 key fields: company code, fiscal year and document number, and I want to set document number with late numbering, whereas other fields are to be supplied from the client.
CDS View definition:
define root view entity ZI_AccountDocHeader as select from I_JournalEntry
composition [0..*] of ZI_AccountDocItem as _Item
{
key CompanyCode,
key FiscalYear,
key AccountingDocument,
...
}
Behavior definition
managed implementation in claxx zbp_i_accountdocheader unique;
strict ( 2 );
define behavior for ZI_AccountDocHeader alias AccountDocHeader
with unmanaged save
late numbering
lock master
authorization master ( instance )
{
create;
update;
delete;
association _Item { create; }
field ( readonly ) AccountingDocument, AddountingDocCreatedByUser;
field ( readonly : update ) CompanyCode, FiscalYear,
field ( mandatory : create ) CompanyCode, FiscalYear,
}
...
When I publish the service binding and call the OData service from Postman, I can supply company code and fiscal year. However, if I use EML to create an entity, ADT shows the following error:
The field "FISCALYEAR" of entity "ZI_ACCOUNTDOCHEADER" cannot be modified.


Is there any way I can fill these fields using EML? Or is this the limitation of current S/4HANA release?
Best regards,
Mio Yasutake