cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Default Values for Create in ABAP RESTful application development

kchatch1
Explorer
0 Kudos
868

Hello,

Using the ABAP RESTful approach (https://help.sap.com/docs/abap-cloud/abap-rap/abap-restful-application-programming-model) I have implemented an app using root entity CDS view, metadata extension, behavior definition, service definition, and service binding.  

Everything works fine, but I am unable to figure out how to implement DEFAULT values for fields when I click the CREATE button.  I have a local helper class that is handling auto numbering just fine (using class for getting a GUID) and it also populates values for fields ON CREATE execution using a determination.  But I also need DEFAULT values populated when I INITIALLY click CREATE.  

The approach of using "action" does not work ... it does not populate any values initially.  

 

Please provide the behavior definition entry as well as the class ABAP code for defaulting values. 

Thanks,

Kevin 

View Entire Topic
JessieCheah
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kevin,

if you are working on BTP ABAP Environment release 2311, you can use default values function to set default values for create, CBA, action and functions. Please refer to https://help.sap.com/docs/abap-cloud/abap-rap/operation-defaulting , there is also an example linked at the bottom of the page.

SAP S/4HANA Cloud, public edition will get this feature soon but OnPrem will take longer.

Regards,
Jessie

Archish
Newcomer
0 Kudos

OnPrem will be 2025 release? or there is a hope with any upcoming 2023 feature packs?

 

Regards,

Archish