cancel
Showing results for 
Search instead for 
Did you mean: 

C4C SDK: Fetching Data from STD BO to Embedded Component

chandansb
Active Contributor
0 Kudos

Hello Experts,

I have created my first Embedded Component on Contact TI screen and was able to fetch the Contact Internal ID into my element in my custom BO. However I am facing an issue while fetching the data from Contact BO using this incoming InternalID.

The Code that I have maintained in my AfterModify to fetch the Contact data fails since the value for the InternalID is not fetched until this code is executed. How to mitigate this situation? How can I fetch the data once the InternalID from Contact is brought into my custom BO?

Thanks in advance.

Regards,

Chandan

Accepted Solutions (0)

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Chandan,

You need an instance of your Custom BO with the Contact InternalID als Alternative Key for trigger a retrieve in the EC after it was called.

HTH,

   Horst

chandansb
Active Contributor
0 Kudos

Hello Horst,

Thanks for your reply.

I have already added the three Actions on the Event Handler-

1. BOOperation for Read

2. Condition for Creation of Instance and Write.

3. BOAction to call the custom logic to fetch data.

So I was expecting to have the Contact ID in step 2 above so that it will be available in BOAction.

Regards,

Chandan

former_member186648
Active Contributor
0 Kudos

Hi Chandan,

In BOOperation there is there is path mentioned in "Bind" with "Path" are you assigning this in the "Condition" step?

Thanks, Pradeep.

chandansb
Active Contributor
0 Kudos

Hello Pradeep,

Thanks for replying.

Under Condition, I am checking whether the Expression zcontactID is filled and under this I have also maintained Configure Condition to

1. Added BOOperation to Create BO instance.

2. DataOperation to Assign value from InPort to element on my custom BO.

Doing this I am getting the value from Contact TI into my EC, however the code to fetch further data from Contact fails since this value is filled in the element on Custom BO after the my ABSL code is executed.

I have my ABSL code in AfterModify while I have also tried adding BOAction as third Configure Condition to call my custom Action to fetch the data. But my debugger never stopped there.

Hope this gave good idea where I am stuck.

Regards,

Chandan

DALJEET
Participant
0 Kudos

Hi ,

1).Have you made sure your inport fires the above actions??

2). put a debugger on custom action and then check .

Please paste both the screen's.

Br'

Daljeet

chandansb
Active Contributor
0 Kudos

Hello Daljeet,

Thanks for replying.

As mentioned earlier, my debugger does not stop in my custom Action. So indeed I tried debugging by setting breakpoint.

Below is the screenshot for my BOAction configuration:

Regards,

Chandan

DALJEET
Participant
0 Kudos

Hi ,

Pls send the inport auto fire, and other configurations screen shots and also the read/create operation of BO screens.

Br'

Daljeet

former_member186648
Active Contributor
0 Kudos

Hi Chandan,

Check this:http://scn.sap.com/thread/3849703

chandansb
Active Contributor
0 Kudos

Hello Pradeep,

Thanks for providing me this helpful discussion. I have made some progress referring this. Now I am able to get the data from the standard BO into my custom BO, however seems like the data vanishes and error message is raised as "Business Partner ID missing."

Can you please help me point out what is missing? I can see the value getting assigned as expected while debugging my ABSL code. However at the end, nothing gets filled in the elements and so when the Save is triggered, I get the mentioned message. (Business Partner ID missing)

Regards,

Chandan

DALJEET
Participant
0 Kudos

Hi ,

This is a Binding error , please check some standard videos of how to bind the EC with action to a standard BO .

Either in the Read Or create Event or at the time when you bind the Outport of standd BO to the Inport of EC.

Br'

Daljeet

chandansb
Active Contributor
0 Kudos

Hello DALJEET SINGH KOHLI,

Thanks for the suggestion.

As I can see data fetched from Contact BO into my custom BO, I feel my binding is working as expected. I can see it is getting executed on my ABSL as per my requirement(Even on BeforeSave). However it is getting initialized.

So I am really not sure what is wrong here. Yes I have referred to Stefan Hagen's video to bind my EC to Standard Contact TI. Referring discussion that Pradeep provided, now I have also added another Operation as below screenshot:

Both the Operation are now creating the instance for my BO and assigning the InPort value to element on my Custom BO. Doing this, the values persists even in my BeforeSave but later vanishes!!

Regards,

Chandan

chandansb
Active Contributor
0 Kudos

It would be great help if you could elaborate if you meant something else to be checked instead.

Regards,

Chandan

DALJEET
Participant
0 Kudos

Hi ,

If you can check the bindings when you are creating the events for Instantiating the Standard B.O.

and check if something is missed or sometimes we even misplace the bindings.

Br'

Daljeet

former_member186648
Active Contributor
0 Kudos

Hi Chandan,

Did you create the message "Business Partner ID missing" in your custom BO?

chandansb
Active Contributor
0 Kudos

Hello Pradeep,

No I did not create this message in Custom. Seems to be some standard message.

Regards,

Chandan

chandansb
Active Contributor
0 Kudos

Pradeep,

I can also see that even if I try to hard code the values in my ABSL and try to Save them. It is throwing same error: "Business Partner is Missing".

Regards,

Chandan

DALJEET
Participant
0 Kudos

,

Can you paste all the bindings here please, because this for me seems to be a binding issue , and nothing else. OR

detach the EC , and then try again.

Br'

Daljeet

chandansb
Active Contributor
0 Kudos

Hello Daljeet,

The issue is solved. Everything that needs to be done is mentioned in the video that I referred from Stefan Hagen. Additionally I added the child node where I added my elements in my BO and bind it with ALP. (I was following wrong methodology )

Even the second Condition I added earlier is not required.

Regards,

Chandan