01-29-2009 5:36 PM
Hi Everyone,
I have a problem to use this function :
The unix commande is copyoutbound .
I want to copy a file automatically using reflection from a unix path to other unix path.
But it doesn`t work in this test code.
Can someone help me .
Thanks a lot
Soufiene
REPORT ZTEST_SOU.
DATA: params LIKE sxpgcolist-parameters.
DATA: return_code LIKE btcxp3-exitstat.
DATA: unix_command LIKE sxpgcolist-name.
DATA: dest LIKE rfcdes-rfcdest.
DATA: FILENAME1(128) TYPE C,
FILENAME2(128) TYPE C.
DATA: single_quote(1) TYPE c VALUE '"'.
DATA: quoted_subject(32) TYPE c.
DATA: convert_flag(1) TYPE c.
DATA: BEGIN OF tabl OCCURS 0.
INCLUDE STRUCTURE btcxpm. "Structure for Logging message from
DATA: END OF tabl. "external program to calling program
DATA: ICN LIKE ICON-ID,
I_NEXT_DATE LIKE SY-DATUM,
I_COMP_DATE LIKE SY-DATUM,
T_EXEC LIKE SY-DATUM.
UNIX_COMMAND = 'Z_HR_FILE_TRANSFER'.
FILENAME1 = '/US/hrit-sdck/trsf0019.toc'.
FILENAME2 = '/test/esc/inbound/done'.
DEST = 'cib10'.
CONCATENATE FILENAME1 FILENAME2 INTO PARAMS SEPARATED BY SPACE.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = unix_command
destination = dest
additional_parameters = params
IMPORTING
status = return_code
TABLES
exec_protocol = tabl
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.
IF return_code NE 'O'.
WRITE:/ 'UNIX status UNSUCCESSFUL TRANSFER RETURN CODE = ',return_code.
ENDIF.
01-29-2009 5:40 PM
Can you have a look at what the command name Z_HR_FILE_TRANSFER stand for in UNIX by checking in SM69?
May be it is not simply "cp" as your code is trying to use it as ?
Also what error / exception is it returning back to you?
01-29-2009 5:48 PM
Hi,
The ZHR_FILE_TRANSFERT execute unix script copyoutbound file.
The statut code is blank .
01-29-2009 5:52 PM
Can you access the shell script? I can have a look at it and tell you what might be the issue..
You may use AL11 to view the script, if that path where the script is, is already configured there.
Or else download the script from its directory using CG3Y and paste it here.
01-29-2009 6:44 PM
Script qui copie un fichier en utilisant le protocole ssh
#
Parametres Obligatoire:
$INTERFACE => Interface
$SOURCESID => SID d'origine
$TARGETSID => SID de destination
$AREA => Area
$LOCAL_AREA => Nom de repertoire qui doit figurer dans le path de source entre "interfaces" et "outbound".
$FILENAME => Filename (Could contain a wild card)
$LOCATION => Nom de repertoire qui doit figurer dans le path de destination entre "$TARGETSID" et "common"
$DIRECTION => inbound/outbound
#
01-29-2009 5:47 PM
Hi,
This is how you can troubleshoot this problem :
1. Check the command in Sm69
2. See the sy-subrc value after the function call.
3. Check the entries in the table exec_"protocol = tabl" after the function call.
You will get the root casue from the above steps.
You might get the solution as well . Or else reply back once you find the root cause.
regards,
Advait
05-12-2009 8:39 PM