Vorsicht: Unsachgemäßer Aufruf von Kernelfunktionen kann Systemschäden verursachen!
* Server-Directory auflisten DATA: lv_cmd TYPE char255. DATA: lt_result_tab TYPE TABLE OF char255. lv_cmd = 'ls -lasi'. CALL 'SYSTEM' ID 'COMMAND' FIELD lv_cmd ID 'TAB' FIELD lt_result_tab. LOOP AT lt_result_tab INTO DATA(res_line). WRITE: / res_line. ENDLOOP. * eingegebenen OK-Code ermitteln DATA: my_ucomm TYPE sy-ucomm. CALL 'DYNP_OKCODE_GET' ID 'FCODE' FIELD my_ucomm. WRITE: / my_ucomm. * CPUID ermitteln DATA: local_host LIKE spfid-host. CALL 'C_GET_CPU_ID' ID 'CPUID' FIELD local_host. WRITE: / local_host. * SAP-System ermitteln DATA: sapsystem LIKE spfid-sysnr. CALL 'C_GET_SYSTEM_NUMBER' ID 'SYSTEM' FIELD sapsystem. WRITE: / sapsystem. * Directory für Audit-Files DATA: lv_audir TYPE rsauflist-dir_name. CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'DIR_AUDIT' ID 'VALUE' FIELD lv_audir. WRITE: / lv_audir. * Namens-Format für Audit-Files DATA: lv_aufn TYPE rsauflist-file_name. CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'FN_AUDIT' ID 'VALUE' FIELD lv_aufn. WRITE: / lv_aufn. * SAP Servername DATA: lv_server_name LIKE btctgtsrvr-srvname. CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'rdisp/myname' ID 'VALUE' FIELD lv_server_name. WRITE: / lv_server_name.
Weiterführende Infos: Link