on 12-05-2011 1:37 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeroen Bijvank,
thanks alot for your post! It solved the problem!
Best regards
Maximilian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.