Question:
I need to XCOM files from an ABAP program has anyone done this before and if so how do I check the return code from the XCOM itself.
Thanks - Frank
Answer:
I need to XCOM files from an ABAP program has anyone done this before and if so how do I check the return code from the XCOM itself.
Thanks - Frank
Hi, I am not familiar with XCOM, but if you are trying to FTP then why not use the SAP Standard FTP Function Modules in conjuntion with RFC destination SAPFTP (front end) or SAPFTPA (app server)?
This works extremely well and very fast. We have many ABAP's coded in this way to FTP files.
Brendan
Answer:
Hi,
another way to ftp that goes Ok is to call O.S. scripts that do the trick from the SAP job.
regards
Answer:
Hi,
Can you provide the FM names that you're referring to?!? Also, what kind of O.S script are you referring to?!? Appreciate if you can provide more information.
Thanks!
ABAP Newbie
Answer:
Hi,
In SM69, you can define a OS call to your own defined script. for instance:
command name: ZFTP_LLEVAR
OS command: /usr/bin/ksh
Parameters for OS command: /sapdata/exe/ftp_llevar
Allow aditional parameters.
And after this you can create the script /sapdata/exe/ftp_llevar.
In the job, you can create and aditional step, not as Abap report but as OS command, and set ZFTP_LLEVAR with adtional parameters (the parameters that your script needs).
Here you have an script template for this:
# /usr/bin/ksh
# /sapdata/exe/ftp_llevar
FICHERO=$1 # Nombre del fichero a llevar
DREMOTO=$2 # Directorio Remoto a donde lo llevamos
DLOCAL=$3 # Directorio Local de donde lo leemos
MAQUINA=$4 # Host remoto a donde lo llevamos
USUARIO=$5 # Usuario remoto para el ftp
PASO=$6 # palabra de paso para usuario remoto
MODO=$7 # modo de transferencia (ascii o bin) (opcional)
FREMOTO=$8 # se puede indicar nombre remoto (opcional)
FECHA=`date +%Y%m%d%H%M` # Fecha en YYYYMMDDhhmm
FLOG=/tmp/ftp_llevar.log # Fichero de log
SVRMGR=`uname -n` # servidor de mail para mensajes
# Recomposicion del nombre del fichero remoto
if [ "$FREMOTO" != FECHAHORA ]
then echo "nombre remoto: $FREMOTO"
else FREMOTO=$1$FECHA
echo "nombre remoto: $FREMOTO"
fi
ftp -n << Fin >>$FLOG 2>>$FLOG
open $MAQUINA
user $USUARIO $PASO
prompt
$MODO
cd $DREMOTO
lcd $DLOCAL
put $FICHERO $FREMOTO
close
quit
Fin
After this, you should check $FLOG to be able to know the result of the ftp command.
Regards