Fehlender Datentyp BD11_FLAG

Rund um Java und SAP®.
1 Beitrag • Seite 1 von 1
1 Beitrag Seite 1 von 1

Fehlender Datentyp BD11_FLAG

Beitrag von ralff (ForumUser / 1 / 0 / 0 ) »
Hallo Forum,

Ich versuche mittels JCO 3.x ( Standalone ) IDocs an ein SAP System zu Übermitteln, zu Empfangen sowie den Status empfangener IDocs zu Ändern.
Während die ersten beiden Teile problemlos funktionieren scheitere ich leider am letzten Teil, der Status-Änderung.

Ich möchte hierzu IDOC_STATUS_WRITE_TO_DATABASE nutzen, der Versuch vom Repository eine Function bzw. ein FunctionTemplate zu erhalten scheitert allerdings.
Laut Doku sollte für den Fall, dass eine Function nicht gefunden werden kann eigentlich ein NULL-Wert zurückgeliefert werden.
In diesem Fall erhalte ich allerdings eine AbapException. Grund dafür ist, dass JCo wohl rekursiv die Metadaten sämtlicher Parameter abzuruft und letztendlich bei BD11_FLAG scheitert - siehe Stacktrace weiter unten.

Der Abruf anderer Funktionen funktioniert problemlos. Tatsächlich sind die beiden BD11_FLAG definierten Felder optional und ich bin mit den Default-Werten zufrieden komme aber leider mit dem Aufruf nicht weiter.

Ganz unten findet ihr einen minimalen Sourcecode um den Fehler zu reproduzieren.
Um den Code mit beliebigen Funktionen zu Testen sollte als erster Parameter "direct" ( es sei den Ihr arbeitet über ein lokales oder entferntes SAP Gateway ) und als zweiter ein beliebiger Funktionsname angegeben werden.

Bin gespannt auf eure Kommentare.

Besten Dank vorab,

Ralf

-------------------------------------------
com.sap.conn.jco.AbapException: (126) NOT_FOUND: NOT_FOUND Message 300 of class DA type E, Par[1]: BD11_FLAG
at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.execute(MiddlewareJavaRfc.java:2025)
at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1160)
at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:989)
at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:971)
at com.sap.conn.jco.rt.AbapRepository$DDICHelper.queryFunctionTemplate(AbapRepository.java:2026)
at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:1054)
at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:633)
at com.sap.conn.jco.rt.AbapRepository.getFunctionTemplate(AbapRepository.java:895)
at com.sap.conn.jco.rt.BasicRepository.getFunction(BasicRepository.java:167)
at ei.sap.jco.GetFunctionFailed.startUp(GetFunctionFailed.java:59)
at ei.sap.jco.GetFunctionFailed.main(GetFunctionFailed.java:48)
-------------------------------------------
package check.sap.jco;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoDestinationManager;
import com.sap.conn.jco.JCoException;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoRepository;

public class GetFunctionFailed {
private final String REMOTE_GATEWAY_GWHOST = "<REMOTE_SAP_HOST>";
private final String REMOTE_GATEWAY_PROGID = "<JCOREMOTE_PROGID>";
private final String REMOTE_GATEWAY_GWSERV= "sapgw00";
private final String REMOTE_GATEWAY_REPOSITORY= "does_not_matter";

private final String LOCAL_GATEWAY_GWHOST = "localhost";
private final String LOCAL_GATEWAY_PROGID = "<JCOLOCAL_PROGID>";
private final String LOCAL_GATEWAY_GWSERV= "sapgw33";
private final String LOCAL_GATEWAY_REPOSITORY= "does_not_matter";

private final String CLIENT_CLIENT = "800";
private final String CLIENT_SYSNR = "00";
private final String CLIENT_LANG = "en";
private final String CLIENT_USER = "<JCOUSER>";
private final String CLIENT_PASSWD = "<JCOPASSWORD>";
private final String CLIENT_ASHOST = "<REMOTE_SAP_HOST>";

public static void main(String[] args) throws JCoException {
GetFunctionFailed instance = new GetFunctionFailed();
instance.startUp(args);
}

private void startUp(String[] args) {
String connectionMode = args.length > 0 ? args[0] : "direct";
String functionModule = args.length > 1 ? args[1] : "IDOC_STATUS_WRITE_TO_DATABASE";
buildConnectionProperties(connectionMode);
try {
JCoDestination destination = JCoDestinationManager.getDestination(connectionMode);
destination.ping();
JCoRepository repository = destination.getRepository();
JCoFunction function = repository.getFunction(functionModule);
System.out.println(String.format("function %s retrieved", function.getName()));
} catch (Exception e) {
System.err.println(String.format("error occured:%n%s", e.getMessage()));
e.printStackTrace();
}

}

enum Type {
DestinationData, ServerData
};

private void buildConnectionProperties(String connectionMode) {
this.storeConnectionProperties("direct", buildConnectionProperties4Direct(Type.DestinationData));
this.storeConnectionProperties("local_gateway",
buildConnectionProperties4LocalGateway(Type.DestinationData));
this.storeConnectionProperties("remote_gateway",
buildConnectionProperties4RemoteGateway(Type.DestinationData));
}

private Properties buildConnectionProperties4RemoteGateway(Type type) {
Properties p = new Properties();
// SERVER
p.put("jco.server.connection_count", "1");
p.put("jco.server.gwhost", REMOTE_GATEWAY_GWHOST);
p.put("jco.server.progid", REMOTE_GATEWAY_PROGID);
p.put("jco.server.gwserv", REMOTE_GATEWAY_GWSERV);
p.put("jco.server.repository_destination", REMOTE_GATEWAY_REPOSITORY);
// CLIENT
p.put("jco.client.lang", CLIENT_LANG);
p.put("jco.destination.peak_limit", "10");
p.put("jco.client.client", CLIENT_CLIENT);
p.put("jco.client.sysnr", CLIENT_SYSNR);
p.put("jco.destination.pool_capacity", "3");
p.put("jco.client.ashost", CLIENT_ASHOST);
p.put("jco.client.user", CLIENT_USER);
p.put("jco.client.passwd", CLIENT_PASSWD);
// p.put("jco.client.type", "E");
//
return p;
}

private Properties buildConnectionProperties4LocalGateway(Type type) {
Properties p = new Properties();
// SERVER
p.put("jco.server.connection_count", "1");
p.put("jco.server.gwhost", LOCAL_GATEWAY_GWHOST);
p.put("jco.server.progid", LOCAL_GATEWAY_PROGID);
p.put("jco.server.gwserv", LOCAL_GATEWAY_GWSERV);
p.put("jco.server.repository_destination", LOCAL_GATEWAY_REPOSITORY);
// CLIENT
p.put("jco.client.lang", CLIENT_LANG);
p.put("jco.destination.peak_limit", "10");
p.put("jco.client.client", CLIENT_CLIENT);
p.put("jco.client.sysnr", CLIENT_SYSNR);
p.put("jco.destination.pool_capacity", "3");
p.put("jco.client.ashost", CLIENT_ASHOST);
p.put("jco.client.user", CLIENT_USER);
p.put("jco.client.passwd", CLIENT_PASSWD);
// p.put("jco.client.type", "E");
//
return p;
}


private Properties buildConnectionProperties4Direct(Type type) {
Properties p = new Properties();
p.put("jco.client.lang", "en");
p.put("jco.destination.peak_limit", "10");
p.put("jco.client.client", CLIENT_CLIENT);
p.put("jco.client.sysnr", CLIENT_SYSNR);
p.put("jco.destination.pool_capacity", "3");
p.put("jco.client.ashost", CLIENT_ASHOST);
p.put("jco.client.user", CLIENT_USER);
p.put("jco.client.passwd", CLIENT_PASSWD);
//
return p;
}

private void storeConnectionProperties(String connectionMode, Properties p) {
try {
p.store(new FileWriter(String.format("%s.jcoDestination", connectionMode)), "connection parameters");
} catch (IOException e) {
System.err.println(String.format("error occured:%n%s", e.getMessage()));
e.printStackTrace();
}
}
}

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Seite 1 von 1

Vergleichbare Themen

0
Antw.
1164
Views
Fehlender Remodellierungsjob im Zielsystem
von martin_S. » 25.09.2023 14:55 • Verfasst in Human Resources
1
Antw.
4868
Views
JCO Server, fehlender Typ com.sap.jdsr...
von codierknecht » 08.02.2008 10:17 • Verfasst in Java & SAP®
0
Antw.
471
Views
WF - 'fehlender' Parameter in BO-Methode
von bapimueller » 26.03.2019 11:02 • Verfasst in ABAP® Core
0
Antw.
1164
Views
Flag für Tabellenumsetzung
von Mr.Black » 28.03.2007 11:34 • Verfasst in SAP - Allgemeines

Über diesen Beitrag

ralff
Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Unbeantwortete Forenbeiträge

Zwischensumme Adobe Forms
vor 4 Tagen von Lucyalison 1 / 72
Group Items auf einer Filterbar
vor einer Woche von Bright4.5 1 / 111
tRFC Transaktionen SM58
vor 4 Wochen von A6272 1 / 141