cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Connector 3.0 calling error No instance of object type BUS2093 has been created.

Former Member
0 Kudos

Hi there,

I am trying to create asset reservation using .net connector 3.0 with VS2005. I am using BAPI_RESERVATION_CREATE1 the header data (RESERVATIONHEADER) is creating fine but there is always error in item data (RESERVATIONITEMS) "No instance of object type BUS2093 has been created. External reference:" Please help me I m stuck in this. Below is the .net code.

Dim sapRfcDestination As RfcDestination = RfcDestinationManager.GetDestination("DEV")

        Dim saprfcRepository As RfcRepository = sapRfcDestination.Repository

        Dim bapiReservation As IRfcFunction = saprfcRepository.CreateFunction("BAPI_RESERVATION_CREATE1")

       

        Dim RfcReservationStrt As IRfcStructure = bapiReservation.GetStructure("RESERVATIONHEADER")

        Dim RfcReservationTb As IRfcTable = bapiReservation.GetTable("RESERVATIONITEMS")

      

        RfcReservationStrt.SetValue("RES_DATE", DateTime.Today)

        RfcReservationStrt.SetValue("MOVE_TYPE", "201")

        RfcReservationStrt.SetValue("COSTCENTER", "ID1034")

        'RfcReservationStrt.SetValue("ASSET_NO", "3000032")

        RfcReservationStrt.SetValue("CREATED_BY", "USER")

        '

        RfcReservationTb.Append()

        RfcReservationTb.SetValue("MATERIAL", "3000032")

        RfcReservationTb.SetValue("PLANT", "HQ01")

        RfcReservationTb.SetValue("STGE_LOC", "L001")

        RfcReservationTb.SetValue("ENTRY_QNT", "10")

        RfcReservationTb.SetValue("ENTRY_UOM", "EA")

        RfcReservationTb.SetValue("REQ_DATE", DateTime.Today)

        RfcReservationTb.SetValue("ITEM_TEXT", "Pencil with Rubber")

        bapiReservation.Invoke(sapRfcDestination)

        Dim RfcReturnDetail As IRfcTable = bapiReservation.GetTable("RETURN")

        MsgBox(RfcReturnDetail.GetString("MESSAGE").ToString)

        Dim trns As New RfcTransaction

        trns.AddFunction(bapiReservation)

        trns.Commit(sapRfcDestination)

Thanks in advance...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, Please try to change FM Update Commit to this method :

IRfcFunction BapiCommit = destination.Repository.CreateFunction ("BAPI_TRANSACTION_COMMIT");

BapiCommit.SetValue("WAIT", "X");

//// fill function with update data

RfcSessionManager.BeginContext(RfcDestination);

RfcReservationStrt.Invoke(RfcDestination);

BapiCommit.Invoke(RfcDestination);

RfcSessionManager.EndContext(RfcDestination);

IRfcTable returnTable = RfcReservationStrt.GetTable("RETURN");

Best regards,

Yarden

Former Member
0 Kudos

Hi Rehman,

Could you pls check or let me know where exactly the instance of "bapiReservation" is created.