Login Form

Best viewed in IE 7.0

ADVERTISEMENTS
ADVERTISEMENT

Create Directory on Unix server

To create a directory on a Unix server (Or execute other operating system commands) the must be created in transaction SM69.

Create command ZMKDIR im SM69 - Note the operating system command mkdir:



Other useful system commands on unix:

  • Move file: mv
  • Remove directory: mdir
  • Copy file: cp
You can execute the commands directly from SM69 or use them in an ABAP program.

To execute the command from SM69, click on the command on the overview screen. The command screen (See screeshot above is show). Press the Execute button (Or PF8) and the screen below is shown:



Enter the parameters for your command in the Additional parameters field.

Below is an example of how to execute a command from an ABAP program:
DATA: gv_add_par  TYPE sxpgcolist-parameters.

gv_add_par = '/usr/sap/XDT/dk/interface/test'.


CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
COMMANDNAME = 'ZMKDIR'
ADDITIONAL_PARAMETERS = gv_add_par
* 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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
write :/ 'Success'.
ENDIF.

ADVERTISEMENT
Free software downloads