Posts

Pass default values - factory action in RAP

Image
                                                  Refer -   Factory action (copy records) in RAP Steps to pass default values. Step 1:   Change behavior definition of header interface view. managed implementation in class zbp_iv_ab_hdr_stu13 unique; strict ( 2 ); with draft; define behavior for ZIV_AB_HDR_STU13 alias Student persistent table ztl_ab_hdr_stu13 draft table ztl_ab_hdr_dra13 lock master total etag LastChDate authorization master ( instance ) etag master LastChDate { create ( authorization : global ); update; delete; field ( numbering : managed, readonly ) StuId ; association _attach { create; with draft; } draft action Activate ; draft action Discard ; draft action Edit ; draft action Resume ; draft determine action Prepare ; factory action ...

Factory action (copy records) in RAP

Image
 A factory action in RAP: Creates a new instance (record) based on logic you define. Can take input parameters if needed.   Returns the created entity ( result [1] $self ). This is perfect for:      Copying an existing record with some fields duplicated.      Initializing a draft for editing. Aspect Instance-Bound Factory Action Static Factory Action Binding Bound to an existing BO instance Not bound to any instance Purpose Copy existing instance(s) Create new instance(s) with default values Triggering Context Triggered from a selected instance Triggered from BO list page or toolbar Annotation Syntax factory action static factory action Example Declaration factory action copy_instance result [*] MyBO; static factory action new_instance result [1] MyBO...