04-16-2008 4:57 AM
CALL 'SYSTEM' ID 'COMMAND' FIELD l_parcom_loc
ID 'TAB' FIELD t_file-sys.
Can someone explain me the above line of codes.
When I execute this line, I get SY-SUBRC as 1-, what does it mean?
05-28-2008 12:18 PM
Hi Anurita,
CALL 'SYSTEM' calls the system function 'SYSTEM'. The relevant function must exist in the file sapactab.h. If you change or recreate a function, you have to compile and link the SAP kernel again. For this, you need the C source code files.
ID is used to pass parameter to this Function call
Usuall, it is used for SAP internal use and not in application program.
In your case, its calling a SYSTEM function and passing the commad to be executed.
Reward if helpful
05-28-2008 12:26 PM
Hi,
it is an interface to the oprating system.
Try this (Windows, change parcom for Unix):
REPORT ztest.
DATA:
parcom(250),
BEGIN OF tabl OCCURS 0,
line(200),
END OF tabl,
str(250).
parcom = 'dir'.
parcom = 'ls'. "Unix
CALL 'SYSTEM' ID 'COMMAND' FIELD parcom
ID 'TAB' FIELD tabl-sys.
LOOP AT tabl.
WRITE: / tabl-line.
ENDLOOP.
regards
Walter Habich