2014-10-17 2 views
0

SAP 판매 주문을 생성하는 데 사용하는 .Net 응용 프로그램이 있습니다. rfcDestination을 만들기 위해 (공통적 인) 단일 SAP 사용자 계정을 사용할 때 여러 사용자가 완벽하게 작동합니다. 그러나 로그인 한 사용자의 사용자 계정을 사용할 때 예외가 발생합니다.SAP .NET 커넥터, 여러 SAP 사용자 계정을 사용하여 단일 RFC 대상에 연결

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 커넥터는 여러 SAP 사용자 계정을 지원합니까?

답변

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; 

} 
+0

감사합니다, 나는 이것을 시도했지만 같은 있어요 다른 SAP 로그인을 사용한 결과 그래서이 RfcCustomDestination을 내 일반적인 SAP 사용자와 함께 사용하고 잘 작동하는 것 같습니다. 이전 사용자 접근 방식에서도 위의 예외가 발생했기 때문입니다. – tarzanbappa

관련 문제