Problem solve Get help with specific problems with your technologies, process and projects.

Session object vs. direct declare

With the SAP DCOM Connector, when is the best time to use a session object vs. direct declare as far as performance...

is concerned? This RFM/BAPI requires a "Commit work". 'Session: Public oSession As TRIPoRcvLib.PoRcvSessionComponent Set oSession = New TRIPoRcvLib.PoRcvSessionComponent oSession.PutSessionInfo "STG", "UsrName", "Password", "EN", "100" VS Simple declare: Set oRcv = oSession.CreateInstance(NAMESPACE & ".GoodsMovement") Set oRcv = New TRIPoRcvLib.GoodsMovement With oRcv .destination = "stg" .userid = "UsrName" .Password = "Password" .client = "100" End With 'Build the recordsets oRcv.BapiCreateFromData GoodsmvtHeader:=RsHeadIn, GoodsmvtCode:=RsCodeIn, goodsmvtitem:=RsItemsIn, Return:=rsReturn oRcv.CommitWork Both of these work but there is a huge performance issues with the session object on the commit work call.

I am a little confused by the supplied source code since you seem to have oSession in both cases. So my answer makes the assumption that in case A) you use a session object, in case B) you don't. Then the answer is that you need A) whenever you want to commit multiple updates executed on different business object instances, otherwise the choice is yours./

This was last published in November 2001

Dig Deeper on SAP Basis administration and NetWeaver administration

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.