cancel
Showing results for 
Search instead for 
Did you mean: 

Sales order from excel to SAP problem

Former Member
0 Kudos

Hi Experts,

I have a excel file which will automatically create a sales order to SAP, information is picked from excel cells. My problem is, if some of the products are out of stock, back order window appears and script fails.

How to write a code, which considers following:

If some product(s) are out of stock, system would press F5, (session.findById("wnd[0]").sendVKey 5), which will approve back order.

if not, the script would ignore code (session.findById("wnd[0]").sendVKey 5) and continue

D

Accepted Solutions (1)

Accepted Solutions (1)

thomas_brutigam2
Active Participant

There is only one Possible Way to do this,

You can check if the backorder Window pops up and then do press F5 (or any Key you need ...)

PLace this code where the Window will popup


on error resume next
If err.number > 0 then
 if session.findbyId("wnd[1]").Text  = "Backorder" Then     ' here goes the Caption of the backorder-Window
          'Do some Keypress
           session.findById("wnd[1]").SendVKey 5  'dont know the KeyCode you need (dont have access to that TA
 End if
end if
On error Goto 0

Greetings

Thomas

Former Member
0 Kudos

Hi Thomas,

And thanks for your prompt reply!

I was unable to implement this. I tried this:

On Error Resume Next

If session.findById("wnd[1]/usr/txtRV03V-ARKTX") Then

session.findById("wnd[1]/usr/txtRV03V-ARKTX").SendVKey 5

End If

On Error GoTo 0

Can you please advice, if you see the error here?

Where exactly should I place the code ("wnd[1]/usr/txtRV03V-ARKTX") ?

D

thomas_brutigam2
Active Participant
0 Kudos

Hi Degnic,

since I dont have Access to that TA, i can only guess how your Code works and when something should happen...

thats why I only can guess yoour Problem...

you wrote:

I have a excel file which will automatically create a sales order to SAP, information is picked from excel cells. My problem is, if some of the products are out of stock, back order window appears and script fails.

If some product(s) are out of stock, system would press F5, (session.findById("wnd[0]").sendVKey 5), which will approve back order.

if not, the script would ignore code (session.findById("wnd[0]").sendVKey 5) and continue

So you do have a code which is allready running except for the Backorder -Problem..?

than you have to place the code where the Backorderwindow would Open...

For example ...


'Salesorder Create (I suggest F11 is pressed)
session.findById("wnd[0]").SendVKey 11
On error Resume next
'now its  time for Backorder - Check
If session.findById("wnd[1]").Text = "" Then 'here goes the Caption of the WindowBar
        session.FindById("wnd[1]/usr/txtRV03V-ARKTX").SendVKey 5
End if
On error goto 0

Thomas

Former Member
0 Kudos

Thank you Thomas for a great example! Problem solved!

D

Answers (0)