Application Development and Automation 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: 
Read only

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

Former Member
0 Likes
1,154

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
Read only

Former Member
0 Likes
965

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

8 REPLIES 8
Read only

Former Member
0 Likes
965

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

Read only

0 Likes
965

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
965

- 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

Read only

Former Member
0 Likes
966

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

Read only

0 Likes
965

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

Read only

0 Likes
965

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

Read only

Former Member
0 Likes
965

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

Read only

0 Likes
965

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.