cancel
Showing results for 
Search instead for 
Did you mean: 

APIs

Former Member
0 Kudos

Hi SDners

We have a user which logins through APIs to MDM and after performing some task it terminates the session. But after that if I unload my repository, it shows 1 user currently logged on even though there is no one who is accessing that repository. Are there any settings which we are missing out.

Thanks & Regards

Dilmit Chadha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dilmit,

The message "1 user currently logged on" even though there is no one who is accessing that repository comes because

1.You have looged in using API's

Function *MDM_ACCESSOR_CONNECT*

2.And loaded the repository with the function

*MDM_ADMIN_LOAD_REPOSITORY*

3.Now at the end you should call dissconnect method to disconnect the user which is connected form R\3 using API

*MDM_ACCESSOR_DISCONNECT*

Example

*Logical connection name for all operations (maintained in customizing)

lv_log_object_name = 'CONNECTION'.

*gets config object from customizing

CALL FUNCTION 'MDM_CONF_GET_SINGLE_API_CONFIG'

EXPORTING

iv_log_object_name = lv_log_object_name

IMPORTING

es_config_info = ls_config_info

EXCEPTIONS

ex_api_usage_error = 1

ex_provider_error = 2

ex_kernel_error = 3

ex_server_rc_code = 4

ex_not_supported = 5

OTHERS = 6.

IF sy-subrc = 0.

WRITE: / 'Successfully got configuration ', lv_log_object_name.

ELSE.

WRITE: / 'Error during MDM_CONF_GET_SINGLE_API_CONFIG: ', sy-subrc.

EXIT.

ENDIF.

*

*

    • language information

ls_repository_language-language = 'eng'.

ls_repository_language-country = 'US'.

**no region information needed here

**maintain logon

ls_repository_language-region = 'USA'.

*

**connect to newly created repository

CALL FUNCTION 'MDM_ACCESSOR_CONNECT'

EXPORTING

is_repository_language = ls_repository_language

iv_log_object_name = lv_log_object_name

EXCEPTIONS

ex_api_usage_error = 1

ex_provider_error = 2

ex_kernel_error = 3

ex_server_rc_code = 4

ex_not_supported = 5

OTHERS = 6.

IF sy-subrc = 0

OR sy-subrc = 4.

WRITE: / 'Successfully connected to repository using logical connection ',

lv_log_object_name.

ELSE.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_errstr.

WRITE: / lv_errstr.

EXIT.

ENDIF.

**

**

**disconnect from repository

CALL FUNCTION 'MDM_ACCESSOR_DISCONNECT'

EXPORTING

iv_log_object_name = lv_log_object_name

EXCEPTIONS

ex_api_usage_error = 1

ex_provider_error = 2

ex_kernel_error = 3

ex_server_rc_code = 4

ex_not_supported = 5

OTHERS = 6.

IF sy-subrc = 0.

WRITE: / 'Successfully disconnected connection ', lv_log_object_name.

ELSE.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_errstr.

WRITE: / lv_errstr.

EXIT.

ENDIF.

this will be the output.

03.03.2008 Connection to Test_Vendor 1

-


Successfully got configuration CONNECTION

Successfully connected to repository using logical connection CONNECTION

Successfully disconnected connection CONNECTION

Please follow the instructions I hope your problem will be solved.

reward points if helpfull.

Regards,

Vinay Yadav

Edited by: Vinay Yadav on Mar 4, 2008 8:31 AM

Edited by: Vinay Yadav on Mar 4, 2008 8:33 AM

Edited by: Vinay Yadav on Mar 4, 2008 8:34 AM

Answers (3)

Answers (3)

Former Member
0 Kudos

Dilmit,

You can check it using Console tool manually means without APIs and what i wrote say if you unload the repository it does not mean your connection to repository is lost, not even from the MDM server. So you are the only user who is login.

And also Dipankar cleared it in APIs prospective.

BR,

Alok

Former Member
0 Kudos

Hi Dilmit,

The problem that you are talking about is causing because the R/3 is still connected to the mdm server through API's.

Check the API code. The API should call a disconnect code at the end of the code to get disconnected from the server.If that is not execited and u unload the repository from MDM than this error will prevail.

*load repository

CALL FUNCTION 'MDM_ADMIN_LOAD_REPOSITORY'

EXPORTING

iv_wait_for_load = 'X'

iv_log_object_name = lv_log_object_name

EXCEPTIONS

ex_api_usage_error = 1

ex_provider_error = 2

ex_kernel_error = 3

ex_server_rc_code = 4

ex_not_supported = 5

OTHERS = 6.

IF sy-subrc = 0.

WRITE: / 'Successfully loaded repository on connection ', lv_log_object_name.

- 10 -

ELSE.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_errstr.

WRITE: / lv_errstr.

EXIT.

ENDIF.

*disconnect from repository

CALL FUNCTION 'MDM_ACCESSOR_DISCONNECT'

EXPORTING

iv_log_object_name = lv_log_object_name

EXCEPTIONS

ex_api_usage_error = 1

ex_provider_error = 2

ex_kernel_error = 3

ex_server_rc_code = 4

ex_not_supported = 5

OTHERS = 6.

IF sy-subrc = 0.

WRITE: / 'Successfully disconnected connection ', lv_log_object_name.

ELSE.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_errstr.

WRITE: / lv_errstr.

EXIT.

ENDIF.

Thanks n Regards

Deep..

Please reward points if u find this blog helpful.

Former Member
0 Kudos

Hi Deepu, Vinay,

Thanks for your reply. we are disconnecting the R/3 system with the the help of API but we are getting the same error. But this is true with for only one user. Other users which are disconnecting with APIs are not seen. All the users who are using APIs have admin rights. Is it so that I should have some other role for API users.

Please help if somebody has faced such a problem

Thanks & Regards

Dilmit Chadha

Former Member
0 Kudos

Hi Dilmit,

If I am correct you are trying to connect/disconnect to MDM through SAP R3 through ABAP API's.

As you are facing some user related issues, please check whether you have done the user mapping in MDM and SAPR3.

i.e All the users which are trying to access MDM from SAPR3 should be also present in MDM under Admin->users with a defined role.

Hence whatever role you will provide for that particular user in MDM, the user will be able to perform those activites in SAPR3.

Hope it helps.

Thanks and Regards

Nitin Jain

Former Member
0 Kudos

Hi Nitin,

Thanks for your reply. As mentioned earlier all the user who are accessing MDM through APIs have Admin role assigned to them. Is it that I should have different role assigned to API users.

Thanks & Regards

Dilmit Chadha

Former Member
0 Kudos

Hi Dilmit,

I dont think that your problem lies there. You can have multiple users and assign same role to those users.( In your case Admin role).

I feel that the problem lies in the program code that you are trying to execute. And also check whether the users in SAP R3 and MDM both are in same case( Upper/Lower/Sentence).

Also after disconnecting, check in the CONNECTIONS in the admin node in MDM, if you are able to see any user connected to MDM.

I hope it helps. Please revert if the problem still persists.

Thanks and Regards

Nitin jain

Former Member
0 Kudos

Dilmit,

Unloading repository does not mean disconnecting from repository. If you are seeing one user then this is you, who is login and unload the repository.

BR,

Alok