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

Playing sounds through ABAP

yes_sapteam
Participant
0 Likes
3,575

Hi.

I was wandering if there is a way to play a WAV sound-file through ABAP.

There is a way to add such kind of file to the Business repository (Transaction 0FPM002) and by double-clicking it SAP knows to play it, like it knows to display a GIF object by double clicking.

The question is how to implement it in the UI.

The GIF object I'm implementing through a Custom-container that hosts the object, but this of course, does not work for the WAV object.

All ideas will be welcome.

thanx.

ayal.

Hi.

I was wandering if there is a way to play a WAV sound-file through ABAP.

There is a way to add such kind of file to the Business repository (Transaction 0FPM002) and by double-clicking it SAP knows to play it, like it knows to display a GIF object by double clicking.

The question is how to implement it in the UI.

The GIF object I'm implementing through a Custom-container that hosts the object, but this of course, does not work for the WAV object.

All ideas will be welcome.

thanx.

ayal.

5 REPLIES 5
Read only

Former Member
0 Likes
1,947

I have played sound using two techniques.

To play a wav you must envoke media player and have the wav on the PC's which will play it. This code opens media player plays the wav and then closes the player. I haven't figured out to get media player just to execute in background.

call function 'GUI_EXEC'

exporting

command = 'mplay32.exe /play /close c:\temp\info.wav'.

Read only

0 Likes
1,947

Dear Joseph.

Your response were very helpfull.

I don't know if I can use it since we need a quick response (The scenario: employee scan products and need to know if they are in warranty or out of warranty).

If we could load the program, even in the foregroud, and just send files to it, that would be much faster I believe.

I'll keep testing and will update post if I'll make progress.

thanx.

ayal.

Read only

0 Likes
1,947

If you work a solution that plays wav without a foreground application, I would be most interested as well.

In some of my sound requirements I needed to make a beep below is code on just envoking a single beep from the PC.

type-pools:

ole2.

data:

return type i,

sapinfo type ole2_object.

data:

begin of command,

command(12) type c value 'cmd /c echo ',

hex07(1) type x value '07',

end of command.

create object sapinfo 'SAPINFO' no flush.

call method of sapinfo 'EXEC' = return

exporting

#1 = command

#2 = 0.

free sapinfo.

Read only

0 Likes
1,947

it worked

Read only

jeff_broodwar
Active Participant
0 Likes
1,947

Hi Guys,

I tried to use the code echo above but cannot play a sound...I'm using windows 10.

hope you can help.

Thank you.