Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Exccel SAP scripting

Former Member
0 Likes
1,325

Hi team,

who can help me. i have toll connect to SAP from Excell.

i

then i doing  full cycle transaction and Excell created script automatically.

Example

then i generate Inpur sheet

then  i press play, and it works fine

but i need pause when script working.

exampe

IsInput ID ScriptCode

START 001

               002 MySession.findById("wnd[0]").resizeWorkingPane 82,25,false

x              003 MySession.findById("wnd[0]/usr/ctxtRMMG1-MATNR").text = "81257114"

               004 MySession.findById("wnd[0]").sendVKey 0

                  pause 10 sec

                005 MySession.findById("wnd[1]").sendVKey 0

               006 MySession.findById("wnd[0]").sendVKey 0

                007 MySession.findById("wnd[0]").sendVKey 0

              008 MySession.findById("wnd[0]").sendVKey 0

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

STOP 010

6 REPLIES 6
Read only

Former Member
0 Likes
1,105

Hi Evgeniy

For this kind of thing you need to implement some API called "Sleep"

For this add The following Code-Line Above your complete Code:

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliSeconds As Long)

you can Call it  like this:

IsInput ID ScriptCode

START 001

               002 MySession.findById("wnd[0]").resizeWorkingPane 82,25,false

x              003 MySession.findById("wnd[0]/usr/ctxtRMMG1-MATNR").text = "81257114"

               004 MySession.findById("wnd[0]").sendVKey 0

->                  Sleep 10000

                005 MySession.findById("wnd[1]").sendVKey 0

               006 MySession.findById("wnd[0]").sendVKey 0

                007 MySession.findById("wnd[0]").sendVKey 0

              008 MySession.findById("wnd[0]").sendVKey 0

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

by The way ... What Excel-file is this you are using there ???
seen it somtimes but never found out where it comes from ?
Is it a Addon ?

Read only

0 Likes
1,105

Hi Thomas,

thank for response, yes this is special addon fo excel

i have tried your advice, but unfortunatelly it isn't working.

Read only

0 Likes
1,105

Hi Evgeniy,

I do not know the addon also. You could perhaps try the following:

. . .

004 MySession.findById("wnd[0]").sendVKey 0

005 set wshell = createobject("Wscript.Shell")

006 wshell.run "c:\tmp\sleep_10000.vbs",1,true

007 MySession.findById("wnd[1]").sendVKey 0

. . .

The file sleep_10000.vbs contains only one command and it stands for example in c:\tmp:

wscript.sleep 10000

Regards,

ScriptMan

Read only

0 Likes
1,105

Hi ScriptMan,

thank you very much it's working fine!

thank you!

Read only

Former Member
0 Likes
1,105

Hi Evgeniy - is that special add-in tool available somewhere for public or was this a custom development?

Regards

Umur

Read only

0 Likes
1,105

Hi Umur,

As I know, this addon was developed special for P&G, and available for instalation  only for P&G in the local network.