cancel
Showing results for 
Search instead for 
Did you mean: 

Query for Custom BO from Node 0..N is not working

dhruv_mehta
Active Contributor
0 Kudos

Dear all,

Below is the my BO Design.


businessobject Sy_Trade raises Msg1{

  [AlternativeKey] [Label("Trade Id")] element tradeid : BusinessTransactionDocumentID;

  [Label("Building Name")] element buildingidname : LANGUAGEINDEPENDENT_LONG_Name;

node RelatedOpportunities [0,n]{

  element BusinessTransactionDocumentReference : BusinessTransactionDocumentReference;

  element BusinessTransactionDocumentRelationshipRoleCode : BusinessTransactionDocumentRelationshipRoleCode;

     element defaultindicator : Indicator;

  association RelatedOpportunity[0,1] to Opportunity;

  action changedefaultMO;

  }

Now In an EC i want to fetch all instance of BO SY_TRADE by passing value in element   element BusinessTransactionDocumentReference ( UUID )

I am storing the UUID & ID of Oppotunity in this.

So I will assfin this EC in opportunity where i can see the ID and UUID coming by Navigation Binding but when i create a Query (Query by elements )

Please check below screen.

How can I fetch the instances of my BO by passing value from one of its node.

I don't think it should be impossible... I am getting Exception on Web ui after creating this Query.

Regards,

Dhruvin

Accepted Solutions (1)

Accepted Solutions (1)

dhruv_mehta
Active Contributor
0 Kudos

Binding

Former Member
0 Kudos

Hi Dhruvin,

since your Query works on teh RelatedOpportunities Subnode, you should bind the result list to RelatedOpportunities instead of Sy_Trade.

You can then navigate to your top object using ToRoot.

Alternatively, you can define your own custom query on Sy_Trade using the PDI where you can use the UUID-Field of the RelatedOpportunities as a source attribute.

I would design it this way.

Best regards,

Ludger

dhruv_mehta
Active Contributor
0 Kudos

Hi Ludger,

I binded to Sy_trade because I want all the instances of Sy_trade..

Can you please explain more about custom Query in PDI and using the same in UI designer??

Former Member
0 Kudos

Your Query returns instances of RelatedOpportunities, so your result list needs to be bound to RelatedOpportunities or else the dump you experience will occur.

The simple solution is:

1. Bind your data list to the RelatedOpportunities Node.

2. Create a Data structure below your result list

3. Bind this data structure to the ToRoot-Association of the RelatedOpportunities

4. Use and bind Data fields inside this ToRoot data structure as required - it contains the Root node and thus instances of Sy_trade.

the more complex solution:

1. Create a custom query on Sy_table containing the UUID-field of RelatedOpportunities as search parameter using the PDI. Detailed instructions can be found in the 1408 studio library, chapter 8.3.3.4 "Create a query".

2. Use your custom query in the UI Designer. Detailed instructions can be found in the 1408 studio library, chapter 9.4.3.10 "Configure a query"

Best regards,

Ludger

dhruv_mehta
Active Contributor
0 Kudos

Hi Ludger,

I think you mis understood me , I dont want to fetch Related Opportunities...

I have a BO : Sy_trade and each instances of that BO Can have N Opportunities...

So we have a link to Trade -- Opportunity and one opportunity can be there in multiple trade.

Now i am creating an EC to be shown in Opportunity where i can pass opportunity Id and Fetch the Trade....

I want to passs ID or uuid of Node Opportunity which has 0 to N cardinality and fetch trade against it...

For example you can see the all the Opportunity in the Account and if you check the Query they have used SADL Query on opportunity passing party id i think..

but my frustration is SADL query is not possible in EC...

Hence i do i fetch ALL TRADES instance based on its child node which have 0 to N cardinality

how can i do that?? i think your second option seems perfect i ll go through it...

Regards,

Dhruvin

Message was edited by: Dhruvin Mehta

dhruv_mehta
Active Contributor
0 Kudos

Hi Ludger,

By binding to Related opportunity and its parent worked!

Regards,

Dhruvin

Former Member
0 Kudos

That's exactly what I tried to say all the time.


Quote from one of my replies above:


Your Query returns instances of RelatedOpportunities, so your result list needs to be bound to RelatedOpportunities or else the dump you experience will occur.

Glad it works now.


Best regards,


Ludger

Answers (0)