So I thought I would show the process of doing just that.
First there is a little setup work to be done.
You will need to get access to transactions SM69. These transaction give you the ability to access the operating system directly. So think before you run that delete all command. Ok now let's setup a command run transaction SM69. Select the create button following screen will appear.
I am a very lazy person so I am just going to use the basic call command that way I only have to setup one command and can call any program I want on the iseries.
Now back to ABAP
ld_comline = 'ZCALL'.
call function 'SXPG_COMMAND_EXECUTE'
exporting
commandname = ld_comline
additional_parameters = global_zft002-parameter1
operatingsystem = sy-opsys
"targetsystem = sy-host
stdout = 'X' "DESTINATION =
stderr = 'X'
terminationwait = 'X'
importing
status = ld_status "TRACE =
tables
exec_protocol = ld_output "EXITCODE =
exceptions
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
wrong_asynchronous_parameters = 12
cant_enq_tbtco_entry = 13
jobcount_generation_error = 14
others = 15.
Ok a discussion of the parameters being used is called for I guess.
The parameter "COMMANDNAME" you populate with the value of the entry you setup in SM69.
ADDITIONAL_PARAMETERS Populate a variable with the program name and any parameters that program is going to need. "TARGETSYSTEM I have not tried this vet but I am assuming that you could change this to be any ISERIES in your network.
Thats pretty much it when I did this I created a program on the ISERIES and did a send message to myself just to prove it's working.
If you would like an example program drop me a message and I would be happy to send you an example.

Custom Search