cancel
Showing results for 
Search instead for 
Did you mean: 

T-code KSII script need further help

Former Member
0 Kudos

Hi, i recently posted discussion "T-code KSII script post despite errors".  I have a follow-on question. Sometimes, when i try to post data, there are errors, so I have this code: 'This posts the data despite the errors If session.findById)"wnd[1]/usr/txtSPOP-TEXTLINE1").text = "Do you want to post data despite errors" Then session.findById("wnd[1]/usr/btnSPOP-OPTION1").press End If 'This selects the enter button when a pop-up box comes up to tell you that the data has been posted If session.findbyId("wnd[1] /usr/txtMESSTXT2").txt = "Data has been posted" Then session.findById("wnd[1]/tbar[0]/btn[0]").press But, when i try to post the data that doesn' t have "errors", the first pop-up box that says "Do you want to post data despite errors" does not pop-up.  Which means that only the second pop-up box comes up ("Data has been posted"). How can i edit the code to take care of both situations? I tried this: If session.findById("wnd[1]/usr/txtSPOP-TEXTLINE1").text = "Do you want to post data despite errors" Then session.findById("wnd[1]/usr/btnSPOP-OPTION1").press Else If session.findById("wnd[1]/usr/txtMESSTXT2").text = "Data has been posted" Then session.findById("wnd[1]/tbar[0]/btn[0]").press End If But it didn't work. Can anybody help?! Thanks, Chrissy

Accepted Solutions (1)

Accepted Solutions (1)

script_man
Active Contributor
0 Kudos

Hi  Chrissy,

It's all right, as you have done it. Now you need only add the following commands:

. . .

on error resume next

 

If session.findBy("wnd[1]/usr/txtSPOP-TEXTLINE1").text = "Do you want to post data despite errors" Then
session.findById("wnd[1]/usr/btnSPOP-OPTION1").press

End If

 

If session.findbyId("wnd[1]/usr/txtMESSTXT2").text = "Data has been posted" Then
session.findById("wnd[1]/tbar[0]/btn[0]").press

End if

on error goto 0

. . .

Regards,

ScriptMan

Former Member
0 Kudos

Scriptman,

Thank you very much for the answer. It works perfectly now and you have taught me valuable information. 

Thanks,

Chrissy

Answers (0)