Skip to Content
avatar image
Former Member

Make a "beep" using the pcu00B4s speaker

Hi,

How can I force a "beep" (sound) using the pc´s speaker using ABAP ?

Thanks in adevance.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Apr 06, 2004 at 03:29 PM

    Try this:

    <i>REPORT zbeep .

    INCLUDE ole2incl.

    DATA wordbasic TYPE ole2_object.

    DATA objectvar1 TYPE ole2_object.

    CREATE OBJECT wordbasic 'Word.Basic' .

    CALL METHOD OF wordbasic 'Beep' = objectvar1

    EXPORTING #1 = '1' .

    </i>

    Incho

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I have been testing this report, but there is a problem. It opens Microsoft Word on memory and don't close it.

      I suppose that it can't work if you don't have Word installed... but I can test it

  • Apr 07, 2004 at 07:30 AM

    data: h_com1 type ole2_object.

    data beep type x.

    data command(100) type c.

    beep = '07'.

    concatenate 'cmd /c echo' beep into command separated by space.

    create object h_com1 'SAPINFO' no flush.

    if sy-subrc <> 0.

    exit.

    endif.

    if not h_com1 is initial.

    constants: sw_hide type i value 0,

    sw_shownormal type i value 1,

    sw_show type i value 5.

    call method of h_com1 'EXEC' = return

    exporting #1 = command

    #2 = sw_hide.

    if sy-subrc = 0.

    endif. "// SY-SUBRC

    free h_com1.

    endif.

    Add comment
    10|10000 characters needed characters exceeded