0

それを介してSAP販売注文を作成するために使用する.Netアプリケーションがあります。(一般的な) 単一の SAP ユーザー アカウントを使用してrfcDestinationを作成すると、複数のユーザーで完全に機能します。しかし、ログインしているユーザーのユーザー アカウントを使用すると、次の例外が発生します。

RfcInvalidStateException:Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.Provider.SapException: destination MAQ is invalid ---> SAP.Middleware.Connector.RfcInvalidStateException: destination MAQ is invalid
   at SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination)
   at Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.Provider.SapConectionProvider.Invoke[T](IDataRequet request, String username, String password, IRfcFunction& rfcFunction)
   --- End of inner exception stack trace ---
   at Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.Provider.SapConectionProvider.Invoke[T](IDataRequet request, String username, String password, IRfcFunction& rfcFunction)
   at Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.SapDataRepository2.Invoke[T](IDataRequet request, String user, String password)
08:20:52.016 [23] ERROR General - ATP Check Exception:Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.Provider.SapException: destination MAQ is invalid ---> SAP.Middleware.Connector.RfcInvalidStateException: destination MAQ is invalid
   at SAP.Middleware.Connector.RfcFunction.Invoke(RfcDestination destination)
   at Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.Provider.SapConectionProvider.Invoke[T](IDataRequet request, String username, String password, IRfcFunction& rfcFunction)
   --- End of inner exception stack trace ---
   at Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.Provider.SapConectionProvider.Invoke[T](IDataRequet request, String username, String password, IRfcFunction& rfcFunction)
   at Portal.Infrastructure.Data.BoundedContext.ScreenPop.SAP.SapDataRepository2.Invoke[T](IDataRequet request, String user, String password)

これは、複数のユーザーが同時に rfc を呼び出した場合にのみ発生しました。

SAP .Net コネクタは複数の SAP ユーザー アカウントをサポートしていますか??

4

1 に答える 1

2

複数のログオンには RfcCustomDestination を使用する必要があります。

web.config

  <configSections>
    <sectionGroup name="SAP.Middleware.Connector">
      <sectionGroup name="ClientSettings">
        <section name="DestinationConfiguration" type="SAP.Middleware.Connector.RfcDestinationConfiguration, sapnco"/>
      </sectionGroup>
    </sectionGroup>
  </configSections>


  <SAP.Middleware.Connector>
    <ClientSettings>
      <DestinationConfiguration>
        <destinations>
          <!-- multiple ways to do this ... -->
          <add NAME="DEV" SYSID="DEV" ASHOST="mysapashost.com" SYSNR="00" CLIENT="0000" LANG="EN" MAX_POOL_SIZE="5" IDLE_TIMEOUT="10" USER="anything it is not used" PASSWD="anything it is not used"/>

        </destinations>
      </DestinationConfiguration>
    </ClientSettings>
  </SAP.Middleware.Connector>


</configuration>

アプリコード:

private static RfcCustomDestination mydestination()
{
    //"DEV" is the name of the destination in the web.config
    RfcDestination rfcDest = RfcDestinationManager.GetDestination("DEV");

    RfcCustomDestination _customDestination = rfcDest.CreateCustomDestination();
    _customDestination.User = "LoggedOnSAPUserid";
    _customDestination.Password = "LoggedOnSAPPassword";

    return _customDestination;
}

public string runMyRFC(string myInput)
{
    RfcCustomDestination _customDestination = mydestination();
    IRfcFunction Results = _customDestination.Repository.CreateFunction("Z_SOME_RFC");

    Results.SetValue("RFCInput", myInput);

    Results.Invoke(_customDestination);

    string threResult;

    //. . .

    return theResult;

}
于 2014-10-25T19:51:35.023 に答える