cancel
Showing results for 
Search instead for 
Did you mean: 

strange error while executing RFC through JCO

Former Member
0 Kudos

Hi

I am getting a strange error since last 2 days, which I could not able to debug. I hope anybody in this forum might have faced the same.

I am accessing a RFC through JCO from java code. I am getting the following error. The RFC is working fine while running through SAP GUI & threre is no data as 0,00 in the output as seen from GUI.

Any guess is appreciated.

Thanks

Ashutosh

<error>

com.sap.aii.proxy.framework.core.BaseProxyException: Unable to interpret 0,00 as a number., error key: RFC_ERROR_SYSTEM_FAILURE

at com.sap.aii.proxy.framework.core.AbstractProxy.send$(AbstractProxy.java:150)

at com.boc.r3.uk.DMProxy_PortType.z_Dm_Get_Chg_Shipto_Rfc(DMProxy_PortType.java:17)

at TestRFC.getChargesDetails(TestRFC.java:140)

at TestRFC.main(TestRFC.java:31)

</error>

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

>>>>This problem occures when I am providing a valid input to get some excepted data from TABLE type parameter<<<<<

This is "a issue of wrong format input value getting fed to fields like amount,number fields,data field" becasue this problem arises for a specific data input only.

So compare field wise the data sets for with this works and for which this give error. There must be some field which when gets no value or proper value assigned in the java side. Those fields may send dummy value like this to SAP import parameter where while executing in the background SAP throws the error.

The data set giving error might work with the function module when tested in SAP GUI. This is becasue SAP GUI does some basic Formatting of the data which doen't happen when the same function module is executed in the background through connectors.

Hope this helps you

Former Member
0 Kudos

Hi,

>>>>> com.sap.aii.proxy.framework.core.BaseProxyException: Unable to interpret 0,00 as a number., error key: RFC_ERROR_SYSTEM_FAILURE <<<<

Try to format the number removing the commas and then send as input to RFC and check. You can use the number formatting options by importing java.text.*

Hope this helps you

kishorg
Advisor
Advisor
0 Kudos

Hi Ashutosh,

let me know could you connect to the SAP System using JCO?.

usually this type of Exception(RFC_ERROR_SYSTEM_FAILURE) arise when the connection parameters u have given is not correct or some problem with the SAP system itself.

different types of jco Exceptions are explained in this link .just go through this. here have details of this type of jco exceptions.

http://help.sap.com/saphelp_nw04/helpdata/en/f6/daea401675752ae10000000a155106/content.htm

regards

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishor,

I don't think there is any problem with the connection, because I could execute different RFC using the same parameter and strangely I could even execute the same RFC with different input & getting some return message in the output parameter.

This problem occures when I am providing a valid input to get some excepted data from TABLE type parameter.

let me know if I am clear. Please find the code bellow

		Z_Dm_Get_Chg_Shipto_Rfc_Output output = null;
		JCO.Client client=null;
	
		try{
		client=JCO.createClient("nnn","xxx","xxx","EN","nnn.nnn.nnn.nnn","nn");
		client.connect();
		System.out.println("Connection is-->"+client.isValid());
		DMProxy_PortType proxtPort = new DMProxy_PortType();
		proxtPort.messageSpecifier.setJcoClient(client);
		Z_Dm_Get_Chg_Shipto_Rfc_Input input=new Z_Dm_Get_Chg_Shipto_Rfc_Input();
		input.setLoc_Kunnr("");
		input.setLoc_Parvw("");
		input.setLoc_Knuma("");
		input.setLoc_Zexistfl("");
		input.setLoc_Zquoteno("98");
		input.setLoc_Username("CHAKRAS");
		proxtPort.z_Dm_Get_Chg_Shipto_Rfc(input);

		output = proxtPort.z_Dm_Get_Chg_Shipto_Rfc(input);

		Zvdm_Rntl_Charge_ShiptoType_List rentalList=output.get_as_listInt_Rntl_Charges();
		Zvdm_Dlv_Charge_ShiptoType_List deliveryList = output.get_as_listInt_Dlv_Charges();
		Zvdm_Col_Charge_ShiptoType_List collectionList = output.get_as_listInt_Col_Charges();
		Zvdm_Res_Charge_ShiptoType_List responseList = output.get_as_listInt_Res_Charges();
		
		System.out.println("retun:"+output.get_as_listInt_Return().size());
		Bapiret2Type_List list=output.get_as_listInt_Return();
		for(int i=0;i<output.get_as_listInt_Return().size();i++){
			
			Bapiret2Type errorType=list.getBapiret2Type(i);
			System.out.println("errorType:"+errorType.getType()+": Messg:"+errorType.getMessage());
		}
		System.out.println("rentalList.size():"+rentalList.size());
		System.out.println("deliveryList.size():"+deliveryList.size());
		System.out.println("collectionList.size():"+collectionList.size());
		System.out.println("responseList.size():"+responseList.size());
		
		}catch (ApplicationFaultException e) {   
			System.out.println("ApplicationFaultException getAssistanceMessage:"+e.getAssistanceMessage());
		} catch (SystemFaultException e) { 
			System.out.println("SystemFaultException getStackTrace:"+e.getStackTrace()[1]+": 			
		}catch(Exception e){
			e.printStackTrace();
		}

regards,

Ashutosh

kishorg
Advisor
Advisor
0 Kudos

Hi Ashutosh Dash ,

actually i think there is some data type conflict is there while setting the import parameters to this. i think when u leave some import params as "" , while executing this in the back end , fields corresponding to type N is filled with 0,00 .i think the same problem has been discussed in forum.

just go through this link.

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi,

not very nice but sometimes helpful is a trace of the input parameters.

As for example (please forgive any German comments, it's just a sniplet from out test source code)

		location.debugT("****************************** ImportParameter: ****************************** ");
		list = function.getImportParameterList();
		if (list != null)
		{
			anzTab = list.getFieldCount();
			table = null;
			struct = null;
			field = null;
			obj = null;
			for (int j = 0; j < anzTab; j++)
			{
				obj = list.getValue(j);
				if (obj instanceof JCO.Table)
				{
					table = list.getTable(j);
					if (table == null || table.isEmpty())
						location.debugT("Table ist leer: " + list.getField(j).getName());
					else
					{
						location.debugT("Table: " + list.getField(j).getName());
						boolean goOn = true;
						while (goOn)
						{
							JCO.FieldIterator fieldIt = table.fields();
							while (fieldIt.hasNextFields())
							{
								JCO.Field aField = fieldIt.nextField();
								location.debugT("Table: " + list.getField(j).getName() + " Row: " + table.getRow() + " Feld: " + aField.getName() + " --> " + aField.getValue());
							}
							goOn = table.nextRow();
						}
					}
				} else if (obj instanceof JCO.Structure)
				{
					struct = list.getStructure(j);
					if (struct == null)
						location.debugT("Structure ist leer: " + list.getField(j).getName());
					else
					{
						location.debugT("Structure: " + list.getField(j).getName());
						JCO.FieldIterator fieldIt = struct.fields();
						while (fieldIt.hasNextFields())
						{
							JCO.Field aField = fieldIt.nextField();
							location.debugT("Structure: " + list.getField(j).getName() + " Feld: " + aField.getName() + " --> " + aField.getValue());
						}
					}
				} else if (obj instanceof JCO.Field)
				{
					field = list.getField(j);
					if (field == null)
						location.debugT("Feld ist leer: " + field);
					else
					{
						location.debugT("Feld: " + field.getName() + " --> " + field.getValue());
					}
				} else if (obj instanceof String)
				{
					str = list.getString(j);

					if (str == null)
						location.debugT("String " + list.getName(j) + " ist leer: " + str);
					else
					{
						location.debugT("Str: " + list.getName(j) + " --> " + str);
					}
				} else
				{
					location.debugT("Unbekannter Typ: " + obj.getClass().getName());
				}
			} //end for

That might help you to find your 0,00 value.

Regards, Astrid