2009 Jul 06 4:24 PM
Hi all,
I need a function module for executing .bat file in application server.
Regards
Sathish Kumar K.C
Hi Sathish kumar,
You have to read application file like below whatever is the extension.
Thanks
Venkat.OREPORT ztest_notepad.
DATA: BEGIN OF it_data OCCURS 0,
data TYPE string,
END OF it_data.
PARAMETERS: p_file TYPE char80 DEFAULT 'usr/sap/tmp/venkat.bat'.
START-OF-SELECTION.
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT. "This statement opens the application server file to read
IF sy-subrc = 0.
DO. "Loop the file using DO-ENDO
READ DATASET p_file INTO it_data-data.
IF sy-subrc = 0.
APPEND it_data.
CLEAR it_data.
ELSE. "If there is no record exit the loop.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET p_file. "Close file
2009 Jul 06 4:34 PM
Hello
Try doing a search in se37 for SXPG*.
SXPG_CALL_SYSTEM would be a place to start.
You may need to define an external command in sm69. (or get Basis to help)
Regards
Greg Kern
2009 Jul 07 4:00 AM
Hi ,
I specified all the parameters in SM69 .Since i cant execute my .bat file in server from local system.ICan you please help me?
Edited by: Sathish Kumar K.C on Jul 7, 2009 7:28 AM
2009 Jul 07 7:42 AM
Hi Sathish kumar,
You have to read application file like below whatever is the extension.
Thanks
Venkat.OREPORT ztest_notepad.
DATA: BEGIN OF it_data OCCURS 0,
data TYPE string,
END OF it_data.
PARAMETERS: p_file TYPE char80 DEFAULT 'usr/sap/tmp/venkat.bat'.
START-OF-SELECTION.
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT. "This statement opens the application server file to read
IF sy-subrc = 0.
DO. "Loop the file using DO-ENDO
READ DATASET p_file INTO it_data-data.
IF sy-subrc = 0.
APPEND it_data.
CLEAR it_data.
ELSE. "If there is no record exit the loop.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET p_file. "Close file
2009 Jul 07 9:05 AM
CALL FUNCTION 'SXPG_STEP_COMMAND_START'
EXPORTING
* TARGET =
* DESTINATION =
COMMANDNAME = 'ZCOPY'
ADDITIONAL_PARAMETERS = AD_PAR
OPERATINGSYSTEM = 'Windows NT'
STDINCNTL = 'R'
STDOUTCNTL = 'M'
STDERRCNTL = 'M'
TRACECNTL = '3'
TERMCNTL = 'C'
* TRACELEVEL = 0
* BATCH =
* LONG_PARAMS =
* JOBNAME =
* JOBCOUNT =
* STEPCOUNT =
* CONNCNTL = 'H'
* IMPORTING
* STRTSTAT =
* XPGID =
* CONVID =
* EXITSTAT =
* EXITCODE =
* PARAMS =
* LAST_PROC =
* LAST_HOST =
* LAST_PROC_NUM =
TABLES
LOG = LT_LOG
EXCEPTIONS
COMMAND_NOT_FOUND = 1
PARAMETER_EXPECTED = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
NO_PERMISSION = 6
UNKNOWN_ERROR = 7
COMMUNICATION_ERROR = 8
SYSTEM_ERROR = 9
CANNOT_GET_RFC_DESTS = 10
JOB_UPDATE_FAILED = 11
JOB_DOES_NOT_EXIST = 12
OTHERS = 13
2009 Jul 09 6:22 AM
Hi all,
I need to know where i have to specify the path to be executed in SM69 , i got it thanks for your reply.
Thanks & Regards
Sathish Kumar K.C
Edited by: Sathish Kumar K.C on Jul 9, 2009 7:22 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |