cancel
Showing results for 
Search instead for 
Did you mean: 

MI 7.1: Query to get correct child objects for a parent

Former Member
0 Kudos

I have this problem for both PDA and Laptop apps.

We have created a Data object with ‘Customer’ as parent and ‘Email’ and ‘addresses’ as child to it. Customer will have basic customer info like his name, nationality etc. email and address will have zero or more emails and addresses of that customer.

In my application I have written a query to fetch all customers, display it in a table and upon selection of one customer I will fetch the customer id which is the key and will fire one more query with customer id as input which will fetch all his addresses and display it in another table.

Now look at this scenario: I create a new customer. Then I go on and create a new address for the same customer. The address will also have foreign key customer id as zero. Now I go on and create one more new customer. Now when I select any of there customers their id is zero (since i havent syncd). Hence my second query would fetch the same newly created address for both the customers since both of them have customer id as zero. Now there is a option for adding join in query in PDA app. I added the join like ‘address.psynckey = customer.synckeyMMW’ in my second query to fetch addresses apart from filter ‘address.customerid := custid’ where custid is input parameter. In laptop also I clicked on ‘add join condition by relation’ button which added to existing condition ‘AND (address.psynckey = customer.synckeyMMW)’. Now even after this it is not working correctly i.e. only the relevant childs for a parent record should come. Plz help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

well, I have a problem in understanding.... If I create an item locally on the device - it immediately has a SyncKEy - this is not empty! Furthermore when I select on the item, I have the Top item as select criteria - aswell at the create process. I need the TOP item to create a child item.

Do you have a chance to look into any SAP standard app to get an idea how they do it? The ITEMMANAGER should handle the requested create,delete,modify,select handling for TOp to child items - I think there is the issue.

Regards,

Oliver