Runtime error 619 in SAP-connected VBA macro

kpldz

New Member
Joined
Jun 2, 2016
Messages
4
Hello,
I have a VBA code, which was working all the time and it stopped a few days ago. I'm not an expert in VBA and SAP, so maybe some of you could help me.

That is part of the code which is not working:
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "sp01"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").currentCellRow = 5
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").currentCellColumn = "RQCOMPIC"
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").clickCurrentCell
'session.findById("wnd[0]/usr/lbl[14,8]").SetFocus
'session.findById("wnd[0]/usr/lbl[14,8]").caretPosition = 0
session.findById("wnd[0]").sendVKey 2

First four lines generate some spool requests, the fifth and the sixth are looking for specific row and column and the seventh one is clicking on them. While debuging, the highlighted line is the fifth one. By now, I am setting breakpoint before this and doing all the stuff by myself, but I'd like to automize it as it was before :) The one and two before last lines were always "commented"

Thank you for your help and sorry for my bad English.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi and welcome to the MrExcel Message Board.

This is the error line, then?
Code:
session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").currentCellRow = 5
I am not sure and no longer have access to SAP to check, but I would guess that selecting row 5 fails for some reason.

Are there always 5 lines in the display? If not, that could be the issue.
Is line 5 visible? Sometimes off-screen data can pose a problem.

A way to get some more insight into this problem would be to re-record the instructions then compare your new recording, which presumably works, with the stored code.

Go into SP01, and immediately after you hit "btn[8]", start recording to a new file, perform the next action then stop the recording.

Then compare the two files.

Sorry I can't be any more help.

Regards,
 
Upvote 0
Hello,
Thank you very much for your help.

Yes, that is the error line, but I am doing the same procedure with Rows 4, 3, 2, 1 and 0 and every time it returns the same error, so it should be the other problem.

I tried to re-record it, but I am afraid I have no authorization yet and I think obtaining it could take some time. Or it can be some other issue - I am doing it in a wrong way. System -> Services -> Fast Entry -> Recorder. Do you remember is it the right way to record some instructions?

Thank you for your time once more.
 
Upvote 0
Thanks for the guide.

Yes, it is visible, the other ones also. And, as I said, the macro was running perfectly last month (+ last few years while I was not responsible for that) and one day it stopped working. I don't think anything has changed in SAP, so I really do not know what could happened. I will try to re-record it using the guide you attached.
 
Upvote 0
Do you get an extra pop-up menu, perhaps, that was not catered for in the original code?

I note from the web that some people get 619 errors following Windows upgrades.

If the error is a "control not found" error it means that something in here: wnd[0]/usr/cntlGRID1/shellcont/shell").currentCellRow could not be located. If you get a pop-up then the wnd(0) will be different, for instance.

If you run your existing code up to and including the btn[8].press command then making a recording from there should give you the commands you need to continue.
 
Upvote 0
No, everything is like it was before.

But I re-recorded the code and what is interesting, it returned me that one which was turned off:
Code:
'session.findById("wnd[0]/usr/lbl[14,8]").SetFocus
'session.findById("wnd[0]/usr/lbl[14,8]").caretPosition = 0
session.findById("wnd[0]").sendVKey 2

Now I turned off that which was not working, turned on that three lines above and everything is working perfectly. Problem solved. Thank you very much for your time (and for showing me easy guide to record code in SAP, it will help me a lot in the future).
 
Upvote 0
It sounds as if when you hit btn[8], whatever that is, you could get one of two different things happen. That may be data-related.

There is a way to make steps be conditional. This is stretching the memory somewhat. Somewhere in the SAP recording options there is a wizard. It actually draws a picture of a wizard on the screen. You can put your mouse over different areas of the screen and it will report the underlying object name.

So you can use it to find screen titles for instance. Then you can click btn[8], say, ask which screen you are on and execute the appropriate block of code by using an If then Else construct.
 
Upvote 0

Forum statistics

Threads
1,224,945
Messages
6,181,935
Members
453,074
Latest member
JefersonKollet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top