• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1573
  • Last Modified:

Adding an Input box to SAP scripting. .vbs

The partial code below uses "500000001723" which can not be a static entry.  Is there a way to make this an Input box, that were ever in the code it is called, that number is used?  I need the input validated to a 12 digit number that begins with a 5

Can this even be done?  Please advise and thanks. -R-
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]/usr/ctxtRMMG1-AENNR").text = "500000001723"
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0

Open in new window

0
RWayneH
Asked:
RWayneH
  • 18
  • 17
1 Solution
 
ZvonkoSystems architectCommented:
Like this:
Dim strAENNR
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
strAENNR = session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text
If Left(strAENNR,1) = "5" And Len(strAENNR) = 12 Then
	session.findById("wnd[0]/tbar[0]/btn[0]").press
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0
End If

Open in new window

0
 
ZvonkoSystems architectCommented:
Check also this:
Dim strAENNR
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
strAENNR = InputBox("Enter AENNR with leading '5' folowed by 11 digits","500000000000")
If Left(strAENNR,1) = "5" And Len(strAENNR) = 12 Then
	session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
	session.findById("wnd[0]/tbar[0]/btn[0]").press
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
	session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0
Else
	MsgBox("Invalid AENNR entered: " & strAENNR, "Error")
End If

Open in new window

0
 
RWayneHAuthor Commented:
I see Ln1 dims it as: strAENNR.

What is Ln 17 & 18, doing.  Does this open a input box for whatever strAENNR is?  and does it remember what is entered for it to be used later in the code.

I am new to this, but understand vba  Does this insert a popup dialog box to put in the 12 digit 5 number? or does the code stop on that field so the value can be put it?  I am used to the vba Input box statements...

My example code Ln 15 thru 22 are not contained in an If..   End if.  Does this matter?  I just copied out enough lines to show an example of the 12 digit 5 number.

I notice that your code Ln 18 starts with an If.. and you added in Ln an End If...  I was wondering if I need to put the End If up higher on Ln18.5?  Or do I carry the End If to the bottom of my code.

Forgive my novice level here, just what to learn this better.

Just for future thought, can I also create a dropdown to select from?  Then run some code based on the selection, just like in vba?

Please advise and thanks for the reply. -R-

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ZvonkoSystems architectCommented:
This statement does press a button:
session.findById("wnd[0]/tbar[0]/btn[0]").press

So, that statement has to be inside the if-endif section when the entered number can be checked.

Same as that line put everything inside if-endIf what can be executed only when number is OK.

0
 
RWayneHAuthor Commented:
I see your second post has the Input and error message.  Nice!!  There are many more session.findbyId .....  statements after this... and I want to make sure the value entered is stored for later use...  I could post the whole thing but it have to wait til tomorrow, but if I have a good understanding if how to keep the If block together I should be able to do the edits. -R-
0
 
RWayneHAuthor Commented:
Was Jscript the proper group to post .vbs questions too?
0
 
ZvonkoSystems architectCommented:
The whole transaction does not make sense with wrong Number.
So an Exit Sub after the error message would be the better choice.

 
0
 
RWayneHAuthor Commented:
Last quick question.  Can I comment code lines in .vbs as I can in .vba using the '
0
 
RWayneHAuthor Commented:
On the Exit Sub, is there a way to force the proper input by sending them right back to the input?  This would eliminate the need for an Exit Sub.. correct?
0
 
RWayneHAuthor Commented:
When I tried to run this solution it failed and did not even get to the Input box.  Error: "Cannot use paraenthesis when calling a Sub -"  I was using the second solution that had the Else MsgBox ..  I can not tell you what line it is error on, as it is not vb or vba, and it does not goto to debug or the vb editor.  This uses a .vbs file to execute.

Still need some help.  Please advise and thanks. -R-
0
 
ZvonkoSystems architectCommented:
Remove the parenthesis like this:
Dim strAENNR
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
strAENNR = InputBox("Enter AENNR with leading '5' folowed by 11 digits","500000000000")
If Left(strAENNR,1) <> "5" Or Len(strAENNR) <> 12 Then
   MsgBox "Invalid AENNR entered: " & strAENNR, "Error"
   Exit Sub
End If
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0

Open in new window

0
 
RWayneHAuthor Commented:
Can you be more specific about where they were removed?  What line numbers?

Also, if there is a setFocus or select...  How do I reuse the stored value?  Maybe we can pretend that the line in my original code needed to use it?  
0
 
ZvonkoSystems architectCommented:
In my last posting in line 19 were braces () before that are now removed.

Line 17 is the InputBox() statement to store the user entered value into variable: strAENNR

Use that variable if possible otherwhere in the procedure.
0
 
RWayneHAuthor Commented:
Ok, now I see it, they where around the MsgBox statement.  Thanks.

Sorry I am not very good at this..  How in the code below, line 2 would I call that value?

Instead of the = 500000001723 would it be = strAENNR  ?

Also, thanks for moving the Exit Sub up  -R-
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = "500000001723"
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select

Open in new window

0
 
ZvonkoSystems architectCommented:
For your line 2 see my line 22 in my last post. There you see exact how you assign the variable value to the input field.

And for your "moving" of Exit Sub that was not Moving! That Exit Sub is a new exit from the procedure in case that user did not enter 12 digits with leading 5 digit. The other one or more Exit Sub stay unchanged.

0
 
RWayneHAuthor Commented:
Sorry it took so long to reply, I had issues testing this...  it is still failing.  The failure I believe is on Ln20.  "Exit Sub".  Because we are not using a Sub and End Sub, I do not think it understands what a Sub is.  -R-
0
 
ZvonkoSystems architectCommented:
The Block of code that you invoke in upper procedure is either a Sub or a Function.
That is the first statement of the block.

Perhaps is a good idea to show the whole story so I can see what exactly you are doing and what do you try to improve.


0
 
RWayneHAuthor Commented:
The whole code is below.  I was not sure that .vbs  used Sub statements..   The error reads Invalid 'exit' statement.   None of the .vbs scripts have a Sub and End Sub statement.  This was recorded in SAP.   -R-
Dim strAENNR

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

strAENNR = InputBox("Enter AENNR with leading '5' folowed by 11 digits","500000000000")
If Left(strAENNR,1) <> "5" Or Len(strAENNR) <> 12 Then
   MsgBox "Invalid AENNR entered: " & strAENNR, "Error"
   Exit 
End If

session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR

session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/txtMARC-FXHOR").text = "12"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/ctxtMARC-DISPO").text = "999"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").caretPosition = 2
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-BESKZ").text = "E"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-SOBSL").text = "50"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGPRO").text = ""
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGFSB").text = "0100"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-DZEIT").text = ""
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-PLIFZ").text = "12"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").caretPosition = 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14").select
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-STRGR").text = "Z2"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").caretPosition = 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/txtMARC-LOSGR").text = "100.000"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/chkMARC-KZKUP").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-RAUBE").text = "01"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").caretPosition = 0
session.findById("wnd[0]/tbar[0]/btn[11]").press
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").setFocus
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").caretPosition = 12
session.findById("wnd[0]/tbar[1]/btn[6]").press
session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").text = "1005"
session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").setFocus
session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").caretPosition = 4
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").caretPosition = 4
session.findById("wnd[0]/tbar[0]/btn[11]").press

Open in new window

0
 
RWayneHAuthor Commented:
I removed the Sub from Exit Sub in Ln22.  Still did not work.  Same error. -R-
0
 
ZvonkoSystems architectCommented:
OK, then you have to do it by if-then-else:
Dim strAENNR

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

strAENNR = InputBox("Enter AENNR with leading '5' folowed by 11 digits","500000000000")
If Left(strAENNR,1) <> "5" Or Len(strAENNR) <> 12 Then
   MsgBox "Invalid AENNR entered: " & strAENNR, "Error"
Else
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/txtMARC-FXHOR").text = "12"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/ctxtMARC-DISPO").text = "999"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").caretPosition = 2
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-BESKZ").text = "E"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-SOBSL").text = "50"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGPRO").text = ""
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGFSB").text = "0100"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-DZEIT").text = ""
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-PLIFZ").text = "12"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").caretPosition = 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14").select
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-STRGR").text = "Z2"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").caretPosition = 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/txtMARC-LOSGR").text = "100.000"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/chkMARC-KZKUP").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-RAUBE").text = "01"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").caretPosition = 0
session.findById("wnd[0]/tbar[0]/btn[11]").press
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").setFocus
session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").caretPosition = 12
session.findById("wnd[0]/tbar[1]/btn[6]").press
session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").text = "1005"
session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").setFocus
session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").caretPosition = 4
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").setFocus
session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").caretPosition = 4
session.findById("wnd[0]/tbar[0]/btn[11]").press
End If

Open in new window

0
 
RWayneHAuthor Commented:
Thanks.. no error now, however when the wrong 12 digit number is loaded it fails.  Is there a way to return the user back to the input box, until they enter a valid 12 digit number that begins with a 5?  -R-
0
 
ZvonkoSystems architectCommented:
Check this method:
Dim strAENNR

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
do 
  wscript.sleep 500
  strAENNR = InputBox("Enter AENNR with leading '5' folowed by 11 digits","AENNR","500000000000")
  If Left(strAENNR,1) <> "5" Or Len(strAENNR) <> 12 Then
     If Len(strAENNR) > 0 Then
       MsgBox "Invalid AENNR entered: " & strAENNR
	 End If
  Else
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
     session.findById("wnd[0]/tbar[0]/btn[0]").press
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/txtMARC-FXHOR").text = "12"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/ctxtMARC-DISPO").text = "999"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").caretPosition = 2
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-BESKZ").text = "E"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-SOBSL").text = "50"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGPRO").text = ""
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGFSB").text = "0100"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-DZEIT").text = ""
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-PLIFZ").text = "12"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").caretPosition = 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14").select
     session.findById("wnd[0]").sendVKey 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-STRGR").text = "Z2"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").caretPosition = 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/txtMARC-LOSGR").text = "100.000"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/chkMARC-KZKUP").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-RAUBE").text = "01"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").caretPosition = 0
     session.findById("wnd[0]/tbar[0]/btn[11]").press
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").setFocus
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").caretPosition = 12
     session.findById("wnd[0]/tbar[1]/btn[6]").press
     session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").text = "1005"
     session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").setFocus
     session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").caretPosition = 4
     session.findById("wnd[1]").sendVKey 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").caretPosition = 4
     session.findById("wnd[0]/tbar[0]/btn[11]").press
  End If
Loop Until strAENNR=""

Open in new window

0
 
RWayneHAuthor Commented:
New error is: Object required: 'WScript' -   Input box did not even open..  The attempt prior to this worked... just failed when an invalid 12 digit was loaded.  Not sure what is going on now.  -R-

0
 
ZvonkoSystems architectCommented:
Remove line 19
Also change line 20 to former InputBox() syntax.

0
 
ZvonkoSystems architectCommented:
Show me your current running script and explain what condition you want to be fulfiled to run once.
So if the user enters the correct input then it should do and exit.
If he does input wrong then repeat the input until what?
0
 
RWayneHAuthor Commented:
I submitted the whole script earlier in this thread.  I tested the latest solution and it appear to work, however it loops until I blank the input box.  What should happen is when a valid 12 digit number beginning with a 5 get entered into the input box, the code runs through once.  If an invalid 12 digit code is entered, reset the dialog box, and force the user to try again until a valid one is entered.  If they want to exit with entering one, they can use the "x" in the upper righthand corner of the input box.  Hope this makes sense. -R-
0
 
ZvonkoSystems architectCommented:
Make sense but I do not see where the error stated in http:#36995327 is comming from...

0
 
ZvonkoSystems architectCommented:
Check this:
Dim strAENNR

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
do 
  strAENNR = InputBox("Enter AENNR with leading '5' folowed by 11 digits","500000000000")
  If Left(strAENNR,1) <> "5" Or Len(strAENNR) <> 12 Then
     If Len(strAENNR) > 0 Then
       MsgBox "Invalid AENNR entered: " & strAENNR
     End If
  Else
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
     session.findById("wnd[0]/tbar[0]/btn[0]").press
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-PMATN").caretPosition = 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/txtMARC-FXHOR").text = "12"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2482/ctxtMARC-DISPO").text = "999"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").caretPosition = 2
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-BESKZ").text = "E"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-SOBSL").text = "50"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGPRO").text = ""
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGFSB").text = "0100"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-DZEIT").text = ""
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-PLIFZ").text = "12"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-WEBAZ").caretPosition = 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14").select
     session.findById("wnd[0]").sendVKey 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-STRGR").text = "Z2"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2492/ctxtMARC-VRMOD").caretPosition = 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/txtMARC-LOSGR").text = "100.000"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP26/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2903/chkMARC-KZKUP").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-RAUBE").text = "01"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP19/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2701/ctxtMARA-BEHVO").caretPosition = 0
     session.findById("wnd[0]/tbar[0]/btn[11]").press
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").text = strAENNR
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").setFocus
     session.findById("wnd[0]/usr/ctxtRMMG1-AENNR").caretPosition = 12
     session.findById("wnd[0]/tbar[1]/btn[6]").press
     session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").text = "1005"
     session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").setFocus
     session.findById("wnd[1]/usr/ctxtRMMG1-VKORG").caretPosition = 4
     session.findById("wnd[1]").sendVKey 0
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05").select
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMARA-MTPOS_MARA").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").text = "0004"
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").setFocus
     session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP05/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2157/ctxtMVKE-MTPOS").caretPosition = 4
     session.findById("wnd[0]/tbar[0]/btn[11]").press
     strAENNR=""
  End If
Loop Until strAENNR=""

Open in new window

0
 
RWayneHAuthor Commented:
What is the reason for the Loop Until at the end?  Is that the only way to stop it?  People that do not understand the script will loop through it over and over and think it is broke.  Is there any way to just let it run once?  If a bad number is loaded, force user back to the Input until a valid number is loaded.  Break out of the script if the "x" is clicked in the input box..  No loop please.  -R-
0
 
RWayneHAuthor Commented:
I do not know about that error now... it has not happened since I removed Ln19 in an earlier direction. -R-
0
 
ZvonkoSystems architectCommented:
So what is the state now? Does it work as  you asked me to make it?
0
 
RWayneHAuthor Commented:
Yes it works, but it loops.  I do not recall asking for it to loop, but if that is the only way to get it to stop, so be it.  There will not be a time that it needs to run more than once. -R-
0
 
ZvonkoSystems architectCommented:
Look at the bottom of the source:
     strAENNR=""
  End If
Loop Until strAENNR=""

Open in new window

If it has that assignment in upper line 1 to empty string then it should exit after one correct display.
You asked it to loop as long as wrong entries are made here: http:#36994758
0
 
RWayneHAuthor Commented:
thanks for the help. -R-
0
 
ZvonkoSystems architectCommented:
You are welcome.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 18
  • 17
Tackle projects and never again get stuck behind a technical roadblock.
Join Now