Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need to replace a file in the application server

0 Likes
1,635

Hello Experts,

Through ABAP coding, I need to replace a file which is available in the application server from one path to another. I should not use OPEN DATASET, CLOSE DATASET, DELETE DATASET and all as they deal with the data. I need to replace the file with out touching the data of the file.

Could anyone please help.

I heard that i have to use some UNIX script.

Regards,

Sudheer

Hello Experts,

Through ABAP coding, I need to replace a file which is available in the application server from one path to another. I should not use OPEN DATASET, CLOSE DATASET, DELETE DATASET and all as they deal with the data. I need to replace the file with out touching the data of the file.

Could anyone please help.

I heard that i have to use some UNIX script.

Regards,

Sudheer

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,013

You can use Fm ARCHIVFILE_SERVER_TO_SERVER for this.

But the Fm also does dataset operations.

This can be also done using OS commands

Refer:link:[https://wiki.sdn.sap.com/wiki/display/ABAP/MoveafilefromsourcetotargetdirectoriesorDeletefile]

Read only

ThomasZloch
Active Contributor
0 Likes
1,013

Please do not cross-post

Thomas

Read only

former_member206396
Active Participant
0 Likes
1,013

Sudheer,

Try this...

WITHOUT TOUCHING THE DATA OF A FILE . . .Just Moving the file ( unix commands in abap )

DATA: command(255) TYPE c,

fnam_sour(255),

fnam_target(255).

fnam_sour = '\hme\usr\interface\..... " path of source file

fnam_target = '\hme\usr\interface\..... " target path, where file to placed.

OPEN DATASET fnam_sour FOR INPUT " fnam_sour -> path of source file...

MESSAGE msg IN TEXT MODE

ENCODING DEFAULT.

IF sy-subrc <> 0.

< error msg : no file exits>

else.

OPEN DATASET fnam_target FOR INPUT " fnam_target -> path where file to be placed....

MESSAGE msg IN TEXT MODE

ENCODING DEFAULT.

if sy-surc = 0.

CONCATENATE 'mv' fnam_sour fnam_target INTO command SEPARATED BY

space.

CONDENSE command.

PERFORM uxcmd USING command.

endif.

endif.

*******************************

&----


*& Form UXCMD

&----


FORM uxcmd USING p_command.

**issue UNIX command by calling system function.

DATA: BEGIN OF itab OCCURS 0,

line(255),

END OF itab.

CALL 'SYSTEM' ID 'COMMAND' FIELD p_command

ID 'TAB' FIELD itab-sys.

ENDFORM. " UXCMD

Regards

Ram

Read only

matt
Active Contributor
0 Likes
1,013

Duplicate in other forum deleted.

Please do not post the same question in more than one forum

matt