cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Instance Push Function Module

Former Member
0 Kudos

All,

I am referring to the service order tutorial as given in following link http://help.sap.com/saphelp_nwmobile71/helpdata/en/45/ac4bed74372733e10000000a155369/frameset.htm

I have succefully created the Data Object/BAPI Wrappers and other objects. Everything works perfectly fine. Now I am trying to create a "Intance PUSH" function module in Mobile Server that will be called from backend to push the service orders. Till now using the same structure as in the tutorial I can send PUSH one instance. However I was wondering what if I have to PUSH Multiple instance at one shot.

I am confused as to how should the structures for the same should look like. In the example given here, the customer node and equipment node do not have the order ID parameter in it. So when I have to push the same, how will the system know which instance of customer/equipment belongs to which instance of orderheader.

If any one can clarify the same it will be really great.

Regards,

Shubham

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If I get you correctly:

You want to push, say Orders O1 and O2 in one shot. The data pushed will look something like:


Root Node Keys:
O1
O2

Child Node (Customer) Keys:
C1 (belongs to O1)
C2 (belongs to O2)
C3 (belongs to O2)

Now, your question is:

How will the DOE know which item in the customer node belongs to which Order?

So if you think about it.. actually, the association does not even come into the picture here. Even within the data object, we cannot figure this out (only in the case of instance push).

To solve this: I suggest you create a field in the child which helps the DOE resolve its parent (best way is to create a field with the same name and type as the backend key of the root, and then switch on automatic keymapping).

About the example itself: I'm not sure whether instance push is part of the example, and therefore taken care of (I didn't read it completely).

Edited by: Arjun Shankar on Oct 1, 2009 1:17 PM

Former Member
0 Kudos

Thanks Ramanath & Arjun.

Yes indeed the problem is what described by Arjun with example.

Arjun, I am not sure if you have seen the node structure for a Child that is generated by the DOE. It automatically adds the backend key for parent node in the child. But the intance push function module generated by the DOE does not have this paramter in the child node. It only takes the parameter defined by us in the Node Attributes of the child node.

Hence my main confusion lies in the fact that has DOE Instance PUSH been designed to handle multiple orders in same push or I can push only single order. Also if it supports multiple instance push, what is the best way to do the same

Regards,

Shubham

Former Member
0 Kudos

The backend key added by the DOE is a 'generated' field (and therefore internal to the DOE). This is why it is not exposed in the instance push FM.

When you do not switch on automatic keymapping, the DOE creates this generated field, and fills it after calling GetDetail in the case of a delta download or a key push (since getdetail itself is called per instance, resolution is simple).

If you switch on automatic keymapping, DOE will try to find existing backend fields in the child which match the root keys. (i.e. by name and type), and use these to resolve the children. If it cannot find such fields in the child that match the root keys, it will again generate fields on its own. And again these generated fields will be filled by the DOE after calling GetDetail during a delta load or key push.

However, in the case of Instance Push, the only way to let the DOE resolve child instances is to send a field from the backend itself (i.e. not generated), which can be used to resolve the child instances (because GetDetail is not called in this case)

If you do multiple instance push with the example given without changes, I am not sure if resolution will happen.

An alternative to automatic keymapping is 'explicit keymapping' where you yourself decide which backend field in the child maps to which backend KEY in the parent (at all levels).

Edited by: Arjun Shankar on Oct 1, 2009 1:36 PM

Former Member
0 Kudos

Hi,

Adding to what Arjun said, its not recommended to use Instance push Function module to push multiple instances unless you have used explicit key mapping(i.e. Mapping your header field with any of the backend item field). So if you dont have explicit mapping(i.e. DOE has generated the key mapping field in item node) , then you can't push multiple instances in a single instance push FM call.

Regards,

Dhana

Former Member
0 Kudos

Thanks a lot for detailed description

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The Order instance has the reference to the necessary equipment_id and customer_id. So while pushing the instances of EQUIPMENT or CUSTOMER data object, you need not mention the corresponding order_id.

As these data objects are associated, DOE will take care of finding the corresponding Order_id.

Regards,

Ramanath.