Skip to Content
0
Former Member
Dec 05, 2011 at 01:37 PM

Problems with JCo 3.0.6 and a standard BAPI "BAPI_MATERIAL_DISPLAY"

106 Views

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