我有一個BAPI函數被調用,它接受輸入一個字符串並返回一個字符串列表作爲輸出。我在我的java代碼中使用jco3.jar文件,但無法找到任何內置的方法,它將字符串列表(String [])作爲輸出參數,儘管我們有ByteArray/CharArray。如何使用jco3.jar處理由任何BAPI返回的字符串列表?
function.getExportParameterList()。getString(「I_DOCNUM」); //如果返回參數 - 「I_DOCNUM」僅爲字符串類型,但不適用於字符串列表,則它將起作用。
請幫幫我。提前致謝。
Java代碼的
JCoDestination destination = JCoDestinationManager.getDestination("mySAPSystem");
System.out.println("Attributes:");
System.out.println(destination.getAttributes());
System.out.println(destination.getRepository());
destination.ping();
JCoFunction function = destination.getRepository().getFunction("INBOUND_IDOCS_FOR_TID");
if(function == null)
throw new RuntimeException("INBOUND_IDOCS_FOR_TID not found in SAP.");
function.getImportParameterList().setValue("TID", "0A80351B1927589833E57997");
try
{
function.execute(destination);
}
catch(AbapException e)
{
System.out.println(e.toString());
return;
}
System.out.println("STFC_CONNECTION finished:");
System.out.println(" Echo: " + function.getExportParameterList().getString("I_DOCNUM"));
功能模塊: -
INBOUND_IDOCS_FOR_TID. *"---------------------------------------------------------------------- *"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(TID) TYPE EDIDS-TID *" CHANGING *" VALUE(I_DOCNUM) TYPE IDOC_TT *" EXCEPTIONS *" NO_IDOC_FOUND *"---------------------------------------------------------------------- data: wa_docnum like edidc-docnum. select docnum from edids into wa_docnum where (status eq '50' or status eq '56') and tid eq tid. append wa_docnum to i_docnum. endselect. if sy-subrc ne 0. raise no_idoc_found. endif. ENDFUNCTION.
請將功能模塊的完整簽名添加到問題中,包括所有相關的數據類型。 – vwegert
您是如何在ABAP功能模塊界面中定義EXPORT參數的?它是什麼類型?據我所知,無法將數組類型定義爲遠程函數模塊接口參數。 – Trixx
我已經添加了代碼段請幫助我。 –