コンテンツフレーム起動

RfcDispatch/RfcListen で動作する RFC サーバプログラム 文書を SAP ライブラリストラクチャに組み込む

RFC 依頼が送信される場合に、 RFC サーバプログラムは、 RFC コール依頼を待たずに、 RfcListen を使用して RFC コール依頼を要求し、 RfcDispatch を発行することができます。メインプログラムを以下のように変更する必要があります。

/* インプログラム */

rfc_handle = RfcAccept (...); /* RFC 接続の受け入れ */

if (rfc_handle == RFC_HANDLE_NULL) /* RFC 接続の受け入れをチェック */
{
rfc_error_handling(
RfcAccept ); /* RfcLastError によるエラー処理と */
return 1; /*
エラー仕様の取得 */
}

rfc_rc = RfcInstallFunction ( ABC , abc_function , ...);
/* C
ルーチン‘ abc_function ’での */
/* RFC
機能‘ ABC ’の */
/*
インストール */

if (rfc_rc != RFC_OK) /* リターンコードをチェック */
{
rfc_error_handling(
Install function ABC );
/* RfcLastError
によるエラー処理と */
return 1; /*
エラー処理とエラー仕様の取得 */
}

 

/* 次の RFC 依頼を待機 */

do
{
for (rfc_rc = RFC_RETRY; rfc_rc == RFC_RETRY;)
{
rfc_rc =
RfcListen (rfc_handle);
if (rfc_rc == RFC_RETRY)
{
/* while waiting for the next RFC request, do something else */
...
}
}
if (rfc_rc != RFC_OK)
break;

rfc_rc = RfcDispatch (rfc_handle);

}while(rfc_rc == RFC_OK);

RfcClose(...); /* RFC 接続を閉じる */

 

 

コンテンツフレーム終了