Quantcast
Channel: SCN : Discussion List - Scripting Languages
Viewing all 325 articles
Browse latest View live

SAP GUI Scripting v 620 - Cut and Paste from ALV

$
0
0

Hi Experts - I was wondering if someone out there can help me. My question is how would I copy a column of data from an ALV grid and paste it into another area (variant) using a script. I can get it to select (highlight) the column but cannot get it to copy to clipboard for later pasting. Ctrl-C is not recorded in the script. If this is not working with this version, is there a way I can get the script to keypress the letter "C" so I can do a copy through right-clicking and bringing up context menu. I tried saving it into a file and read in the file later but file saved from ALV comes with vertical bars around the data. I tried everything I could think of. The only way seems to be find the command to cut and keep it in the clipboard for pasting.

Thanks for any insight. (I also posted this question in another forum by mistake).

 

Umur


GuiXT CopyText problem

$
0
0

Hello everyone,

 

I am currently starting to use GuiXT (all components installed) and I have run into a problem with the CopyText function.

 

My goal is to have the script paste the value from Clipboard into the ZCJI3 screen element F[WBS Element]. I tried using the following:

 

CopyText ToScreen="F[WBS Element]" -fromclipboard

 

But I got an error saying:

Please specify a text variable as source or as destination.

 

I tried to circumvent this problem by first CopyTexting from clipboard to a V[ForHelp] and then setting F[WBS Element] to V[ForHelp] but that did not work either. I cannot get the CopyText function to copy anything from the clipboard no matter what I do.

 

Any suggestions as to where the problem may be?

scroll GUI table in VBS - dynamic title

$
0
0

Hi,

 

I need to loop VA02 items table to check which of the current line is selected
I saw this solution  http://scn.sap.com/thread/3316995

 

but in this solution i need to provide in this following line the title:
WshShell.AppActivate "Title of the SAP Window"

 

but the title is  which is dynamic  because every order has different title

 

Any solution for this ?

 

Thanks

 

Mark

SAP GUI Scripting Error - Invalid Syntax(Set SAPGuiAuto = GetObject("SAPGUI"))

$
0
0

Dear Experts,

 

I do vba sap gui scripting to control SAP front end to accompolish activities. In the recent months i get Error while establishing 'SAP Connection' in line

 

Sub SAP_Connection()
Set SAPGuiAuto = GetObject("SAPGUI") '~~>ERROR LINE (Invalid Syntax)
Set Application = SAPGuiAuto.GetScriptingEngine
Set Connection = Application.Children(0)
Set Session = Connection.Children(0)
End Sub

 

This is the usual code with which i work. But Occassionally it gives me this ERROR and the same persist for hours together. Please advise what i should be doing to correct this.

 

Regards,

Kumar Santharam

How to do you stop script execution when using the Scripting API inside a C# app?

$
0
0

I am using the SAP GUI Scripting API 7.10.  My program is written in C#.  I am using the following code (I have removed a lot of code for clarity sake).

 

SapROTWr.ISapROTWrapper SapROTWrapper = new SapROTWr.CSapROTWrapperClass();

object SapGuilRot = SapROTWrapper.GetROTEntry("SAPGUI");

object engine = SapGuilRot.GetType().InvokeMember("GetScriptingEngine",System.Reflection.BindingFlags.InvokeMethod, null, SapGuilRot, null);

GuiApplication GuiApp = engine as GuiApplication;

GuiConnection connection = GuiApp.Connections.ElementAt(0) as GuiConnection;

GuiSession session = connection.Children.ElementAt(0) as GuiSession;

 

As soon as the program executes the last statement above, the SAP session indicates via the 'barber pole' that a script is being executed.  Basically, after the above statement my program will look at various text fields and complete it's need for its connection to the SAP scripting engine.  The C# program will continue to run as long as the agent is logged into his/her workstation.  The SAP program will continue to be used by the agent for data entry (they are in a call center).  The 'barder pole' still continues to indicate that a script is being executed.

 

barberpole.GIF

 

Is there a way in the SAP GUI Scripting API to stop the 'script' execution?   Basically, my application is not a script and it does not look like the Scripting API was designed to handle this type of application.  The only solution I have discovered so far is to have my program terminate, but this is unacceptable.

 

Thanks,

 

Dan

Add Table Row with PHP

$
0
0

How do I add data to a table using SAPFRC ? I searched a lot but could not find results.Please help.

 

Thanks

C# Iterating Controls in the GuiUserArea

$
0
0

I am in the process of building an application in C# winforms.

If we think along the lines of meta data, I am trying to capture as much information about the user's open sessions as I can.


I have got as far as obtaining all the session info that I require.


Now I am curious as to how much information about the visible on-screen data I can capture.
My instinctive thought was to iterate the controls and seeing if I could capture text boxes and labels.

However, I am struggling.

Looking at documentation, I see there are various 'FindBy' functions, but all of these appear to be designed to be useful only if you know the names of individual controls already.


Does anyone know how I can walk/iterate through all the controls in the user area, and capture their name/value ?


Many Thanks for any tips !

:)




Code so far ....



class sap_helper


{

    

public  static Dictionary<string, SapInfoItem> get_sapInfo()

    

{

        

Dictionary<string, SapInfoItem> sapInfo = new Dictionary<string, SapInfoItem>();

        

GuiApplication sapGuiApp;


        

SapROTWr.CSapROTWrapper sapROTWrapper = new SapROTWr.CSapROTWrapper();

        

object SapGuilRot = sapROTWrapper.GetROTEntry("SAPGUI");


        

object engine = SapGuilRot.GetType().InvokeMember("GetSCriptingEngine", System.Reflection.BindingFlags.InvokeMethod,

            

null, SapGuilRot, null);


        

sapGuiApp = engine as GuiApplication;


        

int i = sapGuiApp.Children.Count;


        

if (sapGuiApp.Connections.Length > 0)

        

{

            

GuiConnection connection = sapGuiApp.Connections.ElementAt(0) as GuiConnection;


           

foreach (GuiSession child_session in connection.Children)

            

{

                

GuiSession session = child_session as GuiSession;   //connection.Children.ElementAt(0) as GuiSession;


// populate user defined structure

                

SapInfoItem sii = new SapInfoItem();  

                

sii.system_name = session.Info.SystemName;

                

sii.client = session.Info.Client;

                

sii.program = session.Info.Program;

                

sii.screen_number = session.Info.ScreenNumber;

                

sii.handle = session.ActiveWindow.Handle;

                

sii.transaction = session.Info.Transaction;

                 // add structure to dictionary collection

                

sapInfo.Add(sii.handle.ToString("X"), sii);

            

}

        

connection = null;

        

}

        

sapGuiApp = null;

        

SapGuilRot = null;

        

sapROTWrapper = null;


    

return sapInfo;

    

}

   

 


}


Scripting via Citrix Client ?!

$
0
0

Hi there-


next year we get SAP 7.3-and Windows 7 yehaw-

The only problem i have is that its running via a Citrix Server-so there is no direkt Connection possible-

neither a "Drag n Drop" is possible.


via Google i found an "older" thread in this Forum... but it didnt work for me-

 

I can "play" the Scripts if i start them via the "Script Tool" form the Citrix Frame.

 

but i have build me some Access / Excel Tools in which i have a lot of Functions and Sub's what make my life easier.

 

So if there is any way to get a Connection via VBA () i would apreciate any help or suggestions...


Sap script vba excel compare field

$
0
0

Hello,

 

I am new and doesn't know much about scripting.

But can anyone help me with a script that i can use to compare a field from sap and excel.

And if both fields are the same it must enter some data at sap

 

Example.

 

Excel

00069114_P 

 

SAP (MM02 MRP 1 and button MRP AREA)

00069114_P

 

 

0069114_P the same value

 

then it must select the field at sap.

 

 

Sorry for mine bad english.

 

Greetings Raoul

Different code when recording script

$
0
0

Dear all,

 

I'm having an issue when running a script in different computers. I see the following when recording the script:

 

My SAP it records the following:

session.findById("wnd[0]/usr/txt[5]").Text = "Mytext"

 

Other computers the code appears as:

session.findById("wnd[0]/usr/txtCYCLE").Text = "Mytext"

 

Both lines are exactly the same field but in different SAP GUI in different PCs.

They are appearing different, is there any settings that can be changed so everyone can have the same setting and run the same script? or any possible way to code the same line?

 

Thanks,

SAP Gui Script to copy text values to clipboard needed

$
0
0

Hi All -

 

New to SAP and never created a SAP GUI script before so this may be easy for some.  I have a custom page in SAP that has 20 text fields on it.  I need to be able to grab the value in any of the 20 fields and place the values into the clipboard.  There are 20 fields but not all will have values.

 

There will always be a value in the first field:

 

session.findById("wnd[0]/usr/txtZF1").text

 

but there may or may not be a value in any of the other 19

 

session.findById("wnd[0]/usr/txtZF2").text

. . .

session.findById("wnd[0]/usr/txtZF20").text

 

The values can be up to 10 characters each and when placed into the clipboard, I need the values with a CR+LF following each so that when pasted they show up as

 

VALUE1
VALUE2
VALUE3

etc...

 

Can anyone create this script for me?

 

Thanks,

 

MDR

Extracting array from SAP

$
0
0

Hello,

 

I need help in order to read data from array within SAP

 

I normally deal with tables in SAP where I have session id for each position that can easily be defined by playing with numbers in bracket .For example:

Session.findById("wnd[0]/usr/tblRSTXTCATTABLE_CONTROL/txtSELECTIONS-TDNAME[0,0]").Text

 

Now I came across what turns out to be an array. When trying to get position, only thing is I get a general shell link and nothing else, regardless to which element i interact. I get following:

session.findById("wnd[0]/usr/cntlORDER_CHECK_COND/shellcont/shell")

 

After investigating with property collector it seems this whole table seems to be an array. I can't find a way how to instruct my VBS script to read the data that is in the table. My goal is to extract all table data and copy to excel. I attach few screenshots for better understanding.

 

Any help is appreciated.

sap table array.png

array.png

Looping for order creation macro

$
0
0

Hello All,

 

I am working on creating macro where i need to enter material numbers, qties, date, etc., This is the script i got in recording.

 

[CODE]

session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB1:SAPLMEVIEWS:4001/btnDYN_4000-BUTTON").press session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4,0]").text = "Material 1" session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4,1]").text = "Material 2" session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4,2]").text = "Material 3" session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4,3]").text = "Material 4" session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/txtMEPO1211-MENGE[6,0]").text = "50 " session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/txtMEPO1211-MENGE[6,1]").text = "48 " session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/txtMEPO1211-MENGE[6,2]").text = "4" session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/txtMEPO1211-MENGE[6,3]").text = "2 "

[/CODE]

 

Could anyone help me on how to give looping to pick the details from excel and update it as line items in order.

 

Materials need to updated are dynamic.

 

[Code]

session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211/ctxtMEPO1211-EMATN[4,0]").text = "Material 1"

 

etc....

[/Code]

 

thank you.

The control could not be found by id

$
0
0

Helloeveryone, Ineed helpinvbscodebelow, I am trying to runbutalways have problemsinbold lineand the messagein SAPis"The control could not be foundbyid", I count on your helpto solve thisproblem.Thank you!

Sub Consumo_SAP()

If Not IsObject(Applicationa) Then

   Set SapGuiAuto = GetObject("SAPGUI")

   Set Applicationa = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(Connection) Then

   Set Connection = Applicationa.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 = "mb51"

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/tbar[1]/btn[17]").press

session.findById("wnd[1]/usr/txtV-LOW").Text = "DISPINSUMOS"

session.findById("wnd[1]/usr/txtENAME-LOW").SetFocus

session.findById("wnd[1]/usr/txtENAME-LOW").caretPosition = 8

session.findById("wnd[1]").sendVKey 8

session.findById("wnd[0]/usr/ctxtBUDAT-LOW").Text = "01.09.2013"

session.findById("wnd[0]/usr/ctxtBUDAT-HIGH").Text = "02.09.2013"

session.findById("wnd[0]/usr/ctxtBUDAT-HIGH").SetFocus

session.findById("wnd[0]/usr/ctxtBUDAT-HIGH").caretPosition = 10

session.findById("wnd[0]/tbar[1]/btn[8]").press

session.findById("wnd[0]/tbar[1]/btn[48]").press

session.findById("wnd[0]").sendVKey 33

session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cmbG51_USPEC_LBOX").SetFocus

session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").currentCellRow = 142

session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").firstVisibleRow = 133

session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").selectedRows = "142"

session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").clickCurrentCell

session.findById("wnd[0]/mbar/menu[0]/menu[1]/menu[2]").Select

session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select

session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").SetFocus

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[1]/usr/ctxtDY_PATH").SetFocus

session.findById("wnd[1]/usr/ctxtDY_PATH").caretPosition = 0

session.findById("wnd[1]").sendVKey 4

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[0]/tbar[0]/btn[3]").press

session.findById("wnd[0]/tbar[0]/btn[3]").press

session.findById("wnd[0]/tbar[0]/btn[3]").press

Export attachments from SAP

$
0
0

Hi Team,

 

Happy Christmas to All.

 

I want to automatically download the attachment from SAP which are uploaded through T-code FB03.

I have recorded below script for downloading the attachments but save as doalog box is not getting recorded.

 

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 = "/nfb03"

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/usr/txtRF05L-GJAHR").setFocus

session.findById("wnd[0]/usr/txtRF05L-GJAHR").caretPosition = 4

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"

session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_VIEW_ATTA"

 

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").currentCellColumn = "BITM_DESCR"

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectedRows = "0"

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").contextMenu

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectContextMenuItem "%ATTA_EXPORT"

session.findById("wnd[1]/tbar[0]/btn[0]").press

 

 

Could somone help me to get the script for downloading attachments from SAP T-code Fb03.

 

Thanks for your support.


Import attachments

$
0
0

Hi Team,

 

Happy Christmas to All.

 

I want to automatically import/upload attachments in SAP through T-code FB03.

I have recorded below script for uploading the attachments.

 

session.findById("wnd[0]").maximize

session.findById("wnd[0]/tbar[0]/okcd").text = "/nfb03"

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/usr/txtRF05L-BELNR").text = "100111498"

session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").text = "3220"

session.findById("wnd[0]/usr/txtRF05L-GJAHR").text = "2015"

session.findById("wnd[0]/usr/txtRF05L-GJAHR").setFocus

session.findById("wnd[0]/usr/txtRF05L-GJAHR").caretPosition = 4

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"

session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_PCATTA_CREA"

 

After this script line, i get the popup box which i have attached in JPG format for your reference.

 

Could any of you help me to get the complete script which will enable me to download 1 by 1 attachments on the basis of the information pulled from the excel through below script line

 

session.findById("wnd[0]/usr/txtRF05L-BELNR").text = "100111498"

session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").text = "3220"

session.findById("wnd[0]/usr/txtRF05L-GJAHR").text = "2015"

 

Thanks for your support and will be waiting for better solution on this.

Save SAP report in Excel format into specified drive

$
0
0

Hi Team,

 

I am new to SAP scripting and i have recorded below SAP Script to download a report from SAP in Excel format at specified format.

Here issue is that i am not able to record the Save as dialogue where the file needs to be saved automatically.

 

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 = "/nfbl3n"

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/tbar[1]/btn[17]").press

session.findById("wnd[1]/usr/txtENAME-LOW").text = "10290492"

session.findById("wnd[1]/usr/txtENAME-LOW").setFocus

session.findById("wnd[1]/usr/txtENAME-LOW").caretPosition = 8

session.findById("wnd[1]").sendVKey 8

session.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").currentCellColumn = "TEXT"

session.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").selectedRows = "0"

session.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").doubleClickCurrentCell

session.findById("wnd[0]/tbar[1]/btn[8]").press

session.findById("wnd[0]/mbar/menu[0]/menu[3]/menu[1]").select

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").select

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[1]/tbar[0]/btn[0]").press

 

Can anyone of you help me to provide script for the same so that report is automatically saved in specified path.

 

Thanks

Scripting suddenly not working?

$
0
0

Hi,

 

Recently our vb scripts stopped working in all our sap clients. I notice the "Script Record & Playback" button

is greyed out and we get a message now in the clients saying "Cannot find GUIxt component".

Sap basis & security said they haven't made any changes to access, we login to sap over citrix so can't

install the GUI locally, could Basis have updated the login pad or something and not installed the GUI properly?

 

Regards

 

Tony

FB03 Exporting of attachment

$
0
0

Hi guys!

 

I am currently developing a macro tool wherein I can export the attachment of a document using FB03 and saving it in a specific folder.

I was able to create one but I have the following problem:

> I don't know why there is an error with the path of the file whenever I try to link specific paths to a cell from my excel. But when I input the path directly to the VBA, it works. (hope this question was clear. )

> I am a VBA beginner so I would like to loop this macro and I want it to perform the export for a list of documents and not just one.

> Is it possible for me to insert the exported file into the excel sheet next to the document number?

 

Hope I was clear with what intend to do...Please help.

 

THANK YOU SO MUCH!!

 

 

Below are the details that I have in my Excel sheet

 

ABC
1Destination FileC:\Users\LIX2628\Desktop\PUll outs export\
2 Document NumberCo. CodeYear
1200072996u0012014

 

 

And below is the script that I used.

 

Sub FB03export()

 

 

Dim application

 

 

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]").resizeWorkingPane 196, 15, False

session.findById("wnd[0]/tbar[0]/okcd").Text = "/nfb03"

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/usr/txtRF05L-BELNR").Text = Cells(3, 2).Value

session.findById("wnd[0]/usr/ctxtRF05L-BUKRS").Text = Cells(3, 3).Value

session.findById("wnd[0]/usr/txtRF05L-GJAHR").Text = Cells(3, 4).Value

session.findById("wnd[0]/usr/txtRF05L-GJAHR").SetFocus

session.findById("wnd[0]/usr/txtRF05L-GJAHR").caretPosition = 4

session.findById("wnd[0]").sendVKey 0

session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"

session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_VIEW_ATTA"

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").currentCellColumn = "BITM_DESCR"

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectedRows = "0"

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").contextMenu

session.findById("wnd[1]/usr/cntlCONTAINER_0100/shellcont/shell").selectContextMenuItem "%BDS_START_BDN"

session.findById("wnd[0]/shellcont[1]/shell").selectedNode = "Doc-00000001"

session.findById("wnd[0]/mbar/menu[0]/menu[6]").Select

session.findById("wnd[1]/usr/sub:SAPLSPO4:0300/ctxtSVALD-VALUE[0,21]").Text = "C:\Users\LIX2628\Desktop\PUll outs export\"

session.findById("wnd[1]/usr/sub:SAPLSPO4:0300/ctxtSVALD-VALUE[0,21]").caretPosition = 42

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[0]/tbar[0]/btn[3]").press

session.findById("wnd[1]/tbar[0]/btn[12]").press

session.findById("wnd[0]/tbar[0]/btn[3]").press

 

 

End Sub

SAP GUI Scripting in unresposive and cauing Crash

$
0
0

We have an application that emulate the user interaction with SAP application and use SAP GUI scripting (GUI for window) from VB module to interact with SAP application and perform various operations on SAP window. The operation performed during that exercise are inputting values, search a node in tree, search a value in table, input value in a table cell, click on button, send virtual keys to sap window, interacting with context menu etc etc.. Operations that need to perform on SAP GUI are organized into 'tests" and are performed in a serial fashion. A same test (sequence of operations) can be performed any number of times on a given SAP application.

 

Lately, we have seen that either SAP Gui crashes or become unresponsive at random when a set of operations (test) are being performed iteratively on SAP GUI. The same test executed correctly many times but at random iteration it become completely unresponsive and hung up.

Although, SAP Gui hang up occurred at a random iteration but we've noticed that if there were two sap instances on the machine then this behavior is noticed much earlier and it is almost certain to get to this sate if an ECATT is running in another sap window but still not able to establish a particular pattern and some time same tests were executed correctly in all the above mentioned scenarios. However, when problem occurred, it usually happen just after the operations that have caused SAP GUI to do a server round trip like click on button or scrolling a table etc but still it was quite random and was unable to establish a pattern.

 

When SAP GUI hung up then not only it becomes completely unresponsive, but it also hung up any application they tries to interact with SAP GUI scripting object.  At this point, any attempt to make any references to any scripting object or even a fresh attempt to connect to scripting object model also hung up that application. The only way out at that point is to kill SAP Gui from the task manager and once SAP Gui killed then all application that was previously hang up start to resume execution!

 

SAP GUI for Window  7.1 patch 7 and path 11 are being used.

 

Any help shall be greatly appreciated.

Viewing all 325 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>