Skip to Content
0
Former Member
Aug 17, 2012 at 10:41 PM

Problem with FM ARCHIVFILE_SERVER_TO_SERVER

3375 Views

Hi everyone !!!

I have a trouble with the FM ARCHIVFILE_SERVER_TO_SERVER. I'm want to copy one file into another directory trough this FM, but it will always finish with a dump. The sample code is this:

DATA: fecha TYPE sy-datum.
DATA: ruta(60) TYPE c.
DATA: ruta2(60) TYPE c.
DATA: cont TYPE i.
DATA: contc(60) TYPE c.

fecha = sy-datum.
cont = 1.

contc = cont.
condense contc no-gaps.
CLEAR ruta.
CLEAR ruta2.
ruta = 'E:\usr\sap\BWD\DVEBMGS00\work\0COMP_CODE_ATTR.CSV'.

CONCATENATE 'E:\usr\sap\put\' fecha '_0COMP_CODE_ATTR' contc '.CSV' INTO ruta2.

translate ruta to upper case.
translate ruta2 to upper case.

condense ruta no-gaps.
condense ruta2 no-gaps.
condense contc no-gaps.

CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER'
EXPORTING
sourcepath = ruta
targetpath = ruta2.

DUMP:

CALL_FUNCTION_CONFLICT_TYPE

CX_SY_DYN_CALL_ILLEGAL_TYPE

The description of the dump is this:

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught and

therefore caused a runtime error.

The reason for the exception is:

The call to the function module "ARCHIVFILE_SERVER_TO_SERVER" is incorrect:

The function module interface allows you to specify only

fields of a particular type under "SOURCEPATH".

The field "RUTA" specified here is a different

field type

I changed code, variables (string, c), added sentences (condense, translate) but still I could not give with the solution. I dont know if i am using the FM well. Any help about the variable or the FM usage will be fully appreciated.

Best Regards!!!
Ignacio