Hello,

Sign up to join our community!

Welcome Back,

Please sign in to your account!

Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

SAP EWM Help Latest Questions

  • 0
  • 0
DPM125

Why strict ( 2 ) is used in Behaviour definition

In SAP RAP (RESTful Application Programming Model), the strict ( 2 ) keyword in a behavior definition plays a crucial role in enforcing stricter syntax and semantics for RAP BO development.

define behavior for ZI_MY_VIEW
strict ( 2 )

strict ( 2 ) activates the strict mode version 2, which enforces stronger design-time checks and stricter rules to help ensure the RAP application is upgrade-stable, future-proof, and consistent.

What strict ( 2 ) Does

Here are the key restrictions/enforcements introduced by strict ( 2 ):

1. No Implicit Features

You must explicitly declare everything. RAP will not assume default behavior.

  • E.g., actions, fields, operations must be explicitly defined.

2. Field Control Must Be Explicit

Fields must be explicitly declared for update, mandatory, readonly, etc.

field ( update ) my_field;

3. No Implicit Save

There is no automatic save of changes — save logic must be handled explicitly in the implementation class.

4. Cleaner Contract

The behavior is more predictable, meaning the framework won’t “guess” developer intent. This leads to better maintainability.

5. Future Compatibility

SAP intends to make strict ( 2 ) the standard mode going forward. Using it now ensures you’re aligned with the long-term RAP roadmap.

Related Questions

Leave an answer

Leave an answer