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

Call VB Script From ABAP Program

Former Member
0 Likes
1,180

Hi,

I need to call a VBS program from an abap program. This abap will run on both 4.6 and 4.0.

I would be very grateful for any suggestions on how this can be done.

Thanks and Kindest Regards

Danielle

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
790
data: commandline(1000).
commandline = v_vbs_filename. "complete path of vbs file 

  call function 'WS_EXECUTE'
       exporting
            commandline    = commandline
            program        = 'WSCRIPT.EXE'
       exceptions
            frontend_error = 1
            no_batch       = 2
            prog_not_found = 3
            illegal_option = 4
            others         = 5.
  if sy-subrc <> 0.
    raise execution_failed.
  endif.

Raja

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
791
data: commandline(1000).
commandline = v_vbs_filename. "complete path of vbs file 

  call function 'WS_EXECUTE'
       exporting
            commandline    = commandline
            program        = 'WSCRIPT.EXE'
       exceptions
            frontend_error = 1
            no_batch       = 2
            prog_not_found = 3
            illegal_option = 4
            others         = 5.
  if sy-subrc <> 0.
    raise execution_failed.
  endif.

Raja

Read only

0 Likes
790

Hi Raja,

Please can you tell me how a VB script can be called on a different server ?

Regards,

Shantanu R. Godbole

Read only

Former Member
0 Likes
790

Thanks Raja,

Worked perfectly. Much appreciated!!