SAP와 통합 할 시스템을 만들고 있습니다.SAP와의 통합
클라이언트가 나에게 함수와 매개 변수를주었습니다.이 함수는 대개 SAP에서 수행되었지만 매개 변수를 검색하려고하면 내 코드에서 null을 반환합니다. 여기
내 코드
SAPFunctionsOCX.SAPFunctionsClass func = new SAPFunctionsOCX.SAPFunctionsClass();
func.Connection = connection;
SAPFunctionsOCX.IFunction ifunc = (SAPFunctionsOCX.IFunction)func.Add(functionName);
SAPTableFactoryCtrl.Tables tables = (SAPTableFactoryCtrl.Tables)ifunc.Tables;
SAPTableFactoryCtrl.Table objTable = (SAPTableFactoryCtrl.Table)tables[tableName];
//Paramters (Find one column "MATNR"
SAPTableFactoryCtrl.Columns cols2 = (SAPTableFactoryCtrl.Columns)objTable.Columns;
for (int i = 1; i <= cols2.Count; i++)
{
SAPTableFactoryCtrl.Column col = (SAPTableFactoryCtrl.Column)cols2[i];
Console.WriteLine(col.Name);
}
//Error here! matnr == null
SAPFunctionsOCX.IParameter matnr = (SAPFunctionsOCX.IParameter)ifunc.get_Exports("MATNR");
은 인터넷을 검색하면, here, here 및 here을 광산과 유사한 몇 가지 예를 발견!
이유는 무엇입니까? get_Exports ("MATNR"); null를 돌려 주는가?
이 표준 기능 모듈에 실제 함수 호출을 잊었다 생각입니까? 코드에서 볼 수 없습니다. 내보내기 매개 변수 목록이 null 일 수 있습니다. 대신 확인해야하는 테이블 매개 변수가있을 수 있습니다. –
functionName, tableName은 함수의 이름과 테이블 이름을 각각 포함하는 변수입니다. 테이블 매개 변수를 복구 할 수 없으며 get_Exports 및 function 메소드가 있습니다. ([here] (http://forums.sdn.sap.com/thread.jspa?threadID=1425169), [here] (http://sunhongwei2002.blog.163.com/blog/static/149007012201062165717737)의 예제를 참조하십시오. /) and [here] (http://blog.csdn.net/robaot/archive/2009/10/20/4704127.aspx) – ridermansb
예제 3은 정확하지 않다고 생각합니다. 일반적으로 가져 오기 매개 변수는 내보낼 매개 변수가 아닙니다. –