cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in ABAP API - NiRawReadError: error when reading data from socket

Former Member
0 Kudos

Hello everybody,

I am trying to access my MDM5.5 SP04 server using ABAP API.

While connecting server it is giving me error that NiRawReadError: An error occured when reading data from socket.

I am using MDM provider class CL_MDM_PROVIDER_55_SP04_PL03.

Could anybody tell me what is this socket err & how do I solve it??

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You have to write IP address of R/3 server in the allow.ip file.

You also need to maintain deny .ip file (may it be blank). These files have to be placed on your mdm server at the location where you have your mds.ini file. Provider type

CL_MDM_PROVIDER_55_SP04_PL03 will be compatible with MDM SP 04 on patch 03. Please confirm it from your basis guys if you have patch 3 on your SP04 MDM server.

I hope that you are not making any mistake in saving your notepad file as ip file. Open a notepad file -> Type the IP address -> Save as -> File Type - All Files -> File Name - allow.ip -> Save.

Hope this is helpful.

Regards,

Dheeraj.

Edited by: Dheeraj Kumar on Jun 30, 2008 7:35 PM

Former Member
0 Kudos

Hi Dheeraj & Andreas,

Thanks for reply. The error "NiRawReadError: An error occured when reading data from socket." get removed when I placed my R3 ip in allow.ip file, but it is giving me another err of "Inconsistency in configuration. Check server,DBMS, type repository".

I have checked my configuration, I have given proper repository name, select proper database type (in my case Oracle & port 20005) MDM provider class,MDM server ip. Included R3 user in Material repository. Still, I not getting why err is ocurring????

Former Member
0 Kudos

Hi Abhijeet,

Could you plz tell me at what point are you getting this error.

Plz check if in final step you have selected everything correct.

I have posted an article on this. You cn read this for details:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e03247a3-2f2a-2b10-4987-a2d8b2ce...

Hope this will help you.

Regards,

Dheeraj.

Former Member
0 Kudos

Hi Dheeraj,

Sorry for late reply.

We were reinstalling MDM server ( 5.5.60.67).

But still when i m tru=ying to execute following lines of code it gives

Inconsistency in configuration. Check server,DBMS, type repository

  • MDM ABAP OO API

data: lr_api type ref to cl_mdm_generic_api,

ls_language type mdm_cdt_language_code,

cx_exception type ref to cx_mdm_main_exception,

ls_client_sys type mdm_client_system_information,

lv_c_system_id type mdm_gdt_integervalue,

ls_cs_name type mdm_cdt_name.

try.

  • Constructor: set configuration ID (API_SAMPLE)

create object lr_api

exporting

iv_log_object_name = 'MATERIAL_SP06'.

ls_language-language = 'eng'.

ls_language-country = 'US'.

ls_language-region = 'USA'.

    • connect to repository *

error occuring while calling this function module

call method lr_api->mo_accessor->connect

exporting

is_repository_language = ls_language.

  • prepare new client system information

ls_client_sys-name = 'Sample_Client_System'.

  • create client system

call method lr_api->mo_admin->create_client_system

exporting

is_client_system_information = ls_client_sys

importing

ev_new_client_system_id = lv_c_system_id.

  • disconnect after work is done

call method lr_api->mo_accessor->disconnect.

  • handle exception

catch cx_mdm_usage_error into cx_exception.

catch cx_mdm_provider into cx_exception.

catch cx_mdm_kernel into cx_exception.

catch cx_mdm_server_rc_code into cx_exception.

catch cx_mdm_not_supported into cx_exception.

endtry.

if not cx_exception is initial.

message cx_exception type 'I'.

endif.

It catches the cx_mdm_usage_error exception

Former Member
0 Kudos

Hi Abhijeet,

Add this part to code:

lv_log_object_name = ''MATERIAL_SP06''.

ls_config_info-dbms_host = 'NEW DBMS HOST'.

ls_config_info-dbms_type = 0.

This 0 is for oracle type DBMS.

Similarly, You can find code for your DBMS type from R/3 System.

ls_dbms_info-host_name = ls_config_info-dbms_host.

ls_dbms_info-db_type = ls_config_info-dbms_type.

EXPORTING

iv_log_object_name = lv_log_object_name

IMPORTING

ES_CONFIG_INFO = ls_config_info

Hope this is helpful.

Regards,

Dheeraj.

Former Member
0 Kudos

Hi Abhijeet,

Since you are getting an error with the configuration, Kindly check these 2 things.

1. You should have done the User Mapping in MDM. Create a user in MDM under the Users Table in Console which will have the same name as the Sy-Name of the R3 system. The login name of the R3 system and MDM User should match.

Also mention the correspongin pwd in the MDM user ( same to the pwd used for loging into R3 system) for ensuring an error- free connection.

2. please make sure that the User Name in MDM is in upper case as in R3 system, everything is in Upper case.

I think this will ensure that the connection is trusted between MDM and R3.

Also ensure that the Configs are proper in your MDM APIC config.

Hope it helps.

Thanks and Regards

Nitin Jain

Former Member
0 Kudos

Hi Dheeraj,

Could you plz tell me where should I add this code in above example??

when creating object

*CREATE OBJECT lr_api

or when connecting to repository

*CALL METHOD lr_api->mo_accessor->connect

Former Member
0 Kudos

Hi,

Inconsistency in configuration. Check server,DBMS, type repository

It catches the cx_mdm_usage_error exception

comes when there is Incorrect use of interface, for example, incorrect or insufficient input. Please take of giving inputs using Sinle quote's.

After done Settings using Transaction MDMAPIC

Firstly, you need to check have you Configured your Settings Properly or Not.For this when you download MDM ABAP APIs

HowTo_Guides 1 to 19 from Service Market Place.

Using Guide HowTo_07.pdf create new report using Se38 say ZMDMTracing and copy code from Appendix(Complete Coding)

using Guide HowTo_07.pdf. just change one parameter here as

lv_log_object_name = 'MATERIAL_SP06'. take care of single quote not double quote here. and after this just execute this Program using F8. the output will tell either your connection with MDM is establishing properly or not.

Similarly for the rest of functionalities using MDM ABAP APIs you can take help of these HowTo_Guides 1 to 19 which are self explainatory.

Hope it will Help you,

Rewards if Useful.....

Mandeep Saini

Former Member
0 Kudos

Hi Abhijeet,

When you make a connection to a server, in that function module you have to specify the host name and logical object name. You also have to provide DBMS login credentials.

Second thing, Every parameter you are passing shoud be in single quotes and in capital letters.

Actually I have not tried it in OO. But in simple function modules, it works fine.

Regards,

Dheeraj.

Former Member
0 Kudos

Hi Dheeraj,

I tried running followiing code (which is based on function module) from How_to_03 guide given by SAP.

report z_how_to_3.

data lv_log_object_name type mdm_log_object_name.

data ls_dbms_auth_inf type mdm_dbms_auth_info.

data ls_config_info type mdm_config_information.

data ls_dbms_info type mdm_dbms_info.

data lt_repositories type mdm_repository_info_table.

data ls_repository type mdm_repository_info.

data lt_mounted_reps type mdm_repository_tags.

data ls_mounted_rep type mdm_repository_tag.

data lt_running_reps type mdm_repository_tags.

data ls_running_rep type mdm_repository_tag.

data lv_errstr type string.

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

lv_log_object_name = 'MATERIAL_SP06'.

*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.

*fills dbms info structure

ls_dbms_auth_inf-dbms_user_name = 'mdmuser'.

ls_dbms_auth_inf-dbms_password = 'pass'.

*fill dbms information structure with necessary information

ls_dbms_info-host_name = ls_config_info-dbms_host.

ls_dbms_info-db_type = ls_config_info-dbms_type.

*gets all repositories managed by the MDM Server maintained in customizing under

*key lv_connection_name

*CALL FUNCTION 'MDM_ADMIN_RETRIEVE_ALL_REPS'

*

*EXPORTING

*iv_log_object_name = lv_log_object_name

*is_dbms_info = ls_dbms_info

*is_dbms_auth_information = ls_dbms_auth_inf

*IMPORTING

*et_repository_info = lt_repositories

*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: / 'Detected repositories:'.

*LOOP AT lt_repositories INTO ls_repository.

*WRITE: / ls_repository-repository_name.

*ENDLOOP.

*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.

call function 'MDM_ADMIN_RETRIEVE_MNTED_REPS'

exporting

iv_log_object_name = lv_log_object_name

importing

et_repository_tag = lt_mounted_reps

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: /.

write: / 'Detected mounted repositories:'.

loop at lt_mounted_reps into ls_mounted_rep.

write: / ls_mounted_rep-repository_name.

endloop.

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.

call function 'MDM_ADMIN_RETRIEVE_RUNNG_REPS'

exporting

iv_log_object_name = lv_log_object_name

importing

et_repository_tag = lt_running_reps

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: /.

write: / 'Detected running repositories:'.

loop at lt_running_reps into ls_running_rep.

write: / ls_running_rep-repository_name.

endloop.

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.

In above code i could run MDM_ADMIN_RETRIEVE_MNTED_REPS & MDM_ADMIN_RETRIEVE_RUNNG_REPS function modules dispalying all my mounted repositories & running repo's on MDM server respectively, but while running MDM_ADMIN_RETRIEVE_ALL_REPS it gives me error that err DCNI_MSG_ErrInitDB. This is same err that occurs if u provide wrong username or pwd.

But i have given same user name & pwd which i use for creating repo manually through SAP MDM Console.

Since it can detect my mounted & runnnig repositories from MDM server, I dont think there is any err in configuration setting I did on my R/3 server.

Could u plz tell me wht Id & pwd u have used in ur program??

Former Member
0 Kudos

Hi Mandeep,

The code of How_To_07 , returned me same error that Inconsistency in configuration. Check server, DBMS, type Material repository

I ran How_To_03 in that i could run FM's MDM_ADMIN_RETRIEVE_MNTED_REPS & MDM_ADMIN_RETRIEVE_RUNNG_REPS, giving me all mounted & running repositories

but it fails while running MDM_ADMIN_RETRIEVE_MNTED_REPS.

Since it can detect my mounted & runnnig repositories from MDM server, I dont think there is any err in configuration setting I did on my R/3 server.

Could u plz tell me wht could be the possible err??

Former Member
0 Kudos

Hi Abhijeet,

Right click on the server in MDM console. Go to DBMS settings, provide a user name/pwd. If this is showing you the paths then this is correct and same user/pwd you have to provide in your code.

Regards,

Dheeraj.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

NiRaw2ConnectError: Socket coonection Caused means an Error mean :Partner not Reached(host:XX,YY.ZZ(IP ADRR), Service 2005)

For this,

1. Check have you created Allow.ip file having your R/3

system IP Address placed in your Server level folder.

2. If step 1 already done, Please Restart your MDM Server

3. Your Repository should be mounted and then try to

establish connection between your R/3 and MDM

4. Also, check in your MDMAPIC transaction you have

maintained Valid Repository Name, MDM Server IP under

Host Name,Default Port for MDM Server 20005. and lastly

MDM Provider as per your MDM Server compatible Version.

Note : Must Restart your MDM server.

Hope it will Help you,

Rewards if Useful......

Mandeep Saini

Former Member
0 Kudos

Hi Mandeep,

Do we need to insert ip adress of R3 server or client machine from which I am going to run program??

I think it is client machine.

Let it be, I have inserted IP adress of R3 server also in Allow.ip file, will restart the server & let u know..

Former Member
0 Kudos

You definitely have to insert the ip-address of the R/3 system into the allow.ip file.

The MDM server does not know anything at all about client machines.