Stopping TREX
...
1. Log on with the user <sapsid>adm.
2. Start the TREX admin tool by double-clicking <TREX_DIR>\TREXAdmin.bat in Windows Explorer.
3. In the TREX admin tool, navigate to the Landscape Services area and then go to the MMC tab.
4. You can stop TREX by clicking the SAP System: Stop button or by selecting the TREX host, opening its context menu with the secondary mouse button, and selecting the relevant option. You can stop Selected Hosts or All Hosts for a landscape.
1. Log on with the user <sapsid>adm.
5. In Windows Explorer, double-click the <TREX_DIR>/TREXSettings.bat batch file to set the environment variables correctly.
2. Go to the <TREX_DIR>/exe directory and enter the following:
stopsap.exe name=<SAPSID> nr=TRX<instance_number> SAPDIAHOST =<host>
In the SAPDIAHOST parameter, you specify the host name on which the TREX instance is to be stopped.

stopsap.exe name=ABC nr=TRX77 SAPDIAHOST =p123456

Do not use the Task Manager to stop the SAP service or the individual TREX servers. Otherwise, data can be lost. Affected indexes can be irreparably damaged.
Certain processing steps, for example, writing an index, cannot be interrupted. Such steps are completed before TREX is stopped. This process can take a while to complete. With large indexes, it can take up to a few hours to stop the TREX servers if lots of documents are currently being indexed.
...
1. Log on with the user <sapsid>adm.
2. Launch the SAP Management console by double-clicking the program icon on your desktop or by choosing Start → Programs → SAP Management Console.
3. In the tree structure, choose the node for the central SAP instance <SAPSID> and navigate to the subnode for the TREX instance <host>_<instance_number> (for example, p123456_77).
4. Use the secondary mouse button to access the context menu.
5. Choose Shutdown.

The Shutdown command only stops the TREX processes once any running processes have been completed. Do not use the Stop command, as this command terminates the TREX processes immediately, which means that there is a risk of data loss.