SAPGUI scripting via. Excel

We have a inhouse SAPGUI scripting tool (not really sure if it is Inhouse or SAP delivered it) that we currently use to perform Mass updates via. Excel. The person who created this has left the company but now we have a need to update this. I have no idea of how it was developed. It just seems like it was customized from available scripting functions alread yavalable. This was created in 2003 and obviously it is outdated.
How it works:
We install this tool/plugin, and it creates a menu item in the Excel called SAP Scripting and it has Connect to SAP, Play, Record, Stop, Generate Input Sheet as options. Wehn you click connect to SAP, it brings up the Logon pad and allows the user to select a system and logon. Then yo ucan click Record and it will capture all the transcations and when you hit stop and click generate input sheet, the script is ready. The script looks something like the below but below is not complete.
Issue:
The script is converting all the Input Values to UpperCase but when we use this to populate some paramets which are case sensitive, we are having issues. We need to figure out a way so that the script doesn't convert the input values to UpperCase.
have nayone seen this type os scripting tool? Any advice?
IsInput     ID     ScriptCode
START     001     
     002     MySession.findById("wnd[0]").resizeWorkingPane 95,25,false
     003     MySession.findById("wnd[0]/tbar[0]/okcd").text = "/nsu01"
     004     MySession.findById("wnd[0]/tbar[0]/btn[0]").press
X     005     MySession.findById("wnd[0]/usr/ctxtUSR02-BNAME").text =
     006     MySession.findById("wnd[0]/usr/ctxtUSR02-BNAME").caretPosition = 6
     007     MySession.findById("wnd[0]/tbar[1]/btn[7]").press
     008     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO").select
     009     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpSNC").select
     010     MySession.findById("wnd[0]/tbar[1]/btn[19]").press
X     011     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpSNC/ssubMAINAREA:SAPLSNCB:1002/txtUSRACL-PNAME").text =
     012     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpSNC/ssubMAINAREA:SAPLSNCB:1002/txtUSRACL-PNAME").caretPosition = 21
     013     MySession.findById("wnd[0]/tbar[0]/btn[11]").press
STOP     014

Standard Excel VBA uses UCASE to convert text to upper case.

Similar Messages

  • EEM: SAPGUI scripting not enabled on server

    Hi Gurus,
    I have setup SAPGUI EEM monitoring via SOLMAN 7.1 but after deployment there's an error message "SAPGUI scripting not enabled on server()-214722150:disabledByServer=True". I already checked the backend system, and the paramater of sapgui/user_scripting is set to TRUE.
    Please advise what else do I need to check in order for the SAPGUI scripting to be working in EEM? Is there any additional parameter that I need to change in the backend system?
    Thanks,
    Virgilio

    Hi Virgilio,
    See this link is usefully
    Security for the Use of SAP GUI Scripting - eCATT Security Guide - SAP Library
    Regards,
    Deva

  • SAPGUI Scripting - Connection in Delphi/Lazarus

    Hi,
    i tried to convert my autoitscript projects to Delphi/Lazarus because i need a few things autoit can´t offer. I have a few scripts written that interact with the SAP GUI that work quite well, e.g. Excel data import, specific label printing (p-touch) automated data change/correction etc.
    I thought the simple connection to the SAP-GUI scripting wouldn´t be that difficult to migrate but in fact i´m not able to just do the simple task to connect to the running SAP session in Delphi/Lazarus.
    Perhaps anyone has already done this and could share the code in Delphi/Lazarus that does the following that works perfectly well in Visual Studio VBA:
    Dim sapgui, sapapp, sap_connection, sap_session As Object
            sapgui = GetObject("SAPGUI")
            sapapp = sapgui.GetScriptingEngine
            sap_connection = sapapp.Children(0)
            sap_session = sap_connection.Children(0)
            MsgBox(sap_session.findById("wnd[0]").Text)
    I tried a few things in Lazarus but it always sticks at the "Children(0)" connection with a ole type error
    Thanks
    Thomas

    Hopefully i found the answer
    i just referenced the  activex file "SAPFEWINSE.OCX"   which is part of the SAPGUI Scripting API  project SAPFEWINSELIB
    feel free to comment  if u have better ideas

  • SAPGUI Scripting Developer needed

    I need someone capable of doing some VB coding for me related to SAPGUI scripting.....I need tight login scripts covering every scenario (user already logged on, max # of sessions, single-signon, etc.) and I need help with the systemfocus statements and understanding how it actually works (see my other post). 
    I am developing a commercial program and need it to behave as such, and unfortunately my scripting skills and programming skills in general are lacking.
    Thanks,
    Mike

    Standard Excel VBA uses UCASE to convert text to upper case.

  • How to increase the number of rows for Entry via Excel in SSM ?

    hello
    we are facing a scenario where we need to enter the target data for more than 14000 fields.So when we open the excel ad in and trying to upload, it is accepting data for only 500 fields and the rest are not getting displayed.
    The condition is that we have to enter data via Entry and Approval and not using a procedure and multiple metric sets is not a feasible option since the number of records is large. How can the number of rows in excel be increased ?
    Vijay

    Hi Bob
    I am facing another problem....
    we have designed our model in such a way that we built it using normal procedures but the target values have to be entered using entry and Approval via Excel ad-in..
    the problem we are facing is that if we select both the actual and the target measures to load the data via Excel login then the column TARGET is getting greyed out. When we build the same model using cube builder , the column TARGET is not getting greyed out and we are able to enter data there.
    Is there any setting changes we need to make inorder to make the Entry and Approval process via Excel behave the same way when the model is built using the Cube builder ? Are there any new notes or a newer version of Excel ad in to resolve this ?
    Vijay

  • How to call a shell script via ODI

    Hi,
    I need suggestion on following issues:
    1) How to call a shell script via ODI?.. I tried using OSCommand utility .inspite of the execution being successful the data is not written into the new file in the desired format. After processing new file is created in the mentioned location but its empty.
    2) I'm calling a procedure in ODI to load data into my fact. But once the fact gets loaded i want to update the log details (num of rows processed,num of rows inserted,num of rows rejected etc) in my log table. I'm planning to use a proc for updating but need to know from where can i find these details. Is there a table in work rep which gives me these info like how we get if we execute an interface.?
    Please help me out.. Its urgent
    Regards
    Surabhi

    Hello,
    Question 1 appears a little vague, please elaborate. If you're looking to capture a return value from the command execution, you will need to pipe the return value to a file, then read from there.
    The execution information is stored in the SNP_STEP_LOG table in the Work Repository. You will need to do a series of joins to retrieve the exact table that was updated. Good luck with this...

  • Error while trying to add a SQL Script via DB02

    Good Morning and happy Sysadmin day to everyone,
    I have the following Problem regarding DB2 9.5
    I'm trying to run a SQL Script via DB02 in an ERP 6.0 System.
    I'm using DB02 -> Jobs -> SQL Script Maintenenace -> Add
    Then there is a Textfield "Script Name". When i'm using the F4-Help I'm getting the following error Message:
    List box value range for field DYN_SED-SCRIPT_NAME could not be created
    Message no. DB6PM004
    Any suggestions what might be the Error?
    Thanks in Advance
    Marco

    Are you trying to create a new Model or trying to import a Model ?

  • How to change maintenance powershell script via GPO?

    Per suggestion reposted from here: http://social.technet.microsoft.com/Forums/windowsserver/en-US/6eece9d6-a524-48aa-8e64-7554f0ec9b31/how-to-change-maintenance-powershell-script-via-gpo?forum=winserverGP
    Posted at http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/desktop-shortcuts-to-items-on-network-drives/94eddb27-342b-40fc-9ad4-677ff4ee8ebe?page=9&tm=1403700614489 originally.
    There is a very annoying "feature" in Windows 7 called BrokenShortcuts.ps1 which is being called out weekly via maintenance task and if it finds more than 4 "broken" network shortcuts it removes them all. So it means if a user at this
    moment is disconnected from the network he will lose all links to shares, network applications sitting on his desktop. Funny that there was no such script on Vista and i don't see this on Win8. On the post i have attached one user suggested to edit this script
    and change 4 to 500 or whatever high number. That's fine for one time fix. But i need to do this for 200+ users. This file cannot be simply replaced by a script, so i'm wondering is there any way to do it via GPO?
    I have already tried various startup scripts, but i'm not sure which user to put into commands.
    I need to run this on startup:
    takeown /F C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1
    icacls c:\windows\diagnostics\scheduled\maintenance\TS_BrokenShortcuts.ps1 /grant "some user":F
    copy \\share\folder$\TS_BrokenShortcuts.ps1 C:\Windows\diagnostics\scheduled\Maintenance\ /Y

    You need to take time to study how Windows does these things.  You can control them with GP which is what you asked.  The article shows you how to disable elements of the tasks.  Each task controls a script.  If you disable the task the
    script that deletes shortcuts will be stopped. Other maintenance tasks will continue to run.
    Most of your problem is that you seem to want someone to provide a magical solution.  In technology it is necessary to fully research your issues until you understand all aspects.  After fully studying the issue you should understand the possible
    solutions if they exist.
    You claim to have deployed the patch that Microsoft released to fix the issue.  You claim it didn't work.  If that is the case then you need to call MS and \p[en a support incident.  If  Microsoft determines that you are right about the
    patch not working you will not be charged for the call.
    I know that learning how to support technology is hard and frustrating for newcomers.  In time, by using these incidents to learn, you will become a seasoned technician and all of this will seem trivial.  Until then we can only suggest that you
    do things that most of us are familiar with.  We cannot fix your network for you.
    I think you haven't really posted in the GP forum but posted a question about GP in the server forum.  Try posting in the GP forum.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    Here is one answer from the GP forum:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/600ca14f-8b1b-400c-b27f-a7f5733407ac/windows-scheduled-maintenance-task?forum=winserverGP
    ¯\_(ツ)_/¯

  • Call RFC Listener via Excel

    Hi all
    Is it possible to call the Message-Listener (RFC) via Excel (VisualBasic) or do i have to use a WebService to send data from Excel to MII?
    Thanks in advance!
    Daniel

    You can send data from excel to the MII message listener with a simple http post.
    Message format requirments can be found here:
    [http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/content.htm|http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/content.htm]
    Edited by: Christian Libich on Aug 10, 2009 10:14 PM

  • Send An Internal Table Via Excel File As An Attachment of E-mail

    Hi,
    I've sent my internal table via Excel file as an attachment of email but all records of internal table are in a row of sended excel file.
    How can i send an internal table via excel file , records of internal table for each rows of excel file,as an attachment of email correctly?
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list     "   t_packing_list-doc_type   =  'XLS'.
                contents_bin               = pit_attach " this is a normal internal table.
                contents_txt               = pit_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.

    Hi,
    CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
    CONSTANTS:
    CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
    CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
          LOOP AT T_FINAL INTO WA_T_FINAL.
            CONCATENATE WA_T_FINAL-PERNR
                        WA_T_FINAL-NAME
                        WA_T_FINAL-LEVEL
                        WA_T_FINAL-POS
                        WA_T_FINAL-JOB
                        WA_T_FINAL-SECTION
                        WA_T_FINAL-DEPT
                        WA_T_FINAL-GROUP
                        WA_T_FINAL-EX_HEAD
                        WA_T_FINAL-SUPID
                        WA_T_FINAL-SUPNM
                        WA_T_FINAL-FHRNM
                        WA_T_FINAL-VACID
                        WA_T_FINAL-VAC_SECTION
                        WA_T_FINAL-VAC_DEPT
                        WA_T_FINAL-VAC_GROUP
                        WA_T_FINAL-VAC_EX_HEAD
                        WA_T_FINAL-VAC_FHRNM
            INTO T_FINAL3 SEPARATED BY CON_TAB.
            CONCATENATE CON_CRET T_FINAL3 INTO T_FINAL3.
            APPEND T_FINAL3.
          ENDLOOP.
    *Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    *Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'REPORT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE . "mail description
      W_DOC_DATA-SENSITIVTY = 'F'.
    *Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE T_FINAL1 INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( T_FINAL1 ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PT_FINAL1[].
    *Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    *Create 1st attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR = 'Application 1'.
      T_PACKING_LIST-OBJ_NAME = 'Application 1'.
      T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
      CLEAR T_PACKING_LIST.
    *Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
    Edited by: Rahul Ghosh on Apr 6, 2009 6:42 AM

  • Using report scripts in Excel - shameless plug for my blog

    I finished the second installment of my Blog, Using Report Scripts in Excel. It can be found at:
    http://glennschwartzbergs-essbase-blog.blogspot.com/

    Thank you Glenn! I just started to look into report script though we've had the tool for years. And look forward to your next installment.

  • Edit Cluster Start-stop- and Monitor-Scripts via Bash?

    Hi,
    is there a way to edit (and sync!) the Cluster-Scripts via CLI?
    Regards
    Bernd

    The short answer is no. The scripts are stored in eDir, and NCS keeps revisions of them internally. The best place to edit them is iManager. Alternatively, you can directly change the eDir attributes for those scripts while cluster is down.
    That said, everything that iManager does comes in through a file interface. If you goal is to script resource modification, you can always access the file interface directly.
    Regards,
    Changju
    Originally Posted by toblerone
    Hi,
    is there a way to edit (and sync!) the Cluster-Scripts via CLI?
    Regards
    Bernd

  • PythonWin and SAPGUI Scripting

    I was hoping that somebody else might have posted some examples of SAPGUI scripting and Python(Win) - but I couldn't find any.
    Here is a very small example of SAPGUI Scripting with PythonWin. It might serve as a quick start for others who might also share an interest in Python and GUIscripting.
    In short - I've got so far as to get basic manipulation working.
    import win32com.client
    False, True = 0 , -1
    app = win32com.client.Dispatch("Sapgui.ScriptingCtrl.1")
    conn = app.OpenConnection("D47", True)
    At this point the SAPGUI opens with the initial logon screen of the system. A connection has been created. I enter my user ID and password
    >>> print conn.Id
    returns /app/con[0]
    >>> ses = app.FindById("ses[0]")
    >>> ses.CreateSession() "opens up a new session Good!
    >>> ses.SendCommand(Command="/nIW31") "starts Tx IW31
    >>> ses.StartTransaction(Transaction="IW31") "start IW31 also
    >>> window = ses.activeWindow
    >>> print window.Id
    /app/con[0]/ses[0]/wnd[0]
    start SE38...
    >>> field = window.FindByName(Name="RS38M-PROGRAMM", Type="GuiCTextField")
    >>> print field.Id
    /app/con[0]/ses[0]/wnd[0]/usr/ctxtRS38M-PROGRAMM
    So - it seems that basic manipulation works OK
    Next step is to try some useful...
    I'll let you know how it goes..
    Andrew
    Message was edited by: Andrew Barnard
    Incorporated successful code and removed some questions which I've now solved myself. (The successful code covers the questions!).

    Further to the above, I've now been able to translate and run VBS recordings within Python with only a few minor changes:
    Here is the approach I've taken:
    "// Some introductory setup..
    import win32com.client
    False, True = 0, -1
    app = win32com.client.Dispatch("Sapgui.ScriptingCtrl.1")
    con = app.OpenConnection("D47", True)
    session = app.FindById("ses[0]")
    "// Some input steps (reading from CSV files or other sources...
    "// Then the actual GUI scripting steps..
    Some "translation" hints:
    (1) A VBS recording writes session.findById. In Python it is more accurately written as session.FindById
    (2) A VBS statement such as session.findById("wnd[0]").resizeWorkingPane 132,25,false
    would be written as session.FindById("wnd[0]").resizeWorkingPane( 132, 25, False)
    similarly:
    session.findById("wnd[0]").sendVKey 0 from VBS would be written session.FindById("wnd[0]").sendVKey( 0 )
    Other than that - all seems pretty straight forward..

  • Is it possible to execute SAPGUI scripts from java program?

    Hi everyone..
         I need to develop an java applications that executes the SAPGUI script or any technique that execute set of transaction as client.
         Is it possible to execute SAPGUI scripts from java program? if so, how it can be achieved? is there any other technique to achieve above mention scenario?.
         it will be more helpful, if docs related to that are shared..
         Thanks in advance

    Oh, bummer. Would be much more convenient if I could just use iTunes for everything. Can't stand WMP. I wonder if WinAmp might be a good compromise?
    Thanks for this answer . . .
    Sharon

  • Sapgui scripting

    Happy to meet Mr Cohr here.
    Let me tell you some comments on Sapgui scripting.
    a) The code generated is really different depending if your are using a slow or a regular lan connection. It is not that fun, I made some developments to use indexed fields instead of using names.
    schnick.schnack.scnock
    /1/2/0
    where schnick was the second control available
    schnack the third son of schnick
    schnock the first son of schnack
    it remains valid in any case.
    b) the management of session number  and connnection is not easy.
    how do you do that on your own?
    regards
    Didier

    Hi Didier,
    the problem with the low-speed-connection is a documented 'feature'. Unfortunately during a low-speed- connection the server does not send us the field names that we use to identify objects. I think according to the documentation Scripting doesn't work at all in low-speed-connection. As you noticed it's not quite that bad. The Scripting will work, but you get different Ids for your elements. These Ids follow the same concept as your solution: We use an index to identify objects on the same level of the hierarchy.
    Session and connection numbers are meaningless most of the time. They depend so much on what else you are or were doing in SAP GUI that a script relying on them will fail most of the time.
    The sample recorder generates code that will always access the first session of the first connection using app.children(0).children(0). All Ids in the scripts are then relative to this session and do not contain a session or connection number. That's ok if you work with one open session most of the time.
    We also have a property app.ActiveSession, which will return the session that is currently the topmost.
    If you need to access several sessions then it becomes difficult. You can distinguish sessions by checking the connection information in session.info or the window title, but that requires some code writing.
    Best regards,
    Christian

Maybe you are looking for

  • SQL - Multiple rows in a single column

    Hi everyone, I have a little question, The result of my query looks like this: VALOR HERRERA ANDREW CHARLES But I need they look like this: VALOR HERRERA - ANDREW - CHARLES How I can do that without using PL/SQL? Thanks for the help.

  • 64bit CR-Enterprise wont talk with 32bit data source, 32bit IDT wont use 64bit connection for universe. How do I connect them.

    Hi. I installed the full suite of tools as I am involved with a company intended to become a partner and reseller so we are trying to get everything working. SAP Crystal Server 2013 SP1 BusinessObjects Business Intelligence platform SAP Crystal Repor

  • Payment Block Type

    Dear all, Can anyone help me to understand what is the difference between payment block "A", "B" and "R"? How does the system triggered or determined which payment block to be used automatically upon posting of invoice verification? Is the type "R" s

  • Urgent Need: Query is taking time

    Hi, I have a query which is taking lots of time.Please help me in this regard... select subscripti0_.RENTAL_ID as RENTAL1_101_0_, movieprodu1_.product_id as product1_45_1_, moviepacka2_.PACKAGE_ID as PACKAGE1_47_2_, movietitle3_.TITLE_ID as TITLE1_48

  • Oo alv tree in background

    can we schedule a oo alvtree report in background. if cl_gui_alv_grid=>offline( ) is initial. CREATE OBJECT g_container_object "cl_gui_docking_container EXPORTING repid = gv_repid dynnr = '100' extension = '1500' EXCEPTIONS cntl_error = 1 cntl_system