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 files in application server

Former Member
0 Likes
3,066

Hi,

I want to move/copy a file from application server to another path in application server? How can I do it?

Thanks for your comments

7 REPLIES 7
Read only

Former Member
0 Likes
1,154
Read only

Former Member
0 Likes
1,154

Hi,

Check this link

[]

Cheers,

Surinder

Read only

Former Member
0 Likes
1,154

Hi:

Try this

&----


*& Form process_file_on_server

&----


*form process_file_on_server .

DATA: filename(128) TYPE c.

DATA: param LIKE sxpgcolist-parameters.

CASE sy-sysid.

WHEN 'BO1'.

p_arc = 'k:
Share\MM_SCUBCode_PDAtxt_Archive'.

WHEN 'BQ1'.

p_arc = 'K:
Share\MM_SCUBCode_PDAtxt_Archive'.

WHEN OTHERS.

ENDCASE. " CASE SY-SYSID

DO. " Changed

CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

EXPORTING

full_name = p_file

IMPORTING

STRIPPED_NAME = filename

  • FILE_PATH =

EXCEPTIONS

X_ERROR = 1

OTHERS = 2

.

IF sy-subrc NE 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF. " IF SY-SUBRC NE 0

CONCATENATE p_arc filename INTO p_arc SEPARATED BY '\'.

CONCATENATE p_file p_arc INTO param SEPARATED BY space.

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'

EXPORTING

commandname = 'ZMOVE'

ADDITIONAL_PARAMETERS = param

  • OPERATINGSYSTEM = SY-OPSYS

  • TARGETSYSTEM = SY-HOST

  • DESTINATION =

  • STDOUT = 'X'

  • STDERR = 'X'

  • TERMINATIONWAIT = 'X'

  • TRACE =

  • DIALOG =

  • IMPORTING

  • STATUS =

  • EXITCODE =

  • TABLES

  • EXEC_PROTOCOL =

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

OTHERS = 15

.

IF sy-subrc = 0. " CHANGE

STOP. " CHANGE

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

clear filename .

endform. " process_file_on_server

ENDDO. " CHANGE

Regards

Shashi

Read only

0 Likes
1,154

Hi ,

please dont copy my code and paste here

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,154

Hi,

Refer this wiki to move files between folders in application server:-

https://www.sdn.sap.com/irj/scn/wiki?path=/display/community/transfer%252bfile%252bbetween%252bfolde...

Refer this wiki to move files between directories in application server:-

https://www.sdn.sap.com/irj/scn/wiki?path=/display/scm/move%252ba%252bfile%252bfrom%252bsource%252bt...

Hope this helps you.

Regards,

Tarun

Edited by: Tarun Gambhir on Mar 24, 2009 10:07 AM

Read only

Former Member
0 Likes
1,154

Hi,

Kindly go through this link below:

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
1,154

Hi ,

Use the T-code CG3Y for down loading file from application server to any front end .

CG3Z is used to upload file from front-end to application server .

or go with the link given u will get so many solutions....

Rgds

Sachhi