cancel
Showing results for 
Search instead for 
Did you mean: 

Searching for class or method to add mobile components programatically

Former Member
0 Kudos

Hello,

I'm searching for a class and/or a method to add a mobile component and version to a mobile device programatically.

Furthermore I would like to know in which datbase-table I can find

a) The roles and their mobile components

b) The installed components of the registered devices.

I Hope you can help me with this issue.

Best regards.

Lars

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi This is very similar to the user assignment..However use | as a separator between MCD name and version..

1. Use CL_RECEIVER_STORE_FACTORY=>GET_RECEIVER_STORE method to get the RMM object.

Parameters should be RMM = 'EB5C714339AA644CE10000000A15539D'

RMM_NAME = 'RMM_NAME'.

2. Set the mcd attributes:

DATA: attributes TYPE smmw_av_pair_t,

attribute TYPE smmw_av_pair_st.

clear attribute.

attribute-name = 'MCDNAME_VERSION'. "Don't change this attribute

attribute-operator = 'EQ'.

attribute-value = <mcdname|version>. "Replace this the mcd name( | is the separator used)mcdversion".

APPEND attribute TO attributes.

clear attribute.

3. Set the attr values to the device.

    • rec_store is the object retrieved from step 1.

rec_store->set_device_attribute_value(

EXPORTING

attributes = attributes

id = device_id " Your device id.

commit_flag = 'X'

override_read_only = 'X'

EXCEPTIONS

set_device_attribute_failed = 1

OTHERS = 2

).

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

thanks for your responses. I think the answer of Shobha is very good. I've found a second solution for this problem.

1. Set the MCD-Attributes

DATA: mcd_name TYPE SMMW_MCDNAME,

mcd_ver TYPE SMMW_MCDVERSION.

CLEAR mcd.

mcd-MCDNAME = mcd_name.

mcd-VERSION = mcd_ver.

APPEND mcd TO mcds.

CLEAR mcd.

2. Call method

CALL METHOD CL_SMMW_DEV_ADM=>ASSIGN_MCD_TO_DEVICE

EXPORTING

RECEIVERID = 'Your receiver-ID'

MCDS = mcds

AUTO_FLAG = 'X'

  • INVOKE_RULE_EVALUATION = 'X'

IMPORTING

NON_AVAIL = NON_AVAIL

FAILED_MCDS = FAILED_MCDS

MESSAGE_RETURN = MESSAGE_RETURN

EXCEPTIONS

MCDNAME_VERSION_INCOMPLETE = 1

others = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

With the method of class CL_SMMW_DEV_ADM you can easily add MCDs to your device.

Thank you for your help.

Best regards.

Lars

Former Member
0 Kudos

HI,

well, to add it is not that difficult in MI7.1

If you compile the stuff, you end up with the SDA file for deployment. This contains the JAR file and as well a few XML files. If you place these XML files in the mobile device as well as the JAR, it will tell the middleware these files are new and will add them to the device in the monitor. As well the data will come down.

Hope this helps.

Regards,

Oliver