cancel
Showing results for 
Search instead for 
Did you mean: 

Identify Device Name at runtime

Former Member
0 Kudos

Dear SAP Mobile Experts,

Is there a way to identify the Device Name (from device information) while running a mobile application?

For example, one of the fields of a data object is PDA_ID. The only source of this info is the Device Name which can be found at the Device Information of the mobile client. If it is required to automatically read the Device Name and put into the PDA_ID field of the data object, what is the best way to do it?

Your inputs will be greatly appreciated.

Thanks in advance.

Regards,

Robert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If your business case requires device information of the device in which the data was created and uploaded , then you can use the 'default values' option in backend adapter.

Double click on backend adapter , goto "default values" tab

Choose the bapiwrapper 'create' / 'modify' and then map the dataobject field that holds the deviceid to 'data object communication header' --> device_id.

With this, the data object field for holding device id will be be filled before sending to BE with out any extra coding.

But here you will get only device_id information and if you are very particular about device name, then you can achieve the same with a custom service plugged in the flow by queriying device inventory to get the corresponding device name.

Regards,

Liji

Former Member
0 Kudos

Hi Liji,

Thank you for your inputs.

I'm trying to edit the default values but encounter a problem. The list of parameter fields only displays the first 9 fields of the chosen parameter in alphabetical order. The field that I want to map is further down the list. The vertical scroll bar does not appear so I could not go into the field that I want to map.

Have you, or anyone found a solution or workaround for this?

I am trying to look for an OSS note but could not find one relating to the parameter list problem.

Regards,

Robert

Former Member
0 Kudos

Hi Liji,

You mentioned from your last reply:

"But here you will get only device_id information and if you are very particular about device name, then you can achieve the same with a custom service plugged in the flow by queriying device inventory to get the corresponding device name."

How do we query the device inventory? Should this be a custom operation added to the service component? Or somewhere else? It would be great if you can give an example.

Thanks and regards,

Robert

sivasatyaprasad_yerra
Active Contributor
0 Kudos

Hi Robert,

You can use function module GET_DEVICE_NAME to get the device name for a given device id.

NAME property of the return structure will have device name.

You can go through following link for better understanding on [custom services|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0d258e4-3480-2c10-8ebc-853c3e787d90].

Regards,

Siva.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If you are unable to scroll down, please raise an OSS message.

For time being, if possible, change the field name in the backend such that it appears with in the first 8 fields and re-import to the DOE then do the mapping.

Thanks and Regards,

Suma

Edited by: Suma S on Jul 26, 2010 1:19 PM

anesh_kumar
Active Participant
0 Kudos

Instead of using 'data object communication header' in the above said scenario

you can use device attributes to get the device name directly

hope this solves your issue

Regards

Former Member
0 Kudos

Hi Robert,

The DOE will automatically be aware of the mobile client device from which the data is being uploaded (via the sync protocol).

So, can you please tell why you want to put the device id into a data object field from the mobile client?

Regards,

Ram

Former Member
0 Kudos

Hi Ram,

Thanks for your reply.

Backend R/3 wants to capture the PDA_ID. Not only at the DOE level. So I want to include it in the data object. Any idea how to do this?

Regards,

Robert

former_member206242
Active Participant
0 Kudos

This information is not exposed at Runtime of Mobile Application.

Buty you can enter the information as some context attribute bound to a UI and map the attribute to data object field n save . But there is no way to do this in DOE .. anything like this will be done thru application logic according to the use case.

Regards,

Nipun