cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with JCo 3.0.6 and a standard BAPI "BAPI_MATERIAL_DISPLAY"

Former Member
0 Kudos

Hi JCo-Experts,

i'am to the JCo-subject, so maybe you can help me. I wanted information about a material, thats on our system with

the standard bapi "BAPI_MATERIAL_DISPLAY" via JCo but i get the message that the material does not exist(yes it does!!!) but it is not activated...

Here is my code:


	static String SAP = "SAP_SERVER";
	public void checkConnection() {
		SapSystem system = new SapSystem("LoginData"); 
		Connection connect = new Connection(system);

		JCoFunction function = connect.getFunction("BAPI_MATERIAL_DISPLAY");

		parameterListeAusgeben(function);//Method for printing import an exportparameters
		setParameterforImport(function);
		connect.execute(function);
		
		JCoStructure returnStructure; 
		returnStructure = function.getExportParameterList().getStructure( "RETURN" );
		System.out.println(returnStructure);
	}	
	private static void parameterListeAusgeben(JCoFunction im_function){
	JCoFunction function = im_function;
	//Ausgabe aller Parameter eines Funktionsbausteins
		System.out.println("Importparameter:");
		System.out.println(function.getImportParameterList());
		System.out.println("Exportparameter:");
		System.out.println(function.getExportParameterList());

}
	private static void setParameterforImport(JCoFunction im_function){
		JCoFunction function = im_function;
		function.getImportParameterList().setValue("MATERIAL","1000");

	}
}

Best regards

Maximilian Ulrich

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Maximilian Ulrich,

I don't think there is something wrong with your code. But I see that you pass the value 1000 as the matnr.

If you look in the system (table mara) you'll probably find that the stored matnr is actually: 000000000000001000

regards Jeroen

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jeroen Bijvank,

thanks alot for your post! It solved the problem!

Best regards

Maximilian