on 03-26-2024 10:32 AM
I am working on RAP framework and i implemented the table "I_MaintenanceNotification" on CDS view.
But i got a problem after creating the notification, i got a wrong primary key "300000111" on the result page, and the other elements are empty, but if i go to the homepage i could see my data that i filled it.
I just used the "late numbering" on the "Behavior Definition" so i could get a unique primary key, here's what i did on the "Behavior Definition":
managed implementation in class zbp_i_notification_k unique;
strict ( 2 );
with draft;
define behavior for ZR_NOTIFICATION_KTP alias Notification
with unmanaged save
draft table ZNotificationD
etag master Notification
lock master total etag Notification
late numbering
authorization master ( global )
{
field (readonly) Notification;
create;
update;
delete;
draft action Edit;
draft action Activate;
draft action Discard;
draft action Resume;
draft determine action Prepare;
// the rest of mapping
}
and here's what i did on method "adjust_numbers" in "Behavior Implementation":
METHOD adjust_numbers.
READ ENTITIES OF zr_notification_ktp
ENTITY Notification
ALL FIELDS WITH CORRESPONDING #( mapped-notification )
RESULT DATA(Notifications2)
FAILED DATA(failed).
SELECT MAX( Notification )
FROM zr_notification_ktp
INTO @DATA(lv_max).
DATA(lv_new_key) = lv_max + 1.
LOOP AT mapped-notification REFERENCE INTO DATA(map).
map->Notification = lv_new_key.
ENDLOOP.
ENDMETHOD.
did i missed something?
thanks
User | Count |
---|---|
76 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.