Linkedin,youtube : harsha sap abap consultant [Link]
com/
CREATE DEEP ENTITY USING RAP:
HEADER TABLE:
ITEM TABLE
Linkedin,youtube : harsha sap abap consultant [Link]
ROOT ENTITY:
ITEM ENTITY:
HEADER PROJECTION VIEW:
@[Link]: #NOT_REQUIRED
@[Link]: 'pv for emp hdr'
@[Link]: true
define root view entity zpv_emp_hdr as projection on ZRE_EMP_HDR
{
Linkedin,youtube : harsha sap abap consultant [Link]
@[Link]: [{ purpose: #STANDARD,
type: #COLLECTION,
label: 'Employee Basic Details',
id: 'super'},
{ id : 'idHeader' ,
type: #LINEITEM_REFERENCE,
targetElement: '_item',
label: 'Employee Full Details' },
{ purpose: #STANDARD,
type: #IDENTIFICATION_REFERENCE,
label: 'Employee Information',
parentId: 'super',
position: 10 }]
@[Link]: [{ position: 10 }]
@[Link]: [{ position: 10 }]
key emp_id,
@[Link]: [{ position: 20 , label: 'First Name'}]
@[Link]: [{ position: 20 , label: 'First Name'}]
first_name,
@[Link]: [{ position: 30, label:'department' }]
@[Link]: [{ position: 30, label:'department' }]
department,
@[Link]: [{ position: 40, label: 'gender' }]
@[Link]: [{ position: 40 , label: 'gender'}]
gender,
/* Associations */
_item : redirected to composition child ZPV_EMP_ITM
}
ITEM PROJECTION VIEW:
@[Link]: #NOT_REQUIRED
@[Link]: 'PV FOR EMP ITM'
@[Link]: true
define view entity ZPV_EMP_ITM as projection on zemp_itemM
{
@[Link]: [{
purpose: #STANDARD,
position: 10,
label: 'Item',
type: #IDENTIFICATION_REFERENCE
}]
@[Link]: [{ position: 10 }]
@[Link]: [{ position: 10 }]
key EmpId,
Linkedin,youtube : harsha sap abap consultant [Link]
@[Link]: [{ position: 10, label: 'itemid' }]
@[Link]: [{ position: 10, label: 'itemid' }]
key ItemId,
@[Link]: [{ position: 10, label: 'itemtype' }]
@[Link]: [{ position: 10, label: 'itemtype' }]
ItemType,
@[Link]: [{ position: 10, label: 'item description' }]
@[Link]: [{ position: 10, label: 'item description' }]
ItemDesc,
@[Link]: [{ position: 10, label: 'status' }]
@[Link]: [{ position: 10, label: 'status' }]
Status,
@[Link]: [{ position: 10, label: 'remarks' }]
@[Link]: [{ position: 10, label: 'remarks' }]
Remarks,
/* Associations */
_header : redirected to parent zpv_emp_hdr
}
SERVICE DEFINITION:
SERVICE BINDING:
Linkedin,youtube : harsha sap abap consultant [Link]
BEHAVIOR DEFINITION:
managed implementation in class zbp_re_emp_hdr unique;
strict ( 2 );
define behavior for ZRE_EMP_HDR alias ehdr
persistent table zemp
lock master
authorization master ( instance )
//etag master <field_name>
{
create;
update;
delete;
association _item { create; }
mapping for zemp
{
emp_id = emp_id;
first_name = first_name;
department = department ;
gender = gender;
}
}
define behavior for zemp_itemM alias eitm
persistent table zemp_item
lock dependent by _header
authorization dependent by _header
//etag master <field_name>
{
update;
delete;
field ( readonly ) EmpId;
association _header;
mapping for zemp_item
{
EmpId = emp_id;
ItemId = item_id;
ItemType = item_type ;
ItemDesc = item_desc;
Status = status;
Remarks = Remarks;
}
}
PREVIEW:
Linkedin,youtube : harsha sap abap consultant [Link]
• Go back and click on create button.
Linkedin,youtube : harsha sap abap consultant [Link]
• Once we create header we allowed to create items as we
shown in above image.
• Click on create.
Linkedin,youtube : harsha sap abap consultant [Link]
• Employeeid will be auto populated , empid will be taken from
header which we created.
• If i want to change header and item once click on edit.
Linkedin,youtube : harsha sap abap consultant [Link]
Linkedin : [Link]
Whatsapp : +919848648781
Youtube : [Link]
Website : [Link]