In the SAP system, any action you do that changes the information already in the system is called a transaction. This term actually has a business meaning as well as a technical one. In terms of business, a transaction is an action reflecting the daily business of your company. This includes updates to your master data (customer addresses, vendor account information, material classification etc.), capturing the flow of physical goods (goods receipt, goods delivery) or entering documents (customer invoices, vendor purchase orders, financial postings). Generally, any action you do in the SAP system is called a transaction, even if you are simply running a report without changing any data (e.g. the account statement for a customer or the balance sheet of your organization).
Technically, you enter or change data during a transaction and finish your entry via the SAVE button. Once you have saved the data, the system will store the information you entered in the form of a document in the database. Technically, this is called a commit. This usually happens within a second, which is why this concept is called real-time processing. You can always go back to the document and verify the data you entered.
If you do not save your data for any reason (because you cancelled the transaction, you ran into an error or were disconnected from the system due to a network problem), your data will not be updated to the database. In fact, it will be discarded completely, so you do not have to worry that the data you entered ended up somewhere half-finished or incomplete. This procedure is also called a rollback.