Macro ms word - sap r/3

Hi expert,
do you have some exemple to show how is possible to make a link between microsoft word and sap r/3 ??
For exemple I have a .doc file, and I want to put in some data from r/3..... how can I do it ?
Tks,
bye.

Hi Friend,
Try this simple for downloading data to word doc.
Downloaded file is in C:\Testing.doc
Report ztest_downld.
*Types
TYPES: BEGIN OF g_r_mara,
       matnr LIKE mara-matnr,
       ersda LIKE mara-ersda,
       laeda LIKE mara-laeda,
       mtart LIKE mara-mtart,
       mbrsh LIKE mara-mbrsh,
       END OF g_r_mara.
*Data
DATA: g_t_mara TYPE TABLE OF g_r_mara,
      filename TYPE string.
*Tables
TABLES: mara, sscrfields.
*Selection Screen
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 10(20) text-001 FOR FIELD p1.
SELECTION-SCREEN PUSHBUTTON 12(20) word USER-COMMAND uc.
SELECTION-SCREEN END OF LINE.
*Initilizing data.
INITIALIZATION.
  word = 'word'.
  filename = 'C:\Testing.doc'.
AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
    WHEN 'UC'.
*Data retrival
      SELECT matnr ersda laeda mtart mbrsh
        INTO  CORRESPONDING FIELDS OF TABLE g_t_mara
        FROM mara
        WHERE matnr IN s_matnr.
*Downloading data from internal table to excel or txt
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = filename
          filetype              = 'ASC'
          write_field_separator = 'X'
        TABLES
          data_tab              = g_t_mara.
  ENDCASE.
Thanks......

Similar Messages

  • How to co-athoring with macro enable Word documents (.docm)

    I´m working with a prototype-installation of SharePoint 2010 where co-authoring is an important function.
    But I have found one problem however.
    According to the following article co-authoring is not supported for macro enabled word-files (.docm ):
    http://office.microsoft.com/en-us/sharepoint-server-help/document-collaboration-and-co-authoring-HA101812148.aspx
    1. Does anyone know what the plans are regarding this issue, will docm and co-athoring be supported in the near future?
    2. Are there any workarounds available to handle macro and co-authoring at the same time?
    Björn
    Found the solution!
    Store a macro enable Word-template (.dotm) in the Sharepoint library and save the created Word document in non macro enable format (.docx).
    The document vill keep the connection to the template and all the macros will work together with co-athoring!
    Björn

    Here's a followup to Bjorn's original post:
    Save a copy of the .dotm as a .docx, in the SharePoint team  lib where your users will be working.
    Next, create a a new doc lib with a nice short name such as "a" (to keep path short) on the site that holds your team's doc lib, and move the .dotm file there.  Then, right click on the .dotm's name to Get File Properties and copy
    the path to  the .dotm file. The path might look something like this: 
    https://win.MyCompany.com/TeamSite/a/myfile.docm.
    Now that you have the path to the .dotm, go back and edit its .doc version, that you created in the Team Lib. In the Developer tab in the ribbon, click on DOCUMENT TEMPLATE. The Templates and Add-ins dialog will appear. PASTE the path,
    above, into the Document Template field.
    Now your .docx knows the path to the .dotm, and since your users can access both locations, the macro in the .docx will still work OK...and your working doc lib won't be junked up with the .dotm version.

  • Monitor all service Start with the word "SAP"

    Hallo
    i have sccm 2012 
    Can monitor services start with the word "SAP"
    Instead of monitoring all service set separately .
    thanks 

    Hi,
    Did some research and came to the following solution
    Open the System Center Operations Manager Console. 
    Go to Authoring and expand Management Pack Templates
    Right Click Windows Service and click Add Monitoring Wizard
    On the Monitoring Type page select Windows Service and click Next
    Give the Service and store the it in a New Created Management Pack and click Next
    On the Service Name Type SAP* on the Target group Select Windows Server Computer Group and click Next
    On the Performance Data page click Next
    On the Summary page click Create
    Export the Management Pack pack you created
    In the Management pack replace the following code:
    <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProviderWithClassSnapshotDataMapper">
    <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
    <ServiceName>sap*</ServiceName>
    <Frequency>60</Frequency>
    With the following code
    <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
    <NameSpace>root\cimv2</NameSpace>
    <Query>select * from win32_service where name like 'sap%'</Query>
    <Frequency>60</Frequency>
    Second replace
    <Value>$Data/Property[@Name='BinaryPathName']$</Value>
    With
    <Value>$Data/Property[@Name='PathName']$</Value>
    Save the management pack and upload it to System Center Operations Manager.
    In the Operations Console Click Monitoring
    Click Discoverd Inventory and change the target type to the target you created. Then the view should look something like this:
    I created the management pack You can download it from here: http://www.ms-opsmgr.eu/wp-content/uploads/Download/2015/SAP/SAP.Services.xml
    GReetings Roel Knippen
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • DOI and Script collection/Macro in Word

    Hi experts,
    My goal is to upload macro from file and after upload run this macro inside word document.
    I try to upload macro from file in Script collection using get_script_collection(class I_OI_DOCUMENT_PROXY)  & add_script (class I_OI_SCRIPT_COLLECTION)
    After that I want to execute macro using execute_script(class I_OI_DOCUMENT_PROXY) .
    I always get error when executing macro that some object is missing. Probably macro is not correct written in file.
    Can somebody give me example hove this macro must be written so I can execute him.
    Thanks a lot,
    Drazen

    Hi Drazen Lovrencic ,
    Even I am trying to execute the macro but facing problem. Below is the my code of adding vb script(macro) to the excel spreadsheet and executing it. but stil not working. I am getting error message "Cannot initialize control"
      TYPES:
        TS_SOURCE_CODE  TYPE TEXT1024,
        TT_SOURCE_CODE   TYPE STANDARD TABLE OF TS_SOURCE_CODE WITH DEFAULT KEY.
      TYPES: BEGIN OF TY_SCRIPT,
             VALUE(80) TYPE C,
             END OF TY_SCRIPT.
      DATA: LS_SOURCE_CODE  TYPE TY_SCRIPT,"TS_SOURCE_CODE,
               LT_SOURCE_CODE  TYPE TABLE OF TY_SCRIPT,
               L_RETURN_CODE TYPE SOI_RET_STRING.
    Building the Script - every line has to end with cr/lf
      LS_SOURCE_CODE-VALUE = 'Sub Macro1()'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
       LS_SOURCE_CODE-VALUE = 'ActiveSheet.Buttons.Add(234, 57, 109.5, 29.25).Select'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'Selection.OnAction = "button"'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'Range("G9").Select'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'ActiveSheet.PageSetup.PrintArea = ""'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'With ActiveSheet.PageSetup'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.Orientation = xlLandscape'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.PaperSize = xlPaperA4'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.FitToPagesWide = 1'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = '.FitToPagesTall = 1'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'End With'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
      LS_SOURCE_CODE-VALUE = 'End Sub'.
      CONCATENATE LS_SOURCE_CODE-VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF
      INTO LS_SOURCE_CODE-VALUE.
      APPEND LS_SOURCE_CODE
               TO LT_SOURCE_CODE.
    BREAK-POINT.
    DATA: L_SCRIPT_COLLECTION TYPE REF TO i_oi_script_collection.
    DATA: table_url(256).
    DATA: DOC_COOKIE TYPE I.
          L_RETURN_CODE = c_oi_errors=>ret_document_not_open.
          CALL METHOD c_oi_errors=>create_error_for_retcode
            EXPORTING
              retcode  = L_RETURN_CODE
              no_flush = ''
            IMPORTING
              error    = gc_error.
    CALL FUNCTION 'DP_CREATE_URL'
          EXPORTING
            type    = ''
            subtype = ''
          TABLES
            data    = LT_SOURCE_CODE
          CHANGING
            url     = table_url.
    DATA: CONTAINER_CONTROL TYPE REF TO C_OI_CONTAINER_CONTROL_PROXY.
    CREATE OBJECT CONTAINER_CONTROL.
        CALL METHOD container_control->add_document_script
          EXPORTING
            NO_FLUSH       = 'X'
            document_cookie = doc_cookie
            script_name     = 'Macro'
            script_type     = '1'
            script_url      = table_url
          IMPORTING
            error           = gc_error.
        APPEND gc_error TO gt_error_table.
    Calling the script:
      CALL METHOD GC_DOCUMENT->EXECUTE_MACRO
        EXPORTING
          MACRO_STRING = 'Macro_demo_1'
          SCRIPT_NAME  = 'Macro'
          NO_FLUSH     = SPACE
       IMPORTING error = gc_error.
    APPEND gc_error TO gt_error_table.

  • WRITE MACRO FOR WORD IN ORACLE FORMS 6I

    Dear All
    I want to know the coding to write a macro for word document to print , when i open the word document using ole2. I am able to open word, insert the header and footer but i want to print the document also. Since I dont want to write the macro in word file because i have lot of files , so whenever the user run the form i just want to take print . Is there any way.
    V.S

    V.S.,
    I suggest you open a Word document and record a macro that prints a document. Then edit the macro and you will see all of the commands that were issued to print the document. Then try to emulate these commands in your OLE calls from Forms.
    I tried searching the internet for a comprehensive list of OLE commands, but never found anything. Through trial and error, I discovered if I open the application and recorded a macro to perform that action I want (in this case - printing a Word document) - I could edit the macro and see the commands used by the application to perform the action. Then base your Form OLE code on the macro. ;-)
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • *.docm CANNOT USE MACROS IN WORD 2010

    Hello everyone
    This is my first post in this community, so if there's anything that is not correct admins please feel free to move the post to where it should be :)
    So I work at an office and there are a lot of users. There is a department in the office which works on files with macros (usually with word, forms with check, radio, text boxes)
    The thing is that when all of the users in the dept. can edit the file and select the buttons, only ONE user cannot use the file. All the macros are disabled or not working...
    Usually when working on a macro document, Word should pop up a security notification and a "Enable content" button, but it's not coming up when opening it from the computer in question.
    Can I have assistance on this? Thanks in advance :)

    Hi,
    Did you check the options in Word on this particular computer? It could be that on this pc the
    message bar has been disabled.
    So have a look at the following settings:
    File - Options - Trust
    Center - Trust Center Settings
    On the next dialog check the settings on [Macro Settings] and on [Message Bar]Compare those settings with a machine where the macro document is working.
    Maurice
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

  • Executing a macro (for WORD)

    Hi everyone,
    I created a macro in Word.
    Now I am calling it successfuly from ABAP using i_oi_document_proxy->execute_macro.
    Is there a way to pass a parameter from ABAP to the macro ?
    Thanks in advance.

    HI
    GOOD
    GO THROUGH THIS CODE , I HOPE YOU WILL GET SOME HELP YOU SOLVE YOUR PROBLEM.
                          EXAMPLE                      *
    REPORT ZVALDATE . 
      Data: v_date(8).
      V_date = '20030102'.
    VAL_DATE <DATE> <FORMAT>  <-- Passing Parameters
      val_date v_date 'YYYYMMDD'.
      if sy-subrc = 0.
        write: 'Valid Date' .
      elseif sy-subrc = 1.
        write: 'Invalid Date' .
      elseif sy-subrc = 2.
        write: 'Invalid Date Format' .
      endif.
                      END OF REPORT                    *
    To use the macro "VAL_DATE" GLOBALLY, Insert the  *
    below 2 macros in table TRMAC using Txn SM30.     *
    Sytax :                                            *
    VAL_DATA <Date> <Date format>.                     *
    It return sy-subrc.                                *
          0 => Valid date - as per the specified format*
          1 => Invalid date                            *
          2 => Invalid date format                     *
    <Date format> :                                    *
    You can pass the following date formats            *
    DDMMYYYY  MMDDYYYY  YYYYMMDD  YYYYDDMM             *
                  Macro    VAL-DATE                    *
    This macro validate Date according to the specified*
    format.                                            *
               Created by Abhishek Kumar               *
               [email protected]                        * 
    define val-dat.
      clear: %_date1, %_date2.
      %_date1(4)   = &1. "Year
      %_date1+4(2) = &2. "Month
      %_date1+6(2) = &3. "Date
      %_date2 = %_date1 - 1.
      %_date2 = %_date2 + 1.
      if %_date1 <> %_date2.
        sy-subrc = 1.
      else.
        sy-subrc = 0.
      endif.
    end-of-definition.
                  Macro    VAL_DATE                    *
               Created by Abhishek Kumar               *
               [email protected]                        *
    define val_date.
      data %_date1 like sy-datum.
      data  %_date2 like sy-datum.
      data %_date3(8).
      case &2.
        when 'DDMMYYYY'.
          val-date &14(4) &12(2) &1+0(2).
        when 'MMDDYYYY'.
          val-date &14(4) &10(2) &1+2(2).
        when 'YYYYMMDD'.
          val-date &10(4) &14(2) &1+6(2).
        when 'MMYYYYDD'.
          val-date &12(4) &10(2) &1+6(2).
        when others.
          sy-subrc =  2.
      endcase.
    end-of-definition.
    THANKS
    MRUTYUN

  • Problem about the macro in word using ole

    Hi,
       Now i have an urgent problem.
       I want to use ole2_object to control a word document by calling the macro.  i want to pass a parameter for the marco but i don't know how to pass it .  the main method i use as following:
        macro = 'startmerge."
        call method document->open_document_from_table
           exporting
                 document_size  = doc_size
                 document_table = doc_table[]
                  open_inplace   = 'X'
                 startup_macro   = macro.    " here is my problem?????
    the macro's code as following:
    Sub startmerge(file As String)
    ' startmerge Macro
    ' Macro recorded 2000-1-23 by Ryan
    Dim fs     As Object
    'Dim file As String
    'file = "C:\SAPTEMP.JPG"
          Set fs = CreateObject("Scripting.FileSystemObject")
    If fs.fileexists(file) Then
        Application.GoBack
        Selection.InlineShapes.AddPicture FileName:=file, LinkToFile:= _
            False, SaveWithDocument:=True
    Else
    MsgBox "no file found"
    End If
    Set myMerge = ThisDocument.MailMerge
    If myMerge.State = wdMainAndSourceAndHeader Or _
        myMerge.State = wdMainAndDataSource Then
    End If
    With myMerge
        .MainDocumentType = wdEnvelopes
        .OpenDataSource Name:="c:\appraial_tmp.txt", ReadOnly:=True
        .Destination = wdSendToNewDocument
        .Execute
    End With
    End Sub
    now i want to pass a value for the parameter 'file' in abap by calling a macro  'startmerge'.
    Can anyone give me some advice? or give me some advice?
    Thanks a  lot in advance.
                    qiuguo

    Hi, aRs,
        thank you very much . i have get the approach to solve this problem form the link you given. In abap sap have provided a method to call a marco using parameters.  Following is the kernel code:
        macro = 'startmerge'."()
        call method document->open_document_from_table
           exporting
                 document_size  = doc_size
                 document_table = doc_table[]
                  open_inplace   = 'X'
                startup_macro   = macro.
       data: error like I_OI_ERROR.
       create object error.
        CALL METHOD DOCUMENT->EXECUTE_MACRO
           EXPORTING
             MACRO_STRING = macro
                            NO_FLUSH     = ' '
             PARAM1       = 'C:\3.JPG'
                            PARAM10      =
                            PARAM11      =
                            PARAM12      =
                            PARAM2       =
                            PARAM3       =
                            PARAM4       =
                            PARAM5       =
                            PARAM6       =
                            PARAM7       =
                            PARAM8       =
                            PARAM9       =
                             PARAM_COUNT  = 1
                            SCRIPT_NAME  =
                          IMPORTING
                            ERROR        = error
                            RETCODE      =
                          CHANGING
                            ERROR_STRING =
                            RETVALUE     =
    so appreciate for you response.
         qiuguo

  • How to remove macros from word 2010 documents?

    I have some .dot files that I'm using as templates for a while.
    They used to have Macros to do some stuff and I started to replace those macros with Add-ins.
    What happens is that the macro menus are still there. I tried to remove the macros (using alt+f8 and even alt+f11) but the custom menus are still there! How do I exactly remove those macros and menus from my .dot files?
    I am using Microsoft Word 2010.

    In addition to what Stefan replied you can also check the attached templates by taking the following steps:
    goto File - Options - Add ins - (Below) Manage : choose templates - in the next dialog click on the template and click remove.
    Maurice

  • Enable macros in word for mac?

    I've been trying to open a form for school which is a word template and requires "enabling macros", but I can't figure out where to do that in my new macbook - any help greatly appreciated.

    Narfaz wrote:
    Is there an add-on, download, or work-around that will enable me to create macros in MS Word for Mac 2008, please?
    If there is such a thing, the place to ask about it is probably
    http://answers.microsoft.com/en-us/mac/forum/macword
    instead of here.

  • Macros with WORD.BASIC (MS WORD 2003)

    Hi:
       I have created a program linked with Microsoft Word with WORD.BASIC object. The program run correctly with MS Word 2002 executing all the methods
    CREATE OBJECT h_word 'WORD.BASIC' LANGUAGE 'e'
    CALL METHOD OF h_word 'APPSHOW' EXPORTING #1 = 'Microsoft Word'
    CALL METHOD OF h_word 'FILENEW' EXPORTING #1 = file
    CALL METHOD OF h_word 'TOOLSMACRO' EXPORTING 
                                        #1   'MACRO1'
                                        #2 = 'RUN'.
    my serious problem is that the macros include don´t run properly in Microsoft Office Word 2003. Can someone hep me with this issue, please?
    Thanks in advance
    Abel

    check out the following function module.
    RH_START_EXCEL_WITH_DATA
    though this dosent deal with word, you can get the basic idea as to how to handle macro by following the code in this fm.
    Regards
    Raja

  • List Randomizer Macro for Word 2010

    Way back with Word '97 one of my students wrote a convenient macro for randomizing lists of words.
    Briefly, the list was highlighted and the Macro button (or keystrokes) pushed - and the list was nicely randomized.
    I do not have this Macro anymore and need a similar one for Office 2010 32 bit (MS Word only).
    Note: I am well aware of online randomizers as well as using Excel to randomize a list. However, I wish to eliminate time/energy wasted steps and randomize word lists within Word 2010 itself.
    Any suggestions?

    One approach is:
    Sub Demo()
    Dim Rng As Range, i As Long
    Dim StrIn As String, StrOut As String, StrTmp As String
    Randomize Timer
    Set Rng = Selection.Range
    StrIn = Rng.Text
    StrIn = Trim(StrIn) & " "
    While UBound(Split(StrIn, " ")) > 0
      i = UBound(Split(StrIn, " "))
      StrTmp = Split(StrIn, " ")(Rnd(i)) & " "
      StrOut = StrOut & StrTmp
      StrIn = Replace(StrIn, StrTmp, "")
    Wend
    StrOut = Trim(Trim(StrOut) & " " & StrIn)
    Rng.Text = StrOut
    Rng.Select
    End Sub
    The above assumes a list separated by spaces. For lists separated by paragraph breaks or tabs, insert:
    StrIn = Replace(StrIn, vbCr, " ")
    or:
    StrIn = Replace(StrIn, vbTab, " ")
    before:
    StrIn = Trim(StrIn) & " "
    and insert a corresponding:
    StrOut = Replace(StrOut, " ", vbCr)
    or:
    StrIn = Replace(StrOut, " ", vbTab)
    before:
    Rng.Text = StrOut
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Pro-forma macros from word in pages

    We use an admin program called Archioffice to create all our correspondance.
    This program opens a word template file in word and fills in a variety of fields using a macro document that it also opens in word.
    I don't suppose that pages would support such a system of linking information from one document to another from a filmaker based database would it?
    It would be quite nice to be able to get away from having yo use MS office.
    Karl Barker.

    Not easily - no. I am pretty sure you can get something fairly similar if you invest time in writing an AppleScript for it, but I am also pretty sure that it will take quite a long time. At least if you expect everything to become just as you like it.

  • Wait macro in Word 2010

    I must be missing something really simple.  I am just trying to create a Word 2010 Macro that waits for a specified number of seconds before continuing. However I can't see how to do that in Word.  The VBA Command: Application.Wait does not seem
    to exist in Word.  Any hints?

    You could use the following procedure:
    Sub Wait(n As Long)
    Dim t As Date
    t = Now
    Do
    DoEvents
    Loop Until Now >= DateAdd("s", n, t)
    End Sub
    Call like this to wait for 10 seconds:
    Wait 10
    or
    Call Wait(10)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to use for my own macro the Bex SAP Connection?

    Hello,
    with
    Dim sapConn As Object 'Declare variant
        Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object
        If sapConn.Connection.Logon(0, False) <> True Then 'Try Logon
           MsgBox "Cannot Log on to SAP"
        End If
        'Define function
        Dim objRfcFunc As Object
        Set objRfcFunc = sapConn.Add("RFC_READ_TABLE")
    you are able to connect to SAP via a VB macro and you can use it e.g. for a RFC call.
    Is it possible to use from my macro the connection that is establised by BEX? If yes - how? I haven't found any method to get the established connection. In the macro edior is BExAnalyzer.xla with all general functions. Test.XLS ist my workbook, but here is no variable with the connection. It seems that Test.XLS only call a sub of BExAnalyzer.xla.
    Best regards,
    Alexander

    [Hello Alexander,|http://chandranonline.blogspot.com]
    Yes its possible,
    SAP Note Number: 492561
    BEx Analyzer: Connection to the BW Server in a VBA macro
    Symptom
    Customer has written VBA macros which automate functions in the BEx Analyzer via the Analyzer's VBA-API. The customer wants to automate the logon as well, i.e. the user should not be forced to process the BEx Analyzer's dialog screen manually.
    Other terms
    Logon, Login, Visual Basic for Applications
    Solution
    The following VBA code sample shows how to create an RFC connection for the BEx Analyzer without bringing up the logon dialog. It assumes that the BEx Analyzer (i.e. the Add-in SAPBEX.XLA) has been loaded already.
    Function logonToBW() As Boolean
         logonToBW = False
        On Error GoTo leave
        Dim myConnection As Object
        Set myConnection = Run("SAPBEX.XLA!SAPBEXgetConnection")
        With myConnection
    '      .client =
    '       .user =
    '      .password =
    '      .Language =
    '       .systemnumber =
    '      .system =
    '      .systemid =
    '        .ApplicationServer =
    '       .SAProuter =
             .logon 0, True
            If .isConnected <> 1 Then
                 .logon 0, False
                If .isConnected <> 1 Then
                     MsgBox "something went wrong ..."
                     Exit Function
                 End If
            End If
        End With
        Run "SAPBEX.XLA!SAPBEXinitConnection"
         logonToBW = True
    leave:
    End Function
    Also see
    [SAP Network Blog: Accessing SAP Functions from Excel using Visual Basic Applications |/people/vikas.sreedharan/blog/2007/12/12/accessing-sap-functions-from-excel-using-visual-basic-applications]
    [Thanks|http://chandranonline.blogspot.com]
    [Chandran|http://chandranonline.blogspot.com]

Maybe you are looking for

  • IPhone will not charge, or connect to iTunes

    ive tried many chargers, & many different sorces (computer, dock, car charger, wall charger) nothing works. there is no possible way for me to charge my phone. even when i try to restore it , thats not possible because my phone wont show up. itunes i

  • ATI Radeon HD5700 cards crashing on CS6 Photoshop

    Have I missed the hardware requirement of using on Nvidia Cuda based graphical card in my system? All the new blurfilters are causing a graphical cards break down. What happens is that Photoshop keeps running but the screen turns completely black. Yo

  • Contribute 6.5 and FTP

    Do any versions of Contribute support FTP over SSL (FTPES) One of our customers cannot connect to our servers using Contribute CS3 because it doesn't support this. They can warrant the upgrade cost should this be supported. Thanks Alex Edit: Sorry, y

  • Duplex Aufruf friert Photoshop 13 ein

    Hallo! Beim Aufruf Modus Duplex wird Photoshop nahezu vollständig unbedienbar (Graustufenbild/8bit).  Vergrößern, verkleinern funktioniert, aber keine Werkzeugauswahl. Die Hand ist dann immer ausgewählt, aber kein anderes Werkzeug kann ausgewählt wer

  • When i try and download a app or a song it says waiting for about 3 secs then just doesnt download

    When i try and download a app or a song it says waiting for about 3 secs then just doesnt download