Application Development 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: 

how can I do this small visual basic code in abap ?

Former Member
0 Kudos

Hi,

how can I do this small visual basic code in abap ? Is it possible ?

Dim msg, sapi

msg=InputBox("Enter your text","Talk it")

Set sapi=CreateObject("sapi.spvoice")

sapi.Speak msg

Best Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Looks like your VB code reads out the entered text. i dont think there is anything like that in SAP

8 REPLIES 8

Former Member
0 Kudos

Could you explain what that code does, step by step?

0 Kudos

ok,

  • get text from user

  • speak text which user write using sapi.spvoice object

Actually , I need a little code ;

user enter text , and the program is spoken to this text.

Edited by: onur saruhan on Aug 10, 2009 3:30 PM

raymond_giuseppi
Active Contributor
0 Kudos

- The fist part with one of the multiple POPUP function modules (eg TRM_POPUP_TEXT_INPUT)

- The second part with OLE ? ([ABAP as OLE2 Automation Controller|http://help.sap.com/saphelp_nw04/helpdata/EN/db/9987b3c3cf11d194ad00a0c94260a5/frameset.htm])

Regards,

Raymond

Former Member
0 Kudos

Looks like your VB code reads out the entered text. i dont think there is anything like that in SAP

0 Kudos

You are right . That's why I can not use execute function for *.vbs file like ws_execute . Is there any way ?

0 Kudos

onur saruhan ,

You could call a VB executable using CL_GUI_FRONTEND_SERVICES=>EXECUTE, passing text you want read aloud in the parameter "PARAMETER". The VB executable would be executed on the frontend, speaking the text you passed. SAP would not speak the text, Windows would.

Bruce

Former Member
0 Kudos

Thanks for all your replies. I solved another way to this problem.

0 Kudos

include ole2incl.


data : ole type ole2_object,
voice type ole2_object,
text   type string.


create object voice ‘SAPI.SpVoice’.
text = ‘Meeting Start time should be less than meeting End Time.’.
call method of voice ‘Speak’ = ole

exporting #1 = text.