cancel
Showing results for 
Search instead for 
Did you mean: 

OBN navigation form employee.bo to custom BO

former_member689468
Participant
0 Kudos

Hello all,

I am trying to extend the Employee.bo to add more data that is needed for some specific calculations like payrols etc.

Employee.bo is different than other standard objects I have experimented with, and I guess its because it is in Foundation deployment unit.

My first try was to add a tab with embeded component in the ViewSwitchNavigation but that is not possible here like it is with most other standard business obejcts, the option is just not displayed like with other objects.

So I decided to create a custom BO that would act as a custom extension object for the standard Employee object and an OBN button/link from the Employee to my custom BO.

Again I have issues trying to connect instances of my custom BO with the standard BO because I dont have any parameters to select when creating the OBN on the standard screens of Employee.bo.

What I did was to follow this blog : https://blogs.sap.com/2017/11/02/step-by-step-to-create-obn-button-which-navigates-from-standard-ui-...

this video: https://www.youtube.com/watch?v=bhjPsXnGWNw

and a couple more community questions, but the issue that bothers me is that when I go to extensibility explorer and add an OBN button there are no parameters to select

Here I select my operation to edit from the standard .PTP that was generated automaticaly in cloud applciation studio.

After that I try to bind parameters but no data fields are offered for selection, and this is where I am stuck. I am trying to get employee UUID, or employee ID to my custom BO and then fire an event handler that would read the instance of my custom object that I need for editing additional data

Why can I only select ROOT here ? And is there any way to make it work with root ?

I understand that Foundation objects behave differently, but if there is a limitation for them that I cant add embeded components or OBN buttons, what are some other options to fulfill this requirement ?

Thanks,

Josip

Accepted Solutions (1)

Accepted Solutions (1)

former_member689468
Participant

After what feels like 5 days banging my head against the wall I randomly got it to work.

These were the steps:

1. Edited the PTP that was automatically created when I automaticaly generated screens and navigation in studio, I added another node with 1 parameter

2. Added an extension field to Employee.bo, and then added that extension field to the same group where I wanted to add my OBN button

3. After I added the extension field then that extension field was offered as parameter for the OBN button. So I had to add after modify ABSL to fill the extension field with Employee.InternalID field.

4. Add OBN button in the same group where I added extension field. Type Button, havent tried link. Select the PTP that I edited, and as parameter select the only thing that I can which is my extension field that I added.

5. On my custom object create a new import that also uses the same PTP as used for the OBN. Add one data field (Inport_field) to data model under /Root and bind that new data field to inport parameter.

6. Under properties make the auto fire true and create a new event handler

7. In the new event handler select BO Operation Read, add 1 parameter which binds the /Root/Inport_field to my /Root/Employee_HR/EmployeeID

Here I guess was the most important part. I had to add the Alternative Key of my custom object to the data model, and then bind the inport parameter to that specific data element in the event handler for object read.

After this it finally worked, and it looks like it was only a couple of small details.

Answers (0)