‎2007 Jul 03 9:01 PM
Hi, I have a request to execute a script command in a remote unix server, should i use 'call function ...destination'?
Thanks.
Legend.
‎2007 Jul 03 9:04 PM
Create a system command sm69 and then execute this command in your program using SXPG_COMMAND_EXECUTE function module. There is documentation associated with this function module.
‎2007 Jul 03 9:04 PM
Create a system command sm69 and then execute this command in your program using SXPG_COMMAND_EXECUTE function module. There is documentation associated with this function module.
‎2007 Jul 03 9:11 PM
‎2007 Jul 06 6:12 PM
I created the external command and ran that FM, but the sy-subrc = 6 after executing.
Can you advise what caused the failure?
I also found the statement:
call 'SYSTEM' id 'COMMAND' field cmd id 'TAB' field result-sys.
do they both work?
Thanks.
Legend.
‎2007 Jul 06 8:07 PM
Use like this :
data: begin of t_tabl occurs 0,
line(132),
end of t_tabl,
data: lc_command(100) type c.
Get all the file name falling under specified directory...
lc_command(3) = 'ls '.
lc_command+3(45) = p_dir. " Directory of file path
call 'SYSTEM' id 'COMMAND' field lc_command
id 'TAB' field t_tabl-sys.
Check any files exits in the directory.......................
if t_tabl[] is initial.
message e006 with 'No files exist in the specified directory ' p_dir.
endif.
Do not look for sy-subrc ,here sy-subrc will not work.
Thanks
Seshu
‎2007 Jul 03 9:09 PM