Quantcast
Channel: SCN : Unanswered Discussions - Scripting Languages
Viewing all 376 articles
Browse latest View live

Naim Jusufi

$
0
0

hi there,

 

can anyone help me to generate a dictionary structure and a subroutine.

 

 

Steps:

 

Create a dictionary structure in your local objects folder using SE11

Create a new program

Declare the new dictionary structure under tables: my_structure.

Create a subroutine within your program.

In your form select the corresponding fields of the database table kna1 into a local structure by using the comand Select Single.

Call your form in you program.


Question

$
0
0

hi there,

 

how to create a dynpro and display the selected data from previous task.

 

Steps:

 

create a regular dynpro in your se80 workbench.

draw a button on your dynpro to start the selection of the data.

use your structure declared under tables for your dynpro fields.

create a pai and a pbo module

use the pai module to call your form

call your dynpro in your program

set all your fields read-only except kunnr

the kunnr field should be used as parameter to select the correspondind...

Loop trough a Splitter_Container

$
0
0

Hi,

 

how can i loop trough a Splitter_Container???

Set SPLITTER = .findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\10/ssubSUBSCREEN_BODY:SAPMV45A:4152/subSUBSCREEN_TEXT:SAPLV70T:2100/cntlSPLITTER_CONTAINER/shellcont/shellcont/shell/shellcont[0]/shell")
Set CONTAINER = .findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\10/ssubSUBSCREEN_BODY:SAPMV45A:4152/subSUBSCREEN_TEXT:SAPLV70T:2100/cntlSPLITTER_CONTAINER/shellcont/shellcont/shell/shellcont[1]/shell")
SPLITTER.selectItem "ZR03", "Column1"
SPLITTER.doubleClickItem "ZR03", "Column1"
CONTAINER.Text = "New Text"

SplitterControl.jpg

Thank you very much :-)

Error with SAPRFC

$
0
0

Hello, I'm developing a PHP aplication that connects with SAP using the SAPRFC library but when I'm trying to execute the SAP function from the saprfc_test.php file, I'm getting this error:

 

RFC Error Info : Key : RFC_IO10 Status : CODE=CM_DEALLOCATED_NORMAL STATUS=CM_NO_STATUS_RECEIVED DATA=CM_COMPLETE_DATA_RECEIVED ID=89762324 Message : Internal: IO HANDLE=22 DRV=EXT LINE=1355 CODE=10 : GET ID=ffff LINE=1080 CODE=3

 

Does anyone have an idea what could this mean? Thanks in advanced!!

Beginner: Pull data from excel spreadsheet and loop transactions

$
0
0

I am very new to both scripting and SAP and don't know the proper terms for what I'm trying to do, so the search function wasn't much help. If someone can point me in the right direction that would be great.

 

I am currently trying to update a list of material codes in ME11 and MM02 from an excel spreadsheet with the data for all the fields I'm changing. I currently have recorded scripts that input anything that remains constant on the transactions, but on each one, there is at least one unique field. I'm hoping to have a script that will reference the excel spreadsheet and put a specific cell in the SAP field, save the transaction and then loop for each row in the excel spreadsheet. Any help or a point in the right direction would be appreciated.

PHP and BAPI_CUSTOMER_CREATEFROMDATA1 problem

$
0
0

Hi guys,

 

I am having difficulties creating customers via BAPI_CUSTOMER_CREATEFROMDATA1, the function is working without problems in SE37 but not via RFC.

 

I keep getting the following error.

 

Errors found during saprfc-Calls:

 


saprfc::callFunction('BAPI_CUSTOMER_CREATEFROMDATA1')
Import-Parameter=PI_PERSONALDATA could not be set. (Does it exist?)

 

My parameters are.

 

$personal_data['PI_PERSONALDATA'] = array(    'FIRSTNAME'     =>  'ZSOLDOS',    'LASTNAME'      =>  'SZABOLCS TEST',    'DATE_BIRTH'    =>  '26.05.1987',    'CITY'          =>  'WEBSERVICE LAND',    'STREET'        =>  'DECEBAL 20/6',    'COUNTRY'       =>  'RO',    'COUNTRYISO'    =>  'RO',    'REGION'        =>  'MS',    'TEL1_NUMBER'   =>  '0751380275',    'E_MAIL'        =>  'szabi@bysobi.com',    'LANGU_P'       =>  'RO',    'LANGUP_ISO'    =>  'RO',    'CURRENCY'      =>  'RO'
);


$personal_data['PI_COPYREFERENCE'] = array(
    'SALESORG'      =>  'BYSO',    'DISTR_CHAN'    =>  '01',    'DIVISION'      =>  '01',    'REF_CUSTMR'    =>  '600102'
);




$result = $b2c->sapConnection()->callFunction("BAPI_CUSTOMER_CREATEFROMDATA1",    array(        array("IMPORT","PI_PERSONALDATA",$personal_data['PI_PERSONALDATA']),        array("IMPORT","PI_COPYREFERENCE",$personal_data['PI_COPYREFERENCE'])    )
);


$result_commit = $b2c->sapConnection()->callFunction("BAPI_TRANSACTION_COMMIT",         array(            array("IMPORT","WAIT", ""),            array("EXPORT","RETURN", array()),         )); 

if($b2c->sapConnection()->getStatus() == SAPRFC_OK) {    print_r($result);
} else {    echo 'nope';
}

How to open a file "into SAP"

$
0
0

Hello,

I have to import files into SAP "data storage" (cv01n).

 

One step is to select the file.

In script it looks like this:

 

      'Open Browser to select the requested file

      Session.findById("wnd[0]/usr/tabsTAB_MAIN/tabpTSFILES/ssubSCR_MAIN:SAPLCV110:0103/btnPB_FILE_BROWSER").press

      'Check in File

      Session.findById("wnd[0]/usr/tabsTAB_MAIN/tabpTSFILES/ssubSCR_MAIN:SAPLCV110:0103/btnPB_CHECKIN").press

 

SAP-CV01N.png

My questions are:

Is it possible to define the path which the <FILE_BROWSER> will open?

Is there a possibility to define even the filename in advance or even "complete the open command" automatically?

 

In my script I have all the information available, but the user must navigate in the dialog to the right file and confirm it.

For better comfort, I look for a solution to overcome that.

 

Is there a "HELP", where I could find something about this topis?

 

Thanks for reading and thinking, Franz

SAP GUI Script Development tool on Windows 7 and SAP GUI 7.30

$
0
0

Hi members,

 

I have the following question pertaining to the standard SAP GUI Script development tool. I hope someone has hit this already and can provide an answer.

 

Is there a way to enable the SAP Script Development tool (the Merlin character which allows you to do click tests and examine GUI properties and SAP transaction) if you run SAP GUI for Windows 7.30 and Windows 7?

 

I did my homework and searched the SCN. I already know about:

  • Microsoft KB 969168 Microsoft Agent-enabled programs do not work in Windows 7; I installed the hotfix on my Win 7 computer, but it does not help
  • SAP Note 1633639 - Script Development Tool disabled from Windows 7; give you a background of the issue but refers to SAP GUI 7.20
  • I know about Scripting Tracker Lite and Bebo, both tools made and promoted by Stefan Schnell; I use them but switching back and forth between 2 apps is not optimal. Also you have to rescan all the active connections when you change the screen and this takes time if you run 6 connections/ Still good they exist.

 

I did not find any info for Windows 7 and SAP GUI 7.30

Thanks a bunch.


Focus on SAP window using VBA

$
0
0

Hi Im new here.

Can somebody help me with excel and SAP junction through VBA? I beg for help with focusing on another window during script being processed. Its SAP window. Its SAP ARP - transaction CO02 - change of order - adding an attachment. Im in the final step where small import window pops up and I just need to insert or search for the path of the file I want to add. Its kind of microsoft window - on the left are large buttons with desktop, documents and 2-3 more. But its called Import on the left upper corner. I want to use the sendkeys prompt - the path will be allways the same eg C:\File\xxx.pdf. So I thought it will be very easy just call the macro recorded in sap until the window shows, then sendkeys "C:\File\xxx.pdf" then continue with SAP macro to okay it and save - end.

Problem is when the window show and I sendkeys - it does not write anything in path box. When i run the macro until the window shows and type something on kb it write normally in the box.

 

Can somebody help me please with this? Ive tried an application"focus" ("microsoft") prompt (quotes are for I cant remember the exact phrase I dont have the excel and file with macro here or SAP) It does not help... maybe because its not windows window but SAP window.

Windows 7, Office 2007, work computer - so I dont have access to all OS features, but I think it does not matter. 

If somebody can tell me how the prompt is called in sap, then it will be easy: Something like: findbyID.......importwindow.input.text = the way to the file...

:

Thanks very much for your replies.

Mirek

Reading Excel Cell values using VB script

$
0
0

Hi All,

 

I am currently try to work on a blog where its aim to input the values from excel and based on the values it has to get the values from DB in sap and display it in the Output portion of the excel as mentioned in the following blog http://scn.sap.com/docs/DOC-31015. I have created the FM and done the basic things mentioned in the blog but I am facing an error "Run Tme Error '40036' Application-defined or object-defined error". Please find my code below and help to resolve the issue.

Attachment.png

With Regards,

Giriesh M

How to connect Access VBA with a customer specific function module using RFC

$
0
0

Hello,

 

I try to fetch some data from our SAP ERP system by using a customer specific function module.

The connection via RFC is working. Unfortunately, after trying to add the SAP function module to the connection, the result is still nothing.

 

I have a VBA function for the connection. The return value of this function is the working connectin to SAP system.

 

Private Function sapConnect() As Object
'---------------------------------------------------------------------------------------
' Procedure : sapConnect
' Author    : Steffen Retz
' Date      : 22.11.2013
' Purpose   :
'---------------------------------------------------------------------------------------
'
Dim sapConnection   As Object
Dim sapFunction     As Object
Dim RetVal          As Variant
Dim ME5             As Variant
Dim strSAP_System   As String   On Error GoTo sapConnect_Error
'Set sapConnect = False
Set sapFunction = CreateObject("SAP.Functions")
Set sapConnection = sapFunction.Connection
With sapConnection    .ApplicationServer = "xx.xxx.xx.xx"    .SystemNumber = xxx    .System = "xxx"    .client = "xxx"    .Language = "EN"    .User = m_strcUserName 'InputBox("Please insert your SAP user name", "SAP Connection: User")    '.Password = InputBox("Please insert you SAP password", "SAP Connection: Password")    RetVal = SysCmd(acSysCmdSetStatus, "Connecting to " & strSAP_System & " . . . ")            If .logon(0, True) <> True Then        If .logon(0, False) <> True Then            'No connection -> Error            .LastError             Exit Function        End If                Set sapConnect = sapFunction    End If    
End With
sapConnect_Exit:    On Error Resume Next    Exit Function    
sapConnect_Error:    Err.Number = vbObjectError + 1    Err.Source = m_strcClassName    Err.Description = "Error" & " <<>> " & Err.Description    LogError Err, Critical, "sapConnect"    GoTo sapConnect_Exit       On Error GoTo 0
End Function

 

The other function is using the returning connection to retrieve the data from the SAP system.

After adding the function module to the connection, I recognized that the object MyFunc is still empty.

 

Set MyFunc = R3.Add("Z_ZZMHP_HR_SAP_NOTES_READ")

 

I also tried this with RFC_READ_TABLE and BAPI_USER_GETLIST. Both function are working.

 

 

Private Function RFC_SAP_NOTES_READ(sapConnection As Object, arrSAPNotes As Variant) As Boolean
'---------------------------------------------------------------------------------------
' Procedure : RFC_SAP_NOTES_READ
' Author    : Steffen Retz
' Date      : 03.12.2013
' Purpose   : FM in SAP: Z_ZZMHP_HR_SAP_NOTES_READ
'---------------------------------------------------------------------------------------
'
 Dim strTemp As String
 Dim RetVal As Variant, nSecondsLeft As Long, nTotalSeconds As Long
 Dim R3, MyFunc, App As Object
 Dim j As Integer
' Define the objects to hold IMPORT parameters
 Dim IT_SAP_NOTES_KEY As Object
' Define the objects to hold the EXPORT parameters
 Dim ZZMHP_TT_HR_SAP_NOTES_ERRORMSG As Object
 Dim ET_SAP_NOTES As Object
 ' Use to write out results
 Dim ROW As Object
 Dim Result As Boolean
 Dim iRow, iColumn, iStart, iStartRow, iField, iLength As Integer   On Error GoTo RFC_SAP_NOTES_READ_Error
If sapConnection Is Nothing Then    Set R3 = sapConnect
Else    Set R3 = sapConnection
End If
 '*****************************************************
 'Call RFC function Z_ZZMHP_HR_SAP_NOTES_READ
 '*****************************************************
 Set MyFunc = R3.Add("Z_ZZMHP_HR_SAP_NOTES_READ")
'EXPORTS
Set IT_SAP_NOTES_KEY = MyFunc.exports("IT_SAP_NOTE_KEY")
IT_SAP_NOTES_KEY.Value = arrSAPNotes
'IMPORTS
Set ZZMHP_TT_HR_SAP_NOTES_ERRORMSG = MyFunc.imports("ZZMHP_TT_HR_SAP_NOTES_ERRORMSG")
Set ET_SAP_NOTES = MyFunc.imports("ET_SAP_NOTES")
 RetVal = SysCmd(acSysCmdSetStatus, "Extracting " & j & " . . . ")
MyFunc.Call
' Result = MyFunc.Call
' If Result = True Then
'     Set DATA = MyFunc.Tables("DATA")
'     Set FIELDS = MyFunc.Tables("FIELDS")
'     Set OPTIONS = MyFunc.Tables("OPTIONS")
' Else
'     MsgBox MyFunc.EXCEPTION
'     R3.Connection.LOGOFF
'     Exit Function
' End If      
 Close #2
 RetVal = SysCmd(acSysCmdRemoveMeter)
 RFC_SAP_NOTES_READ = True
RFC_SAP_NOTES_READ_Exit:    On Error Resume Next    Exit Function    
RFC_SAP_NOTES_READ_Error:    RFC_SAP_NOTES_READ = False    Err.Number = vbObjectError + 1    Err.Source = m_strcClassName    Err.Description = "Error" & " <<>> " & Err.Description    Debug.Print Err.Description    LogError Err, Critical, "RFC_READ_TABLE"    GoTo RFC_SAP_NOTES_READ_Exit       On Error GoTo 0
End Function

I can't find the error. Do I have to use a specific method for a customer specific fuction module?

Or is it not possible to use a customer specific function module?

 

Thanks for any help.

 

Best regards,

 

Steffen

Naim Jusufi

$
0
0

hi there,

 

can anyone help me to generate a dictionary structure and a subroutine.

 

 

Steps:

 

Create a dictionary structure in your local objects folder using SE11

Create a new program

Declare the new dictionary structure under tables: my_structure.

Create a subroutine within your program.

In your form select the corresponding fields of the database table kna1 into a local structure by using the comand Select Single.

Call your form in you program.

Is it possible to use RFC_READ_TEXT using existing connection??

$
0
0

Hello all!  I am new to VBA and know very little, your assistance is greatly apprecitated.

I am trying to create a macro that will copy long texts from a PIR.  The only way I have found to do it so far is using RFC_READ_TEXT.

My macro starts out using a SAP screen/connection that I already have open but when it gets to the RFC_READ_TEXT it wants me to sign in again.

Is there another way to call the read_text function module that will use my pre-existing conection?

Here is what I haave so far.

 

Sub pirCopier()

Dim Application, SapGuiAuto, Connection, session
Dim SID, bh1Wnd, CollCon, i, CollSes

Dim materialGroup
Dim vendor
Dim orderUnit
Dim sortTerm
Dim piDelivTime
Dim shippgInstr
Dim condition1
Dim condition2
Dim condition3
Dim condition4
Dim condition5
Dim description
Dim noteText
Dim poText


Set SapGuiAuto = GetObject("SAPGUI")
Set Application = SapGuiAuto.GetScriptingEngine
  Set CollCon = Application.Connections()
      If Not IsObject(CollCon) Then
        Exit Sub
      End If

 

'- Find R3 window -------------------------------------------
        For i = 0 To CollCon.Count() - 1

          Set Connection = Application.Children(CLng(i))
          If Not IsObject(Connection) Then
            Exit Sub
          End If

          Set CollSes = Connection.sessions()
          If Not IsObject(CollSes) Then
            Exit Sub
          End If
       
                    Set session = Connection.Children(0)
                    SID = session.info.systemname()
                   If Not IsObject(bh1Wnd) Then
                    If SID = "BH1" Then Set bh1Wnd = Application.Children(CLng(i)) 'R3
                   End If
        Next

If Not IsObject(bh1Wnd) Then
MsgBox "SAP R/3 window not found. Please open at least on session of SAP R/3."
Exit Sub
End If

 

'-------------- start pirCopier -------------

Set Connection = bh1Wnd
Set session = Connection.Children(0)

'open pir to be copied
session.findById("wnd[0]/tbar[0]/okcd").text = "/nME13"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/radRM06I-NORMB").Select
session.findById("wnd[0]/usr/ctxtEINA-LIFNR").text = ""
session.findById("wnd[0]/usr/ctxtEINA-MATNR").text = ""
session.findById("wnd[0]/usr/ctxtEINE-EKORG").text = "1001"
session.findById("wnd[0]/usr/ctxtEINE-WERKS").text = "0002"
session.findById("wnd[0]/usr/ctxtEINA-INFNR").text = Range("B2")
session.findById("wnd[0]/usr/radRM06I-NORMB").SetFocus
session.findById("wnd[0]").sendVKey 0

vendor = session.findById("wnd[0]/usr/ctxtEINA-LIFNR").text
desciption = session.findById("wnd[0]/usr/txtEINA-TXZ01").text
orderUnit = session.findById("wnd[0]/usr/ctxtEINA-MEINS").text
sortTerm = session.findById("wnd[0]/usr/txtEINA-SORTL").text
session.findById("wnd[0]/tbar[1]/btn[7]").press
piDelivTime = session.findById("wnd[0]/usr/txtEINE-APLFZ").text
shippgInstr = session.findById("wnd[0]/usr/ctxtEINE-EVERS").text
session.findById("wnd[0]/tbar[1]/btn[8]").press


'--- start of copy long texts ---------------------------------------------

Set funcControl = VBA.CreateObject("SAP.Functions")
Set RFC_READ_TEXT = funcControl.Add("RFC_READ_TEXT") '<------------ This is where it wants me to re sign in
Set tblText_Lines = RFC_READ_TEXT.Tables("TEXT_LINES")

 

'----- copy po long

 

text from pir ---------

tblText_Lines.AppendRow
tblText_Lines(1, "TDOBJECT") = "EINE"
tblText_Lines(1, "TDNAME") = Range("B2") & "100100002"
tblText_Lines(1, "TDID") = "BT" 'PO text

If RFC_READ_TEXT.Call = True Then
   
        If tblText_Lines.RowCount > 0 Then
   
            For intRow = 1 To tblText_Lines.RowCount ' Change Next line to write a different header row
       
                If intRow = 1 Then
                poText = tblText_Lines(intRow, "TDLINE")
                Else
                poText = poText & vbCrLf & tblText_Lines(intRow, "TDLINE")
                End If
            Next
        Else
       
            GoTo poTextEnd
   
        End If

    Else

        MsgBox "ERROR CALLING SAP REMOTE FUNCTION CALL FOR PO TEXT"

    End If
   
    'Result Table set back
Do Until tblText_Lines.RowCount = 0
     Call tblText_Lines.rows.Remove(1)
Loop

poTextEnd:


End Sub

How to Create Script Mass User Login & Doing Transaction

$
0
0

Hi SAP Experts,

 

I have a activity to do performance test with 100 concurrent users.

But unfortunately i have no supplement PT software for this activity (Like Rational PT or Loadrunner).

So i think i will do it with sapgui script.

Is it possible to create vb script (SAP GUI Scripting) to fulfill my requirement to do this activity. If yes how to create this script.

 

Thanks & Best Regards,

Husin

Column name of a Table

$
0
0

Hello,

i am a biginner.

 

i use a Windows Visual Basic script.

 

 

the script calls a SAP Table

I have to read the Content of some cells.

But sometimes a User have an other Layout of the table and the Column is not listetd.

How can i check the Column name is available

 

how can i check the column Names of the Table.

 

session.findbyid("Wnd[0]......").columns(3).title

 

don't work.

Laufzeitfehler 438

 

Antworten gerne auch in deutsch.


error on calling a function from vba

$
0
0

hello guys

 

I have an ABAP function developed on our SAP environment called /TENR/CFBPP_SAP_ACT_TO_SQE

It works fine when called from SE37 transaction, but when I call it from my VB app, I get a SYSTEM_FAILURE error at MyFunC.Call

 

I guess I can call it just like a BAPI function, so I created the code above (I supressed the connection because it works)

-----------------------------------------------------------------------------------------------------

...

        MyFunC = R3.Add("/TENR/CFBPP_SAP_ACT_TO_SQE")

 

        MyFunC.Exports("I_PEP").value = "P/87620/E.AAF"

        MyFunC.Exports("I_CLASE_ORDEN").value = "CF02"

 

 

        'MyFunC = R3.Add("BAPI_USER_GETLIST")

        'MyFunC.Exports("MAX_ROWS").value = "100"

        'MyFunC.Exports("WITH_USERNAME").value = ""

 

        If MyFunC.Call Then

 

           Dim objReturn As Object

           'objReturn = MyFunC.TABLES("USERLIST")

           objReturn = MyFunC.imports("T_ACTIVIDADES")

           Return objReturn.rowcount

 

        Else

            Return MyFunC.Exception

        End If

-----------------------------------------------------------------------------------------------------

 

when I toogle to call BAPI_USER_GETLIST which have similiar params, it works fine

 

I checked function name and param names and they are ok.

Check other Modus is aktually opend, and close Modus

$
0
0

Hello,

 

does everyon know a possibility to check if an other Modus is aktually opend.

And if an other Modus is open how can i close the Modus.

I cant find any documentation.Modus.jpg

 

 

Regards,

Emil

Script pauses when windows dialog box asks for file save location...

$
0
0

Whenever i attempt to export a report from SAP to excel using VBA the script pauses because a windows dialog box opens that prompts the user to select a file name and location...As a work around to this issue i would like to select the columns, copy and paste them into excel.  I have been successful in selecting all the columns

 

with session.    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "EBELP"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "BSART"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "WERKS"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "MATNR"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "TXZ01"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "BEDNR"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "AUFNR"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "NAME1"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "PMATN"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "AEDAT"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "ZSLFDT"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "MENGE"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "NETPR"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "STPRS"    .findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "ZWEMNG"
end with

However, i cannot find the vkey to copy the data.  Can anybody help?

CreateObject("SAP.Functions") with existing connection

$
0
0

Hello together,

 

until today i was only working with the Objects from SAP GUI Scripting. A new problem at work forces me to learn more about SAP.Functions

 

Right now my problem is to give this object a valid connection. I tryied to assign a existing and connected sap gui connection, but this doesnt work:

 

Sub Test()

    qp.SAPGUI.SetGuiConnection "PS5", 470

 

 

    Dim oFunctions As Object

    Set oFunctions = CreateObject("SAP.Functions")

   

    'Verbindung herstellen

    oFunctions.Connection = qp.SAPGUI.GuiConnection   'ERROR IN THIS LINE

   

    'Funktion zu FUNCTIONS-Object hinzufügen

    Dim oData As Object

    Set oData = oFunctions.Add("/SIE/AD_ZPP_VERB_U_BEST_AUSG")

   

    'Funktion aufrufen

    oData.Call

End Sub

 

I cant login with a username and password, it is only allowed to use open connections. We use PKI Cards instead of usernames and passwords.

 

 

Anyone who knows a way to solve this problem?? Thanks so far!

Is there a good way to get an xpath reference from SAP for use in SAP GUI?

$
0
0

I am doing a fair bit of SAP GUI scripting with VBA.

 

Most of the time I record an SAP GUI script via the recorder and edit it appropriately. However, increasingly often as I am familiar with SAP GUI and begin modifying existing scripts, I want to know the x-path reference for menu items so I can incorporate them in my scripts.

 

For example, my most recent pursuit was a confirmation yes/no button which resulted with:

 

    m_Session.findById("wnd[1]/usr/btnSPOP-OPTION1").press

 

in exploring the SAP interface I've not been able to find a good way to get this path (wnd[1]/usr/btnSPOP-OPTION1) from SAP. I know I can go into m_Session on the VBA side with the properties explorer and eventually get the path in a format like - "/app/con[0]/ses[0]/wnd[1]/usr/btnSPOP-OPTION1" - which kind of works. This is a huge hassle to gothrough in many cases 4+ layers to get there though. Plus many of the SAP field names aren't exactly the most clear and it takes a while to figure out what the correct one is.

 

I'd like to be able to do something similar to the F1 (help) --> technical information query which can give some of the information I want.

 

Is this possible to get from SAP? Or should I just write a "SAP GUI scraper" in VBA which reports out ALL x-paths contained within the session object and try to get enough information to make this meaningful?

Viewing all 376 articles
Browse latest View live