cancel
Showing results for 
Search instead for 
Did you mean: 

DCOM + ASP example ?!

FLSaito
Participant
0 Kudos

Hi, could you provide me a example of a code in asp that calls a method of a dcom (i guess is it =)), in our code we already connected with sap system succesfully, but i´m not achieving to call the method and get the export parameter of the method.

If someone can help me i appreciate

Thanks - sorry my bad english hehehehe

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This is an old code fragment we used to communicate with SAP to perform an Open Enrollment "Create Plans" action.

Set m_objBAPI = New _EmployeeLib.EmployeeBenefit

m_objBAPI.Destination = "SAP"

m_objBAPI.BapiCreatePlans m_strEmployeeID, m_rsEventList, m_rsReturnValues, m_rsCreditSelections, _

m_rsHealthSelections, m_rsInsuranceSelections, m_rsSavingsSelections, m_rsSpendingSelections, _

m_rsMiscelSelections, m_rsDependentSelections, m_rsBeneficiariesSelections, m_rsInvestmentSelections

strErrorMessage = CheckSAPError(m_objBAPI, m_rsReturnValues, True)

CheckSAPError is a function that would look at the values in the m_rsReturnValues recordset (structure) and determine if an error, warning or success condiction has taken place. If an "S" was returned then the "commit" method was called on the BAPI object.

The BAPI's destination is set to reference the "SAP" key value in teh registry (created using the DCOM connector).

EDIT: - Sorry ... this was taken from a VB COM object. Not in-line ASP. However, the code will work the same - just use Server.CreateObject() to create an instance of the BAPI.

Answers (1)

Answers (1)

Former Member
0 Kudos

I have a DCOM example but write for Excel. If you're interrested I can send it to you ?