GoodsMovement BAPI from VBA

Advertisement
Hi,
I am trying to retrive material document data through the BAPI_GOODSMVT_GETITEMS. In the following code, the connection works fine, but when I get to the line:
Set matdocitems = MatDoc.GetItems(mat)
I get an error:
"Run-time error '8793'. An exception was raised in the RFC system. The connection was automatically closed by the system.
Exception: RFCTYPE_UNKNOWN_HANDLE.
Error-key: rfc system error raised
Description: for more information: see tracefile_rfc
cpic-status: ???
Internal state: ???
Please help
Sub Button1_Click()
    Dim objBAPIControl As Object
    Set objBAPIControl = CreateObject("SAP.BAPI.1")
    Call ConnectToSAP(objBAPIControl, True)
    Dim mat As Object
    Set mat = objBAPIControl.GetSAPObject("BUS1001", "000000000001032197")
    Dim MatDoc As Object
    Set MatDoc = objBAPIControl.GetSAPObject("BUS2017")
    MsgBox ("Starting GetItems")
    Dim matdocitems As Object
    Set matdocitems = MatDoc.GetItems(mat)
    Call ConnectToSAP(objBAPIControl, False)
    MsgBox "Program done!", 0, "Exit"
End Sub
Advertisement

Replay

Hi, how are you?
Look, it's easy to do a rfc call to SAP.
But, if you look in the Netweaver Developer Studio 7.1, the SAP CONNECTOR is deprecated. So, my recomendation is to convert your RFC's to Web Services, and consume them like that, you won't have any problem with SOAP.
Regards,
Sebastiá

Calling BAPI from VBA - type mismatch error

Hi, I am trying to retrieve data from SAP R/3 material documents to Access VBA. In the example below, the connections works fine, but when I assign the value to the parameters, fx: MatDocItems.exports("MATERIAL_RA") = "000000000001032197&qu

Acrobat X: improved functions from VBA?

Hello, I use Acrobat to print create some PDF files from Excel 2010, from Visual Basic for Applications (VBA). Are there any new and improved functions in VBA for Acrobat X? What is the best/fastest way to print to PDF from VBA in Excel 2010 for Acro

Logon from VBA to R3

I have following code to connect from VBA to R3 If I use SilentLogon = True, It will be fail. If I use SilentLogon = False, logon screen will popup, directly click logon will be fail too. If I use SilentLogon = False, logon screen will popup and I se

I want to execute a addon of R3 from VBA.

Dear all. (sorry not good English) I want to execute a addon of R3 from VBA. The addon have 'commit' multiple times. I am using "RFC_CALL_TRANSACTION_USING" from VBA. but, addon is finished by one commitment processing. I want to execute a addon

Problem with special charecter while calling a BAPI from Webdynpro JAVA.

Hi Experts, I am calling a BAPI from Webdynpro JAVA. I am passing a special charecter  u2018 as input to BAPI. But I am getting a # as input in R/3.. Can any one explain why it is getting changed? Any inputs regarding this issue are appreciated. Than

Call BAPI from ITS

hi all, i'm wondering to know about how to call BAPI from ITS. Could I call BAPI from ITS? if yes, please advise me on this. Thank you so much for your effort. PeerasitNot solve yet. Thank you.Read other 2 answers

Any program for calling bapi from ABAP step by step

any program for calling bapi from ABAP step by step points will be rewarded, thank you, Jagrut BharatKumar ShuklaHi Jagrut, BAPI stands for Business API(Application Program Interface). A BAPI is remotely enabled function module ie it can be invoked f

BAPI From ORACLE

Hi all, I am trying to learn BAPI. I have created one simple BAPI for material Info, in which i am giving material Number (MATNR) as input and collecting Info like MATNR,WERKS,MBLNR,MENGE,MEINS of that material. BAPI is working fine in SAP and i am g

BAPI From ORACLE Form 6 i

Hi all, I am trying to learn BAPI. I have created one simple BAPI for material Info, in which i am giving material Number (MATNR) as input and collecting Info like MATNR,WERKS,MBLNR,MENGE,MEINS of that material. BAPI is working fine in SAP and i am g

Creating webservice using webdynpro java calling bapi from r/3

hi all, as i am new to this area can anyone provide me a guide to create a simple webservice using webdynpro java to call bapi's from r/3? i want to consume the created webservice on a .net client. Thanks in advance, RaghunandanYou can use the SAP .N

Opening a File Selection window from VBA

I am working on a vba sub-routine that will create a project file that we can send to our customers.  The procedure will remove any confidenital information from the plan and save it a local file.  I would like the user to select the destination usin

Scan from VBA (since 8.0 version)

Hello, I used to scan documents from access 2007 using execMenuItem("scan"). Since Acrobat pro 8.0, the application asks for a filename on creation. I need to specify this filename from my VBA program (without asking to user). Is it possible ? T

What are the different ways to transfer BAPIs from one company to another?

Hello friends There are some ZBAPIs that we have written which has to be given to a partnering company. Instead of recreating the whole BAPIs and related structures and data elements etc.,, is there a way I can package them and send them. For example

Create BAPI from WSDL

Hi Guru's, Is anyone aware of any techniques that can take a WSDL document and convert it/bring it into SAP to form the basis for building a BAPI or function module?  I know that once you have a BAPI you can create a webservice, but I was wondering i

How to connect to Indesign object model from VBA (Macintosh_Office)?

In PC it was: find/load tlb-file and chek box to activate. In Mac i don't see any tlb-files, so can't add this lib to VBA reference. Can i do this at all?Hi, According to your description, you might want to connect SharePoint Online environment using

Not able to checkout Files using Java Code and SAP BAPI  from DMSServer

Hi Able to download / checkout the files using T-Code SE37 (BAPI_DOCUMENT_CHECKOUTVIEW2). But when same RFC is executed from Java, it alsways says - Message ::::::::Document LGL/10000000003/000/00 does not exist My inputs in Java Code is as below - i

Accessing RFCs and BAPIs from enterprise java beans

Hello folks,      my question is concerning comunication between EJBs and RFCs. I want to develop a simple session bean that connects to a R/3 back-end, calls a RFC then returns some data, let's say, an example of this could be a list of employees fr

How bapi different from session and call transaction?

how bapi different from session and call transaction? thanks in advance.For one, Batch Data Communication (BDC) is older. Business Application Programming Interface (BAPI) came later, about 10 years ago (you can see this already from the name, which

Can we execute an SAP Standard ABAP Programme from a Custom BAPI?

Hi, We have a requirement in our project where in we have to execute an SAP Standard ABAP report. We need to execute it from a Portal by click of a button. What we are thinking is that if we have a custom BAPI which triggers the execution of ABAP rep