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

Move File

Former Member
0 Likes
2,075

Hi Expert.

Please help me,

We want to move file between two Folder on Application Server.

I use Code like below:

              GC_MOVE = 'move'.

              

               CONCATENATE GC_MOVE

                                          '\\192.168.16.123\LIMS_Data\From_LIMS\test.txt'       

                                          '\\192.168.16.123\LIMS_Data\From_LIMS\Backup\'

                                           INTO LV_PARCOM

                                           SEPARATED BY SPACE.


               CALL 'SYSTEM' ID 'COMMAND' FIELD LV_PARCOM

                                         ID 'TAB'     FIELD GT_TABL.

we have successful move file between two folder but Now we move on EHP7 so File to stop move between two folder.

Thanks.

Pradip Patel.

Hi Expert.

Please help me,

We want to move file between two Folder on Application Server.

I use Code like below:

              GC_MOVE = 'move'.

              

               CONCATENATE GC_MOVE

                                          '\\192.168.16.123\LIMS_Data\From_LIMS\test.txt'       

                                          '\\192.168.16.123\LIMS_Data\From_LIMS\Backup\'

                                           INTO LV_PARCOM

                                           SEPARATED BY SPACE.


               CALL 'SYSTEM' ID 'COMMAND' FIELD LV_PARCOM

                                         ID 'TAB'     FIELD GT_TABL.

we have successful move file between two folder but Now we move on EHP7 so File to stop move between two folder.

Thanks.

Pradip Patel.

7 REPLIES 7
Read only

archanapawar
Contributor
0 Likes
1,339

Hi Pradip,

You need to use 'mv' not 'move'.

GC_MOVE = 'mv'.

Read only

0 Likes
1,339

Hi Archana Pawar.

Thanks for Reply.

I try it not working.

Thanks.

Pradip Patel.

Read only

0 Likes
1,339

Try using FM SXPG_COMMAND_EXECUTE.

Read only

0 Likes
1,339

Hi Archana Pawar.

Please give me brief code related FM : SXPG_COMMAND_EXECUTE.

COMMANDNAME                        = ?

ADDITIONAL_PARAMETERS      = ?

OPERATINGSYSTEM                 = Windows NT

TARGETSYSTEM                       = ?

DESTINATION                            = ?

STDOUT                                     = 'x'

STDERR                                     = 'x' 

TERMINATIONWAIT                   = 'x'

TRACE                                       = ?     

DIALOG                                      = ?

Thanks.

Pradip Patel.

Read only

0 Likes
1,339

Hi,

check this

http://www.iconet-ltd.co.uk/sap/abap/sxpg.txt

This above program is based on 'Y_REMOVE' command. So you can  define the command for each operating system using transactions SM69 (You can test it with SM49) and then call it using SXPG_COMMAND_EXECUTE

Read only

0 Likes
1,339

Hi Pradip,

Refer below link.

http://scn.sap.com/community/unix/blog/2013/01/24/deleteremove-file-in-unix-folder-using-sm69-in-sap...

Or you can use FM ARCHIVFILE_SERVER_TO_SERVER .

Read only

Former Member
0 Likes
1,339

Hi,

Use function ARCHIVFILE_SERVER_TO_SERVER and do it. Use a delete dataset with source file after moving it.

Search for the command which moves the files. Create external command in sap and trirger it using fm SXGP_COMMAND_EXECUTE. There are lot of topics related to this available in the forums

Regards,

EH