Iconet Services Ltd - SAP ABAP / SAPScript Consultant

Home Page
Company Profile
Search Internet for SAP Information
Subscribe to SAP R3 Mailing list
Sample ABAP Programs
ABAP How to
General Purpose layout set

Initiate command on unix box from abap

1.

SXPG_COMMAND_SYSTEM - needs entries in sap table SXPGCOSTAB.

Create using sm30.

* parameters for sxpg_call_system

DATA: W_PARAMETERS LIKE SXPGCOLIST-PARAMETERS.

DATA: W_COMMAND LIKE SXPGCOLIST-NAME.

CONCATENATE DEVICE W_SPOOL INTO W_PARAMETERS SEPARATED BY ' '.

W_COMMAND = 'Y_PRINT'.

CALL FUNCTION 'SXPG_CALL_SYSTEM'

EXPORTING

COMMANDNAME = W_COMMAND

PARAMETERS = W_PARAMETERS

IMPORTING

STATUS = W_STATUS

TABLES

EXEC_PROTOCOL = W_LOG

EXCEPTIONS

OTHERS = 1.

2.

Use CALL 'SYSTEM' ID 'COMMAND' FIELD W_PARAMETERS

ID 'TAB' FIELD RETURNS-*SYS*.

3.

(1) OPEN DATASET <file> FOR OUTPUT 'unix command'

CLOSE DATASET <file>

This command executes the unix command and writes the output into <file>

Look into OSS Note 9391.

Back to How To list