{"id":7607,"date":"2025-08-24T02:54:34","date_gmt":"2025-08-23T21:24:34","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?question=luw-logical-unit-of-work"},"modified":"2025-08-24T02:54:34","modified_gmt":"2025-08-23T21:24:34","slug":"luw-logical-unit-of-work","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=luw-logical-unit-of-work","title":{"rendered":"LUW (Logical Unit of Work)"},"content":{"rendered":"<div class=\"text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] @[37rem]:[--thread-content-margin:--spacing(6)] @[72rem]:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:32rem] @[34rem]:[--thread-content-max-width:40rem] @[64rem]:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\">\n<div class=\"flex max-w-full flex-col grow\">\n<div data-message-author-role=\"assistant\" data-message-id=\"db9e93e6-e7b5-4961-91a1-4eb30c595ef0\" class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" data-message-model-slug=\"gpt-5\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose dark:prose-invert w-full break-words dark markdown-new-styling\">\n<p>A Logical Unit of Work (LUW) is the smallest unit of work in SAP that must be executed completely or not at all, following the all-or-nothing principle. It plays a crucial role in ensuring data consistency by treating a group of operations as a single transaction. If any part of the LUW fails, the entire set of changes is rolled back, preventing partial updates and maintaining system integrity.<\/p>\n<h5>Types of LUW in SAP<\/h5>\n<p>There are mainly 3 types of LUWs in ABAP\/SAP:<\/p>\n<h5>1. <strong>Database LUW (DB LUW)<\/strong><\/h5>\n<ul>\n<li>A set of database operations executed between two database commits (<code>COMMIT WORK<\/code>) or rollbacks (<code>ROLLBACK WORK<\/code>).<\/li>\n<li>Managed by the database system.<\/li>\n<li>Each DB LUW is ended explicitly by COMMIT WORK or ROLLBACK WORK.<\/li>\n<\/ul>\n<h5>2. <strong>SAP LUW<\/strong><\/h5>\n<ul>\n<li>A set of one or more DB LUWs that belong together in terms of SAP application logic.<\/li>\n<li>Ensures that multiple DB LUWs are processed as a single logical unit.<\/li>\n<li>A single SAP LUW can span multiple DB LUWs.<\/li>\n<li>Controlled by function modules with update tasks (<code>CALL FUNCTION \u2026 IN UPDATE TASK<\/code>).<\/li>\n<\/ul>\n<p>\u2705 <strong>Example:<\/strong><\/p>\n<ul>\n<li>\n<p>In Sales Order creation (VA01):<\/p>\n<ul>\n<li>DB LUW 1 \u2192 Insert Sales Order header<\/li>\n<li>DB LUW 2 \u2192 Insert Sales Order items<\/li>\n<li>DB LUW 3 \u2192 Update stock<\/li>\n<li>DB LUW 4 \u2192 FI\/CO posting<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\ud83d\udc49 All DB LUWs together form <strong>one SAP LUW<\/strong>.<\/p>\n<\/div>\n<h5>3. <strong>Logical Unit of Work in Dialog (Dialog LUW \/ Transaction LUW)<\/strong><\/h5>\n<ul>\n<li>The user-related transaction unit in SAP.<\/li>\n<li>It is the sequence of dialog steps (screens) between <code>BEGIN<\/code> and <code>END<\/code> of a transaction (from start of transaction until <code>COMMIT WORK<\/code>).<\/li>\n<li>Ensures that changes across multiple screens are consistent.<\/li>\n<\/ul>\n<p>\u2705 <strong>Example:<\/strong><\/p>\n<ul>\n<li>\n<p>In VA01 (Create Sales Order):<\/p>\n<ul>\n<li>\n<p>Screen 1: Enter header data<\/p>\n<\/li>\n<li>\n<p>Screen 2: Enter item data<\/p>\n<\/li>\n<li>\n<p>Screen 3: Save \u2192 <code>COMMIT WORK<\/code> triggers update<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\ud83d\udc49 All screens together = <strong>Dialog LUW<\/strong>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div class=\"flex min-h-[46px] justify-start\">Summary:<\/p>\n<table>\n<thead>\n<tr>\n<th>Type of LUW<\/th>\n<th>Controlled by<\/th>\n<th>Scope<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Database LUW<\/strong><\/td>\n<td>Database system<\/td>\n<td>DB operations between COMMIT \/ ROLLBACK<\/td>\n<td>INSERT + UPDATE + COMMIT<\/td>\n<\/tr>\n<tr>\n<td><strong>SAP LUW<\/strong><\/td>\n<td>SAP Update mechanism<\/td>\n<td>One or more DB LUWs linked logically<\/td>\n<td>VA01 (SO creation + FI posting)<\/td>\n<\/tr>\n<tr>\n<td><strong>Dialog LUW<\/strong><\/td>\n<td>SAP Transaction flow<\/td>\n<td>User actions across multiple screens<\/td>\n<td>VA01 screens until Save<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] @[37rem]:[--thread-content-margin:--spacing(6)] @[72rem]:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:32rem] @[34rem]:[--thread-content-max-width:40rem] @[64rem]:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\">\n<div class=\"mt-3 w-full empty:hidden\">\n<div class=\"text-center\">\n<ul>\n<li>\n<p><strong>DB LUW<\/strong> = Technical database transaction (COMMIT\/ROLLBACK).<\/p>\n<\/li>\n<li>\n<p><strong>SAP LUW<\/strong> = Business transaction made up of multiple DB LUWs.<\/p>\n<\/li>\n<li>\n<p><strong>Dialog LUW<\/strong> = User\u2019s interaction steps in a transaction.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[158],"question_tags":[178,183,177],"class_list":["post-7607","question","type-question","status-publish","hentry","question-category-abap","question_tags-abap","question_tags-luw","question_tags-sap"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7607"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7607"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7607"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}