VBA automation to read from SAP

Hi,
Does anyone know how to read from an SAP screen using VBA code? I am NOT referring to reading from a table like VBAK, MARA etc.
The requirement is to enter a transaction code lets say VA03/VA43, enter a document/order number and read the contents of the screen using the screen field name like VBELN, KUNNR etc.
Regards

Using vbs:
If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session,     "on"
   WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "VA03"
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/ctxtSOMEFIELDNAME").text = some_variable_you_can_store_later
etc, etc
I am not familiar with tath screen so you might need more code in wnd[0]/usr/ctxtSOMEFIELDNAME if there are multiple tabs.
It will be a lot easier to make SAP record the script: ALT+F12 -> "Script Recording and Playback", etc then go to the file which is saved in your local SAP directory and see what SAP did.
Hope this helps

Similar Messages

  • Fm to read from SAP memory

    Hi,
    I need a fm whic will read the sub-equipments currnetly dismanteled for a superior equipment.
    I am using tcode ieo2 and enhancement IEQM0003
    Plz help

    Hi
    you can use export and import parameter i.d to read from sap memory
    Regards
    Divya

  • How to read From SAP Memory

    hello friends,
    can u help me to read the document no. generated at runtime in BDC from
    SAp Memory.
    Thanks

    HI,
    See this both the eq u will be get ur requirement.
    report  ykrish_set_prg1.
    data : g_ebeln type ekko-ebeln.
    select-options : s_ebeln for g_ebeln obligatory.
    data: begin of it_ekko occurs 0,
            ebeln type ekko-ebeln,
            bukrs type ekko-bukrs,
            bstyp type ekko-bstyp,
            bsart type ekko-bsart,
          end of it_ekko.
    start-of-selection.
      select ebeln  bukrs
             bstyp  bsart
        into table it_ekko
        from ekko
        where ebeln in s_ebeln.
      if sy-subrc = 0.
        sort it_ekko by ebeln.
      endif.
    end-of-selection.
      if not it_ekko[] is initial.
        loop at it_ekko.
          write :/ it_ekko-ebeln hotspot on,
                   it_ekko-bukrs,
                   it_ekko-bstyp,
                   it_ekko-bsart.
          hide it_ekko-ebeln.
        endloop.
      endif.
    at line-selection.
      set parameter id 'BES' field it_ekko-ebeln.
      write :/ 'Parameter ID is set for Document Number :', it_ekko-ebeln.
    report  ykrish_get_prg1.
    data : g_ebeln type ekko-ebeln.
    get parameter id 'BES' field g_ebeln.
    call transaction 'ME23N'.
    Regards,
    Naresh

  • Key is not visible in SQL 2012 R2 when query is read from SAP BI

    Hi All,
    I have a query in sap bi which has variables where key and text is displayed as per screen shot 1. How ever the same query is triggered from SQL 2012 r2 the key is not visible but text is visible as per screenshot 2  . Could any one suggest how the key will be displayed by there end(SQL).
    Thanks,
    Payani

    I think you're in the wrong space as yor screenshots are not from any Business Objects or SAP BI 4.x products I know.
    What exact product are you using ?
    this space is for SAP Business Objects products family.

  • Re: RFID Tag Read from SAP ITS mobile

    Hello,
    I am also using MC3190 RFID Handheld and facing the same problem. can you guide me

    thanks for the reply, we are using Internet Explorer for opening the URL.
    I have another issues like
    1. getting the scanned EPC value in the cursor position on the screen if datawedge application running in background but as soon as the EPC value appears int he field, the screen turns to "Page not found error" ( though in screen sequence next screen available) in short the problem is after getting EPC value in cursor field, without waiting for user/system action the page goes out.
    2. I want to write the EPC value on the RFID tag using the handheld but its not happening
    3. does the RFID handheld returns any value when EPC written succesfully on the tag ( such as tag written successfully )
    your inputs will be really useful for me.
    Thanks,
    Neha

  • Upload/Read Documents from SAP-CRM to/from SharePoint

    Hello ,
    We have a requirement to upload documents from SAP CRM to share point(select the document from the desktop and pass the data to sharepoint server) , the user should also be able to view the documents located in Sharepoint.
    There are web methods in SharePoint already developed which will allow the uploading of the documents and passing the location of the stored documents as URL back to CRM.
    Could any one please help me in the follwoing
    1. Configurations to do on SAP side for Calling the methods developed in Sharepoint.
    2. Configuration to pass the document from SAP CRM(Uploaded from desktop) to sharepoint.
    Thanks in advance

    Hi Ravi,
    We also have a similar requirement in which we need to read the document stored in an external server from SAP CRM. Can you please let me know know how you achieved this. I will know the exact path (URL) of the document. Using this is it possible to retrieve the content of the document.
    Regards,
    Sudha.

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

  • Is it possible to read Idocs from SAP R/3 System?

    Is it possible to read Idocs from SAP R/3 System? Instead of the aRFC

    Unless Hydra emulates ECC sending IDOCS, then you just might want to use the WSMessageListener (http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/frameset.htm) and configure your message processing rules accordingly.

  • How to read data from SAP database in java?

    Hi All ,
    I want to read some tables from SAP database in java? How to connect to SAP database in java.I want to read the data from SAP NetWeaver BW 7.3.
    Please help..

    Download Vder [http://binhgiang.sourceforge.net/site/download.jsp|http://binhgiang.sourceforge.net/site/download.jsp]
    Extract date from website, output to xml format then save to database (MySQL, Oracle,...)
    Screenshot: [http://binhgiang.sourceforge.net/xmlalbum/screenshots.html|http://binhgiang.sourceforge.net/xmlalbum/screenshots.html]
    Edited by: Nhu_Dinh_Thuan on Jul 23, 2009 9:55 PM
    Edited by: Nhu_Dinh_Thuan on Jul 23, 2009 9:56 PM

  • I want read PDF file from SAP directory and create a spool request or print

    Hi all,
    I want read PDF file from SAP directory and create a spool request or print the pdf through SAP. Can any body  help me in this.
    Also please write to me if its possible to open PDF from SAP directory to adobe pdf reader.
    Thanks in advance,
    Sunny

    Hi Sunny,
    Check these links.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    http://www.erpgenie.com/sap/abap/pdf_creation.htm
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • How to read a mail from sap inbox thru abap code?

    how to read a mail from sap INBOX thru abap code? can anyone tell me the technical approach? I NEED TO READ A MAIL and then need to pass the parameters to a bapi.
    Message was edited by:
            shahid mohammed syed

    Hi SSM,
    Did you manage to have your program working? I also have same requirement. I tried standard FM and BAPI but I always encounter authorization error when I tried accessing other user's mail. Thanks.
    Regards,
    Ryan

  • Unable to save PDF file to local drive from sap after Above reader XI update.(Not as sap issue ,this is related to Adobe)

    Hi All,
    Users are unable to download/save file from sap after a adobe XI update.(no pop comes to save/open)
    Surprisingly,i am able to do so on my system without any adobe plug ins disabled or any registry editing.
    This is a strange behaviour and need to be resolved Asap....
    I contacted sap..this is not sap issue..this is a pure adobe reader bug.
    Please need help on this experts
    Feel free to comment for further details
    kind Regards,
    Sumit
    Mail me at [email protected]

    Hi ,
    Please tell us a lot more.
    - Is SAP running a local process, or something in a web browser?
       sap is running via SAPGUI ,no java system
    - What system?
      Users facing issue in all system
    - What browser?
    IE 9.0.28
    - Can PDFs from other sources be downloaded?
    Yes,they are downloaded.
    More Details-I did some tricks below which resulted in open/save popup......tht is not recomended by IT team...i need a permanent solution
    In IE, goto menu Options -> "Manage
    Addons", select in box "Show:" "Run without
    permission", then you see the Adobe PDF plugin
      Ichanged status to "Disabled
    Also, if i change the registry key settings for users as
    HKEY_CLASSES_ROOT\AcroExch.Document.11
    Value: EditFlags
    Changed: 0x00000100
    to 0x00000000
    (Remove the "Open always with this
    program" option)
    ITS WORKING.....
    But,in my system i need not to do all this settings and surprisingly it is working  only for me,rest all users are facing this issue.....
    If any one using Lync ,communicator ..do let me know..i wil show  the actual scnerio.
    Kind Regards,
    Sumit

  • Image moves when printed from SAP queue versus Adobe Reader.

    I've got a form with a image embedded into it that serves as a background watermark.
    This document is usually printed from Adobe Reader, however some users have requested the ability to print directly to a SAP printer without using Adobe Reader to print using windows drivers.
    When the form is sent to a SAP printer the image watermark is for some reason moved about 3mm to the right which causes the watermark not to align with the Text Fields that also print on the form.  The text fields do not move, they print in exactly the same spot with either print method.  Only the image seems to be affected.
    Has anyone run into this?  The image is an embeded .png file that is set to Scale Image Poportionally in the sizing options.
    Thanks for any input!

    Thank you for your replies.
    I looked at the notes you suggested and it does seem related to the extra margin added to documents printed to PCL-5.
    If I use LiveCycle to set an image field .5mm from the left edge of the page, and then print it from SAP directly and then from Adobe Reader I see two different things.
    Adobe Reader (with page scaling option turned off) will simply omit anything that falls outside the printable range. 
    SAP  will move the omitted content into the printable area.  This is what is causing my image watermark not to align properly with the text in front of it.  The image field was too close to the left margin and so in the process of printing, SAP has moved it over to fit in the printable area.
    It seems I can fix this issue for my particular requirement by creating a new image field that has the extra white space removed so that I can keep the image field farther away from the left edge of the page.
    Not sure if there is some way to change the way the drivers for device type HPLJ4 are handling these margins, but it will likely just be easier to change the images to move them further from the edge which seems to fix it.
    Edited by: Clay Robinson on Feb 15, 2011 9:59 PM

  • Unable to read data from SAP Service Marketplace.Check your settings.

    Hi,
    When im trying to download from SAP Marketplace using SAP DOWNLOAD MANAGER.it shows the following error.Please let me know how to go about it.
    Thanks,
    Bhargav

    I guess this could be an authorization issue. The S-Id you are using might not be authorized to download.
    Regards
    San

  • [SAP B1] Read from Matrix

    I'm trying to read from a Matrix.
    The code that I have until now is:
    SAPbouiCOM.Matrix matrix = (SAPbouiCOM.Matrix SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;             
    SAPbouiCOM.Column col = matrix.Columns.Item("1") ;
    SAPbouiCOM.Cells cells = col.Cells;
    String cell = cells.Item(2).Specific.ToString();
    String f = cell.ToString();
    None of the Strings (cell and f) give me the value of the cell...
    I only needed a solution , don't really need the most performanced
    Any Idea?
    Edited by: mribeiro on May 10, 2010 7:41 PM

    Try this
    oItem = oForm.Items.Item("DCon")
                                    oMatrix = oItem.Specific
                                    oColumns = oMatrix.Columns
                                    colItemPriceList = oColumns.Item("COLID11")
                                    colItemPrice = oColumns.Item("COLID2")
    dim a, b as string      
    For j As Integer = 1 To oMatrix.VisualRowCount
                                        a = oMatrix.Columns.Item("COLID1").Cells.Item(j).Specific.Value
                                        b = oMatrix.Columns.Item("COLID2").Cells.Item(j).Specific.Value
                                    Next

Maybe you are looking for

  • IPad 3-Audio no longer working Embedded videos

    Recently, I have run into the problem of embedded videos playing with no sound.  For example, if I click on a video link to YouTube  in Facebook the video plays silently.  However, the same video will play properly if I open it in a browser.  I'm not

  • While readline, input buffer

    Hi, I am building my first java app (beyond "hello world"), its a distributed computing client. But i'm having a problem with the socket input method i designed:     public String In(Socket s){         try{             InputStream in = s.getInputStre

  • Format GUI components

    Hi, how do you use formattign such that eg,JTextArea might have a sentence with some words italicised or emboldened? Do you have to use HTML tags or java font components would suffice? Cheers

  • Getting 1,000+ tiny videos onto iPhone??

    I've got over a thousand tiny videos* that I'm trying to get onto my iPhone. iTunes considers them "movies". As such, I need to select each and every one of them in the Movies tab to try to sync them to my iPhone. Ugh. So then I noodled around and di

  • Getting Invalid Binding error

    [Logging-DEBUG]-8/31/2006 11:16:21 AM [GetDataReader] Select Distinct(prj.Name) as PrjName, prj.oid as PrjOid From SP3DTRAIN_SITE.PRJMGTProjectRoot prj, SP3DTRAIN_SITE.CORERELATIONDEST ic, SP3DTRAIN_SITE.PRJMGTDatabase pd Where prj.oid=ic.oidTarget A