<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Asmamalica on Medium]]></title>
        <description><![CDATA[Stories by Asmamalica on Medium]]></description>
        <link>https://medium.com/@asmamalica07?source=rss-eca4c81ecad9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9lF1WWfld5v8jXjDEadgZg.jpeg</url>
            <title>Stories by Asmamalica on Medium</title>
            <link>https://medium.com/@asmamalica07?source=rss-eca4c81ecad9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 03:38:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asmamalica07/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Deep Entity Through a Real SAP OData Scenario]]></title>
            <link>https://medium.com/@asmamalica07/understanding-deep-entity-through-a-real-sap-odata-scenario-4c99cfef1254?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c99cfef1254</guid>
            <category><![CDATA[sap-odata]]></category>
            <category><![CDATA[sap-abap]]></category>
            <category><![CDATA[deep-entity-in-sap]]></category>
            <category><![CDATA[createdeepentity]]></category>
            <category><![CDATA[sap-api]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 06:28:02 GMT</pubDate>
            <atom:updated>2026-08-19T06:28:02.086Z</atom:updated>
            <content:encoded><![CDATA[<p>A complete, beginner friendly walkthrough for building a header item Deep Entity service in SAP Gateway from custom Z tables to a working POST payload.</p><p>If you’ve ever had to send <strong>header data and item data together in a single API call </strong>like a Sales Order (VBAK) with its line items (VBAP) you’ve probably run into the term <strong>Deep Entity</strong> in SAP OData.</p><p>It sounds intimidating the first time you hear it. It isn’t. In this post, I’ll walk you through exactly how I built a Deep Entity service from scratch in SAP Gateway (SEGW), using custom Z tables modeled on VBAK and VBAP, all the way to a successful CREATE_DEEP_ENTITY call that inserts records into both tables in one shot.</p><p>By the end of this article, you’ll be able to:</p><ul><li>Understand what a Deep Entity actually is (and why it matters)</li><li>Create custom header and item Z tables in SE11</li><li>Build an OData project in SEGW and import both tables</li><li>Create the Association and Navigation Property between header and item</li><li>Write the ABAP code inside CREATE_DEEP_ENTITY to insert both header and item records</li><li>Test it with an array based JSON payload</li></ul><p>Let’s get into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*38HsOptKohT9L6bTCvpPzA.png" /><figcaption>Deep Entity</figcaption></figure><h3>What Is a Deep Entity in SAP OData?</h3><p>In SAP ABAP OData, a <strong>Deep Entity</strong> means sending or receiving <strong>multiple related data records together in a single request</strong>, instead of handling them separately.</p><p>It’s mainly used when <strong>header and item data are connected </strong>the classic example being a sales order header (VBAK) and its line items (VBAP). Instead of firing one API call to create the header and a second call to create each item, a Deep Entity lets you send everything header plus a nested array of items in <strong>one POST request</strong>.</p><p>This is exactly how real world sales order creation, purchase order creation, and similar header-item transactions work in SAP Fiori and custom UI5 apps.</p><p><em>Reference: </em><a href="https://community.sap.com/t5/technology-blog-posts-by-members/step-by-step-development-for-create-deep-entity-operation/ba-p/13074869"><em>SAP Community : Step-by-Step Development for Create Deep Entity Operation</em></a></p><h3>Step 1: Create Custom Header Table (Z table based on VBAK)</h3><p>Start by creating a custom Z table that mirrors the key fields of VBAK (Sales Document Header).</p><p>Go to transaction <strong>SE11</strong>.</p><p>SE11 initial screen : table name entry</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*seTzM0vTDx2Z1gv-ySlILg.png" /></figure><p>Table structure / field list for the header table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*89pU0kzdf-AIYexXgIitkg.png" /></figure><p>Header table fields with data elements/types</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*ORF7TKSN2SNWk0P7pxUM1Q.png" /></figure><p>click save</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*Df-N69JHUHenWASgfvk-9g.png" /></figure><p>Assign a <strong>package</strong> and a <strong>Transport Request (TR)</strong>, then <strong>activate</strong> the table.</p><p>Once activated, go to the table’s data entries (SE11 → Utilities → Table Contents, or SM30) and make <strong>3 sample entries</strong>, then save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*r0i-WEm572c8jQ3pmfp9ug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*36I7EdwyD0tY52hF6Q2nMA.png" /></figure><h3>Step 2: Create Custom Item Table (Z table based on VBAP)</h3><p>Repeat the same process to create your <strong>item table</strong>, this time mirroring VBAP (Sales Document Item).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*_umb4iKegh4NpjPE8e41PA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*cEgDUqBSy3DqqS6l6qPiKg.png" /></figure><p>Assign a <strong>package</strong> and a <strong>Transport Request (TR)</strong>, then <strong>activate</strong> the table.</p><p>Once activated, go to the table’s data entries (SE11 → Utilities → Table Contents, or SM30) and make <strong>3 sample entries</strong>, then save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*BqWSadgHSbxlj6zH7UZAoA.png" /></figure><h3>Step 3: Create the OData Project in SEGW</h3><p>Now switch to transaction <strong>SEGW</strong> and create a new project for your Deep Entity service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*Uo5BDFq-Kx963lYWQ9UZew.png" /></figure><p>Import Both Tables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*ZBsPxr3R52Huxlzl89oMjw.png" /></figure><p>Import <strong>header table</strong> first, using Import DDIC Structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*jdGZSLyanjPW_UhPlhxOIg.png" /></figure><p>Header entity added to Data Model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*zSq-TB5SaA1RrsQnT5DI9Q.png" /></figure><p>Header entity key field is marked</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*PJ48KRlK_R54UwimQtq4RQ.png" /></figure><p>Then import the <strong>item table</strong> the same way.</p><p>Import DDIC Structure : item table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*XbgIB2LbugPitPlN4sf7Jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*Xp1rhIHPmgLJUN0x43lR9g.png" /></figure><p>Assign the package and Transport Request</p><h3>Step 4: Generate the Runtime Objects</h3><p>With both entities imported, assign a package and TR, then trigger <strong>Generate Runtime Objects</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*MU4a4AdwZF2713xL6ggdUA.png" /></figure><p>Generated MPC/DPC classes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*0m3rqPeSnbihPmI4Nfyzzg.png" /></figure><p>Runtime object generation success</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*u-FSezspD1b-ah0UdGlJQQ.png" /></figure><p>SICF service check / activation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*YdIdtHfLkVtXiHukhpb0pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*gu3kBfVDQztRP3TvIS89Tg.png" /></figure><p>TR assignment after generation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*UxymeH0wRLN0jnxOI3HjRw.png" /></figure><h3>Step 5: Create the Association (This is the important step)</h3><p>This is what actually turns two independent entities into a <strong>Deep Entity structure</strong>. Create an <strong>Association</strong> between the header entity and the item entity, and generate a <strong>Navigation Property</strong> from it (e.g., header_to_item).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*jZ83Gcnsv0n6WJCMGpY3Xg.png" /></figure><p>Association cardinality settings : 1 to many</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*MhZp1cJu7CHuabXFXEt8vQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*dJ4w2wDNxxd5SH-3hsxtmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*MPqtpzkQduUfyu50RAg-WQ.png" /></figure><p>Once the association is in place, <strong>generate the runtime objects again</strong> so the navigation property and deep structure get picked up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*BkPkg7J_6kuHUoLyuyaaxw.png" /></figure><p>Once again generate it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*fFMjM3Aj_8cGhAWaEtTBrw.png" /></figure><h3>Step 6: Write the Deep Entity Structure in the MPC_EXT Class</h3><p>Now it’s time to write code. Go to the <strong>MPC_EXT</strong> class (Model Provider Class extension).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*6-C8WV7ilZ6E4h5uUqal9g.png" /></figure><p>MPC_EXT class : public section</p><p>Inside the <strong>public section</strong>, define the Deep Entity structure this ties the header structure to the item table as a nested internal table, so the item data is visible/available at the model level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*clK3e11E9FG9N9JIK5w0ZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*U6iKz80MCwCkI1XJ57pMZw.png" /></figure><p><strong>Inside the public section write the code for deep entity structure . The structure of the item table want to be seen in mpc class</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*C3hdvABPj2z3nHZM7u4-wg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*1su2QqCUF44sy4r5w8sYZw.png" /></figure><h3>Step 7: Write the CREATE_DEEP_ENTITY Method in DPC_EXT</h3><p>This is where the real logic lives. In the <strong>DPC_EXT</strong> class, redefine the method:</p><pre>/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*99M6BoZZi8tg2jpjL8Ifsg.png" /></figure><p>DPC_EXT class : method redefinition</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*6ToSc7BK8BFtEKnDnGEz6w.png" /></figure><p>Method signature / parameters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*BcoNThdj-MKkge4p0wGy4w.png" /></figure><pre>method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY. <br>DATA: ls_deep_entity TYPE zcl_zdeepentity_63_mpc_ext=&gt;ts_total, <br>         lt_item        TYPE zcl_zdeepentity_63_mpc_ext=&gt;tt_vbap_table_63, <br>         ls_item        TYPE zcl_zdeepentity_63_mpc_ext=&gt;ts_vbap_table_63. <br>   DATA: ls_vbak TYPE ztab_vbak63, <br>         ls_vbap TYPE ztab_vbap63. <br>  io_data_provider-&gt;read_entry_data( <br>     IMPORTING <br>       es_data = ls_deep_entity ). <br>  ls_vbak-sales_document = ls_deep_entity-vbeln. <br>   ls_vbak-created_on     = ls_deep_entity-erdat. <br>   ls_vbak-time           = ls_deep_entity-erzet. <br>   ls_vbak-created_by     = ls_deep_entity-ernam. <br>   ls_vbak-sales_org      = ls_deep_entity-vkorg. <br>   INSERT ztab_vbak63 FROM ls_vbak. <br>   IF sy-subrc = 0. <br>     lt_item = ls_deep_entity-header_to_item. &quot;navigation property <br>    LOOP AT lt_item INTO ls_item. <br>       CLEAR ls_vbap. <br>       ls_vbap-sales_document = ls_item-Sales_Document. <br>       ls_vbap-item           = ls_item-Item. <br>       ls_vbap-material       = ls_item-Material. <br>       ls_vbap-description    = ls_item-Description. <br>       ls_vbap-item_type      = ls_item-Item_Type. <br>       INSERT ztab_vbap63 FROM ls_vbap. <br>     ENDLOOP. <br>     copy_data_to_ref( <br>       EXPORTING <br>         is_data = ls_deep_entity <br>       CHANGING <br>         cr_data = er_deep_entity ). <br>   ENDIF. <br>   endmethod. <br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*1U1c6_XnvYeU-H4Ra9G8Eg.png" /></figure><p><strong>Code Explanation :</strong></p><ul><li><strong>read_entry_data</strong> pulls the full incoming payload — header fields <em>plus</em> the nested item array — into ls_deep_entity.</li><li>The header fields (vbeln, erdat, erzet, ernam, vkorg) are mapped into ls_vbak and inserted into the custom header table.</li><li>If the header insert succeeds (sy-subrc = 0), the code reads the nested item table via the <strong>navigation property</strong> header_to_item — this is the &quot;deep&quot; part of Deep Entity.</li><li>It loops through every item in that nested array, maps the fields, and inserts each row into the item table.</li><li>Finally, copy_data_to_ref sends the processed data back into the response object (er_deep_entity) so the OData response reflects what was created.</li></ul><h3>Step 8: Send an Array in the Payload for testing</h3><p>Time to test. Open your service in <strong>Gateway Client</strong> (or Postman) and send a POST request. The key here is that the <strong>item section of the JSON payload must be an array</strong>, since a header can have multiple items.</p><p>Gateway Client : POST request with array payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*4BLswggv08QWjFuKzzRghQ.png" /></figure><p>Go to SICF</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*H_c2X-lwNZrCF7qb8CPRDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*RbxK8Ml2jkTAM_A0C8clKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*FNZOFHxyTpM-5yLxpXjKkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*-lBeojVW0gMH08km_IusiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*37dSoRnLA3u7BNp-WOFIIw.png" /></figure><p>Use array in payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*cTwo2hoWLp5bRnVrq976pA.png" /></figure><p>Both tables Output</p><p><strong>The VBAK style entry gets added</strong> to the header table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*Qc2GsMYE4UicUZ97Xz93Fg.png" /></figure><p><strong>The VBAP style entries get added</strong> to the item table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*IgJe7qsseftjG3_-3RaPpg.png" /></figure><h3><strong>Final Thoughts:</strong></h3><p>Deep Entities are not just about sending data together, they provide a powerful way to create and maintain related header and item records in a single, real time OData request within SAP applications. Understanding how Deep Entity works along with custom tables, Associations, and Navigation Properties helps you build efficient, reliable, and real time data creation solutions.</p><p><strong>Mastering Deep Entity concepts can:</strong></p><ul><li>Enable real time header and item creation in a single API call</li><li>Improve user experience by reducing multiple round trips to the backend</li><li>Reduce manual effort compared to creating header and item records separately</li><li>Help you build reusable and maintainable OData services</li><li>Strengthen your core ABAP Gateway and OData development skills</li></ul><p>This blog is written as:<br> A simple guide for beginners and a handy reference for real time Deep Entity implementation in SAP ABAP OData projects.</p><p>I’ll be documenting my SAP ABAP learning journey here, follow along for more practical and beginner friendly insights.</p><p>Thanks for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c99cfef1254" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SAP OData : Function Import Explained Step by Step]]></title>
            <link>https://medium.com/@asmamalica07/sap-odata-function-import-explained-step-by-step-99b51bb044ab?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/99b51bb044ab</guid>
            <category><![CDATA[sap-odata]]></category>
            <category><![CDATA[sap-abap]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[segw]]></category>
            <category><![CDATA[function-import]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 10:53:59 GMT</pubDate>
            <atom:updated>2026-07-26T10:53:59.466Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the previous blog, we learned how to perform <a href="https://medium.com/@asmamalica07/abap-odata-crud-operations-a-complete-step-by-step-guide-8764e480a2ea"><strong>CRUD operations in SAP OData</strong></a> service. CRUD operations are used to <strong>Create, Read, Update, and Delete</strong> data from the database.</p><p>But in real business scenarios, not every requirement can be solved using CRUD operations.</p><p>For example:</p><ul><li>Approve a Purchase Order</li><li>Calculate an Employee’s Bonus</li><li>Send an Email</li><li>Generate a PDF</li><li>Trigger a Workflow</li></ul><p>These are <strong>business operations</strong>, not simple database operations.</p><p>To perform such operations, SAP OData provides a feature called <strong>Function Import</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CbopKzMf6rMFyQ-FW1lgxw.png" /></figure><p>In this blog, we will learn what Function Import is, why we need it, how to create it in SEGW, and how to test it.</p><h3>What is Function Import?</h3><p>A <strong>Function Import</strong> is a custom operation exposed through an OData service that executes <strong>custom ABAP business logic</strong>.</p><p>Instead of directly performing Create, Read, Update, or Delete operations on a database table, it executes a specific business function and returns the result.</p><h3>Simple Definition</h3><blockquote><strong><em>Function Import is used to execute custom business logic that cannot be handled by normal CRUD operations.</em></strong></blockquote><p>CRUD operations allow us to:</p><ul><li>Read employee details</li><li>Create a new employee</li><li>Update salary</li><li>Delete an employee</li></ul><p>Now imagine the HR team asks for a feature to <strong>calculate an employee’s bonus</strong>.</p><p>The database does not store the bonus value.</p><p>Instead, the bonus is calculated using a business rule.</p><pre>Bonus = Salary × 20%</pre><p>Since this is a calculation and not a database operation, CRUD cannot perform it.</p><p>This is where <strong>Function Import</strong> is used.</p><h3>Real Time Business Examples</h3><p>Function Import is commonly used for business operations such as:</p><ul><li>Calculate Bonus</li><li>Calculate Tax</li><li>Currency Conversion</li></ul><p>All these operations execute business logic rather than simply reading or updating data.</p><h3>1.Create an Entity Type</h3><p>Open your existing SEGW project, navigate to Entity Types, right click, and create a new entity type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*nGvjHYf0Fk0-zFKlEQOQtw.png" /></figure><h3>2. Add Properties</h3><p>Right click on <strong>Properties</strong> and add the two properties the employee ID and the calculated bonus value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*QcP4Hxr2Mf0TO8xaLGxaPg.png" /></figure><h3>3.Create the Function Import</h3><p>Once the entity is set up, create the Function Import itself and save. At this point, the Function Import exists in your project structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*ccKcplQOwPNtCDlZyCYzJA.png" /></figure><h3>4.Configure Function Import Parameters</h3><p>Click on the Function Import parameters node and enter the details defining the input parameter (like EmpId) that the function will accept when called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*q7Thlz1Zx35wrFYhEki6vg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mBeEwc3Dh4O5zoBK9kzMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vz-5vhb9N-Hku2YFyrVbNw.png" /></figure><p>Function Import is now created</p><h3>5.Generate Runtime Objects</h3><p>Generate the runtime objects for the project. This step creates the underlying classes SAP uses to actually execute your service at runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*2nt50fi1dEnE-5s_-WhMlg.png" /></figure><h3>6.Redefine and Write the Logic</h3><p>In the generated MPC/DPC extension class, redefine the relevant method and write the calculation logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*idebQTu9ZE_ObYwCUx9imQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*89zumfhLn8KyB_sokhnqLw.png" /></figure><p>Here’s the actual implementation:</p><pre>METHOD /iwbep/if_mgw_appl_srv_runtime~execute_action.<br>  DATA:<br>    lv_empid  TYPE z63_employee-emp_id,<br>    lv_salary TYPE z63_employee-salary,<br>    ls_data   TYPE zcl_zodata_63_mpc=&gt;ts_employeebonus.<br><br>  DATA: ls_param TYPE /iwbep/s_mgw_name_value_pair.<br><br>  READ TABLE it_parameter<br>    INTO ls_param<br>    WITH KEY name = &#39;EmpId&#39;.<br><br>  IF sy-subrc = 0.<br>    lv_empid = ls_param-value.<br>  ELSE.<br>    RETURN.<br>  ENDIF.<br><br>  SELECT SINGLE salary<br>    INTO @lv_salary<br>    FROM z63_employee<br>    WHERE emp_id = @lv_empid.<br><br>  IF sy-subrc = 0.<br>    ls_data-EMPID = lv_empid.<br>    ls_data-BONUS = lv_salary * &#39;0.20&#39;.<br><br>    copy_data_to_ref(<br>      EXPORTING<br>        is_data = ls_data<br>      CHANGING<br>        cr_data = er_data ).<br>  ENDIF.<br>ENDMETHOD.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*xM3Rzf3Fu0md4wQUzho5mw.png" /></figure><p>save and Activate</p><h3>Code Explanation</h3><ol><li>The method reads the EmpId parameter passed in from the OData call.</li><li>If no EmpId was passed, the method simply returns no point in continuing.</li><li>It performs a SELECT SINGLE to fetch the employee&#39;s salary from table z63_employee.</li><li>If a matching record is found, it calculates the bonus as <strong>20% of salary</strong>.</li><li>Finally, copy_data_to_ref packages the result (EMPID and BONUS) and passes it back to the caller via er_data.</li></ol><h3>7. Test in SAP Gateway Client</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*EkRkfOVaIme7EmZAaru6ww.png" /></figure><pre>Test URL<br><br>/sap/opu/odata/sap/ZODATA_63_SRV/GetEmployeeBonus?EmpId=&#39;01&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*mVa0RlN-_QwnV0Ku1GZb9Q.png" /></figure><h3>Final Thoughts :</h3><p>Function Imports are not just about running a piece of custom code, they provide a powerful way to execute real business logic like bonus calculation, tax computation, or currency conversion within a single, real time OData request in SAP applications. Understanding how Function Import works along with parameters, runtime objects, and method redefinition helps you build efficient, reliable, and real time business logic solutions.</p><p>Mastering Function Import concepts can:</p><ul><li>Enable real time business calculations beyond simple CRUD operations</li><li>Improve user experience by delivering computed results instantly through a single API call</li><li>Reduce manual effort compared to handling business logic outside the OData layer</li><li>Help you build reusable and maintainable OData services</li><li>Strengthen your core ABAP Gateway and OData development skills</li></ul><p>This blog is written as:<br>A simple guide for beginners and a handy reference for real time Function Import implementation in SAP ABAP OData projects.</p><p>I’ll be documenting my SAP ABAP learning journey here, follow along for more practical and beginner friendly insights.</p><p>Thanks for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99b51bb044ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CDS Core Data Service]]></title>
            <link>https://medium.com/@asmamalica07/cds-core-data-service-0b8b186a7d1f?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b8b186a7d1f</guid>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[core-data-service]]></category>
            <category><![CDATA[cdss]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Fri, 17 Jul 2026 07:08:32 GMT</pubDate>
            <atom:updated>2026-07-17T07:08:32.863Z</atom:updated>
            <content:encoded><![CDATA[<p><em>If you’ve ever waited minutes for an SAP report to run, watched a consultant write 500 lines of ABAP just to join three tables, or wondered how modern SAP apps feel “instant,” this post is for you.</em></p><h3>What is CDS View?</h3><p><strong>CDS (Core Data Services)</strong> is a way to <strong>define data models directly at the database level</strong>.</p><p>In simple terms:</p><ul><li>CDS Views help you <strong>combine data from multiple tables</strong></li><li>They run directly on <strong>SAP HANA database</strong></li><li>They improve <strong>performance and readability</strong></li></ul><pre>Before CDS<br>You go to different shops to buy items<br><br>With CDS<br>You go to one supermarket and get everything<br><br>That&#39;s exactly what CDS does - it combines multiple tables into one view.</pre><h3>Why CDS Views?</h3><ul><li>CDS Views are used to create efficient, reusable, and structured data models at the database level. They improve performance by pushing data processing to the database, reduce the need for complex ABAP code, and minimize multiple database calls.</li><li>CDS Views also support annotations, associations, and built-in authorization, making them ideal for modern SAP development, especially for SAP HANA and Fiori applications. Overall, CDS Views enable cleaner code, better performance, and easier maintenance</li></ul><h3>CDS Architecture (Code Pushdown Concept)</h3><p>CDS Views follow the <strong>Code Pushdown</strong> concept, which is one of the most important advantages of using CDS.</p><h3>Before CDS</h3><p><strong>Database → ABAP → Processing → UI</strong></p><ul><li>Data is fetched from database and the processing happens in ABAP layer</li><li>More data transfer therefore slower in performance</li></ul><h3>With CDS</h3><p><strong>Database → Processing → UI</strong></p><ul><li>Processing happens directly in the database</li><li>Less data transfer therefore faster in performance</li><li>Reduced application server load</li></ul><p>This approach is called <strong>Code Pushdown</strong>.</p><h3>What does Code Pushdown mean?</h3><ul><li>Data processing happens in <strong>SAP HANA Database</strong></li><li>Less load on<strong> Application Serve</strong>r</li><li>Reduced data movement</li><li>Faster performance</li><li>Better scalability</li></ul><pre>Real Time Example<br>  Requirement:<br>    Vendor Name<br>    Invoice Amount<br>    Posting Date<br><br>Before CDS:<br>    Fetch all records from database<br>    Apply filters in ABAP<br>    More processing time<br>    Slower performance<br><br>With CDS:<br>    Apply filters directly in database<br>    Fetch only required data<br>    Less processing time<br>    Faster performance</pre><h3>Types of CDS Views</h3><ul><li>SAP follows the <strong>Virtual Data Model (VDM)</strong> architecture to organize CDS Views in a structured and reusable manner. VDM consists of three main types of views: <strong>Basic Views</strong>, <strong>Composite Views</strong>, and <strong>Consumption Views</strong>.</li><li><strong>Basic Views</strong>, also known as Interface Views, are used to fetch data directly from database tables and act as the foundation for building other views, such as retrieving vendor, customer, or material master data.</li><li><strong>Composite Views</strong> are built on top of Basic Views and are used to combine multiple views, apply joins, associations, and business logic, for example combining vendor, invoice, and payment data.</li><li><strong>Consumption Views</strong> are the final layer used for reporting, analytics, and Fiori applications; these views include UI annotations, authorizations, and are designed for end-user consumption.</li><li>This layered architecture improves reusability, enhances performance, simplifies maintenance, and provides a clean and scalable data modeling approach in SAP CDS development.</li></ul><h3>Annotations in CDS</h3><ul><li>Annotations in CDS Views are used to provide additional information and control the behavior of the CDS view without changing the actual business logic.</li><li>They help define how the CDS view should behave in terms of UI, authorization, performance, metadata, and OData exposure.</li><li>Annotations are written using the <strong>@</strong> symbol and placed above the CDS view definition or fields. By using annotations, developers can control labels, security checks, UI behavior, and data exposure in a structured and standardized way. This makes CDS Views more powerful, readable, and easier to maintain.</li></ul><h3>Common / Basic Annotations in CDS</h3><h3>@AbapCatalog.sqlViewName</h3><p>This annotation defines the <strong>technical SQL view name</strong> created in the database. It is mandatory for <strong>classic CDS views</strong> (not required for view entities). This name is used internally by SAP to access the CDS view at the database level.</p><pre>@AbapCatalog.sqlViewName: &#39;ZVENDORREP&#39;</pre><h3>@EndUserText.label</h3><p>This annotation provides a <strong>description or label</strong> for the CDS view. It helps users understand the purpose of the view in a readable format and appears in SAP tools and UI applications.</p><pre>@EndUserText.label: &#39;Vendor Report&#39;</pre><h3>@AccessControl.authorizationCheck</h3><p>This annotation is used to <strong>enable authorization checks</strong> for CDS views. It ensures that users can only access data they are authorized to see.</p><p><strong>Values:</strong></p><ul><li>#CHECK – Authorization check enabled</li><li>#NOT_REQUIRED – No authorization check</li><li>#PRIVILEGED_ONLY – Restricted access</li></ul><pre>@AccessControl.authorizationCheck: #CHECK</pre><h3>@OData.publish</h3><p>This annotation is used to <strong>expose CDS view as an OData service</strong> automatically. This allows the CDS view to be consumed in <strong>SAP Fiori apps</strong> or external applications.</p><pre>@OData.publish: true</pre><h3>Associations in CDS</h3><ul><li>Associations in CDS Views are used to define relationships between different data sources in a simpler and more efficient way. They are often referred to as <strong>smart joins</strong> because they allow developers to connect related data without writing complex join statements. Unlike traditional joins, associations are <strong>lazy loaded</strong>, meaning data is only fetched when it is actually required, which improves performance and reduces unnecessary data processing.</li><li>Associations help create <strong>readable, modular, and reusable data models</strong> by linking one CDS view to another using a defined relationship. These associations also support <strong>navigation</strong>, allowing developers to easily access related data fields from associated views.</li></ul><p>Example Scenario</p><p>Consider a situation where you want to link <strong>Supplier</strong> data with <strong>Invoice</strong> data. Instead of writing complex joins, you can define an association between the supplier and invoice views. This makes the code cleaner and easier to understand</p><pre>association [0..1] to I_Supplier as a<br> on $projection.Supplier = a.Supplier</pre><h3>Association Cardinality</h3><p>Associations use <strong>cardinality</strong> to define relationships between data</p><ul><li><strong>[0..1]</strong> → Zero or one record</li><li><strong>[1..1]</strong> → Exactly one record</li><li><strong>[0..*]</strong> → Zero to many records</li><li><strong>[1..*]</strong> → One to many records</li></ul><h3>Joins in CDS</h3><p>Joins in CDS Views are used to combine data from multiple tables or views based on a common field. CDS supports <strong>Inner Join</strong>, <strong>Left Outer Join</strong>, and <strong>Right Outer Join</strong>, allowing developers to retrieve related data efficiently at the database level. Using joins in CDS helps reduce multiple database calls, improves performance, and simplifies ABAP logic by handling data combination directly in the database.</p><pre>| Join Type        | Description                                                       | When to Use                         | Result                    |<br>| ---------------- | ----------------------------------------------------------------- | ----------------------------------- | ------------------------- |<br>| Inner Join       | Returns only matching records from both tables                    | When data must exist in both tables | Matching records only     |<br>| Left Outer Join  | Returns all records from left table and matching from right table | When left table data is mandatory   | All left + matching right |<br>| Right Outer Join | Returns all records from right table and matching from left table | When right table data is mandatory  | All right + matching left |</pre><pre>define view ZFI_VENDOR_INVOICE<br>  as select from bseg as a<br>  inner join lfa1 as b<br>    on a.lifnr = b.lifnr<br>{<br>    a.belnr,<br>    a.bukrs,<br>    a.wrbtr,<br>    b.name1<br>}<br><br>What Happens Here<br>    BSEG contains invoice details<br>    LFA1 contains vendor details<br>    Join is done using LIFNR (Vendor Number)<br>    Only matching records are returned</pre><h3>Aggregations in CDS</h3><p>Aggregations in CDS Views are used to <strong>perform calculations on multiple records</strong> and return <strong>summarized results</strong>. Instead of displaying every individual record, aggregation functions help combine data into meaningful totals, averages, counts, or maximum and minimum values. This is very useful in reporting, analytics, and dashboards.</p><p>CDS supports the following <strong>aggregation functions</strong>:</p><ul><li><strong>SUM</strong> → Adds values</li><li><strong>COUNT</strong> → Counts records</li><li><strong>AVG</strong> → Calculates average</li><li><strong>MAX</strong> → Finds highest value</li><li><strong>MIN</strong> → Finds lowest value</li></ul><h3>Example Scenario</h3><pre><br>Suppose if the invoice data has like this:<br><br>| Vendor   | Invoice Amount |<br>| -------- | -------------- |<br>| Vendor A | 20000          |<br>| Vendor A | 30000          |<br>| Vendor B | 50000          |<br>| Vendor B | 25000          |<br><br>If you use SUM aggregation, CDS will calculate:<br><br>| Vendor   | Total Invoice Amount |<br>| -------- | -------------------- |<br>| Vendor A | 50000                |<br>| Vendor B | 75000                |<br><br>This means:<br>  CDS groups data by Vendor<br>  Then calculates SUM of Invoice Amount<br>  Returns summarized results<br>--------------------------------------------------------------------------<br>define view ZFI_VENDOR_TOTAL<br>  as select from bseg<br>{<br>    lifnr,<br>    sum( wrbtr ) as TotalAmount<br>}<br>group by lifnr</pre><h3>Parameters in CDS</h3><ul><li>Parameters in CDS Views allow users to pass input values dynamically at runtime. This helps in filtering data directly at the database level and improves performance by retrieving only the required data.</li><li>Instead of fetching all records and filtering later in ABAP, parameters allow filtering at the database itself, which reduces data transfer and speeds up execution.</li></ul><pre>Example Scenario<br>    Suppose you want to fetch invoice data for a specific fiscal year.<br>    Instead of retrieving all years, you can pass the year as a parameter.<br><br>define view ZFI_VENDOR_PARAM<br> with parameters p_gjahr : gjahr<br> as select from bseg<br>{<br> lifnr,<br> wrbtr,<br> gjahr<br>}<br>where gjahr = :p_gjahr</pre><h3>Calculated Fields in CDS</h3><p>Calculated fields allow you to perform calculations directly in CDS Views. This eliminates the need for additional ABAP logic and keeps calculations at the database level.</p><pre>Example Scenario<br>    Suppose you want to calculate tax on invoice amount:<br><br>define view ZFI_CALCULATION<br> as select from bseg<br>{<br> lifnr,<br> wrbtr,<br> wrbtr * 0.18 as TaxAmount<br>}</pre><h3>Authorization in CDS (DCL)</h3><p>Authorization in CDS Views is handled using <strong>Data Control Language (DCL)</strong>. It allows developers to restrict data access based on user roles.This improves security and ensures users see only relevant data.</p><pre>Example Scenario<br>    User A → Company Code 1000<br>    User B → Company Code 2000<br>You can restrict access using DCL.<br><br>define role ZFI_ROLE<br>{<br> grant select on ZFI_VENDOR<br> where bukrs = &#39;1000&#39;;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b8b186a7d1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ABAP OData CRUD Operations - A Complete Step by Step Guide]]></title>
            <link>https://medium.com/@asmamalica07/abap-odata-crud-operations-a-complete-step-by-step-guide-8764e480a2ea?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8764e480a2ea</guid>
            <category><![CDATA[sap-gateway]]></category>
            <category><![CDATA[sap-fiori]]></category>
            <category><![CDATA[sap-odata]]></category>
            <category><![CDATA[sap-abap]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 02:21:40 GMT</pubDate>
            <atom:updated>2026-06-07T02:21:40.274Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical walkthrough of building OData services in SAP using SEGW, MPC, and DPC with real ABAP code</em></p><h3>Introduction</h3><p>If you’re working with SAP Fiori, UI5, or any external application that talks to SAP backend, you’ve already heard of <strong>OData</strong>. OData (Open Data Protocol) is the standard REST-based protocol that acts as a bridge between your SAP ABAP backend and frontend technologies like Fiori apps, mobile apps, or even Postman.</p><p>In this post, I’ll walk you through building a fully working OData service from scratch covering all five CRUD operations with real ABAP code from a live SAP project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SprOlUF6GTlTi9ZrlysFw.png" /></figure><h3>What You’ll Learn</h3><ul><li>How to set up an OData service in SEGW</li><li>The role of MPC and DPC classes</li><li>How to implement GET (single &amp; all), POST, PUT, and DELETE</li><li>Key terms and concepts you must know</li></ul><h3>Key Concepts Before We Begin</h3><p>Before diving into the code, let’s quickly understand the important building blocks:</p><p>Term What It Does <strong>OData</strong> REST protocol for SAP ↔ Frontend communication <strong>SEGW</strong> Transaction to create and manage OData services <strong>MPC</strong> Model Provider Class defines the service structure <strong>DPC</strong> Data Provider Class handles actual data logic <strong>MPC_EXT / DPC_EXT</strong> Extension classes safe place for your custom code <strong>Entity</strong> One record (like one employee row) <strong>EntitySet</strong> A collection of all records <strong>it_key_tab</strong> SAP provided table holding URL key values <strong>io_data_provider</strong> SAP provided object to read POST/PUT request body <strong>er_entity</strong> Response structure for a single record <strong>et_entityset</strong> Response table for multiple records</p><blockquote><strong><em>Why MPC_EXT and DPC_EXT ?</em></strong><em> SAP recommends writing all custom logic only in the </em><em>_EXT classes. If you ever regenerate the service in SEGW, the base classes get overwritten but your </em><em>_EXT code stays safe.</em></blockquote><h3>Step 1 : Create the OData Service in SEGW</h3><p><strong>Transaction:</strong> SEGW</p><p>Open SEGW and click the <strong>Create</strong> icon to create a new project (e.g., ZODATA_63)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*UJiokfJlE00UAohXHBdIeA.png" /><figcaption>creation of project</figcaption></figure><p>Create an <strong>Entity Type</strong> -this defines your data structure. Example: employee_details with properties EmpId, EmpName, Dept, Salary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*CRGL2XihwZDUq0K1RExTog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*sVYdMPU_p_gq1gUulmb7Qw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*zxNV7paOJV0KS0C4gHtz1g.png" /></figure><p>Mark EmpId as the <strong>Key</strong> field</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*9P5vd_MpL3nGMyMbZM6I3w.png" /></figure><ol><li>The <strong>EntitySet</strong> (employee_detailsSet) is created automatically</li><li>Click <strong>Generate Runtime Artifacts</strong> — this creates the MPC and DPC classes automatically</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*V-pyvGhbfOWW3O8o4aviyw.png" /></figure><p><strong>Assign a package and save</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*aRGfNFAUHBeUnlliT7_7iw.png" /></figure><p><strong>To check whether the structure has been created</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*w86wMnOTuTY7yPSZn9Ldiw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOOvHlYhqegbCbCQlrTH7g.png" /></figure><p>Automatically structure will be created inside the program alone</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*CT9jdIB-K64sxYAVzKMvjw.png" /></figure><blockquote><strong><em>Best Practice:</em></strong><em> Even though creating a structure is optional, always create one explicitly. When you provide a table directly, MPC auto generates a structure but doing it manually gives you better visibility and control.</em></blockquote><h3>Step 2 : Register the Service</h3><p><strong>Transaction:</strong> /n/iwfnd/maint_service</p><ol><li>Search for your service name: ZODATA_63</li><li>Click <strong>Add Selected Services</strong> to register it</li><li>Assign a system alias</li><li>Test with the URL format:</li></ol><pre>/sap/opu/odata/sap/ZODATA_63_SRV/employee_detailsSet</pre><p>This is the <strong>EntitySet</strong> name in the URL , get this from the SEGW project.</p><p><strong>Another Method : Link to gateway client</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*p7RT8Wi4ZTtHiGE7mRXPpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*V4lxZXs70cEB3zVce30Sqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*OKWPxFrig8YBqWfKCW-UIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*y2y9vqOLOLQpvSIidbClUg.png" /></figure><h3>Step 3 : GET_ENTITYSET (Read All Records)</h3><p>This method fetches <strong>all records</strong> from the database and fills the et_entityset response table. It is triggered by a simple GET request to the EntitySet URL.</p><p>Go to <strong>SEGW -&gt; runtime artifacts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*TkzuI4PtSaICrU0D6MHmeA.png" /></figure><p>Right click the get_entityset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*mH7_KmJ3mp-RM0FPtVsjQQ.png" /></figure><p>Goto <strong>/n/iwfnd/maint_service</strong> and search the service name zodata_63</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*3B0SEMCWzPsvhErYyfGhTw.png" /></figure><p>From here only we are taking the <strong>entity set </strong>name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*z42DUz0t247oHAw4634V-Q.png" /></figure><p>after the zodata_63_srv/ Type employee_detailsSet and click on execute to see the output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*3B0SEMCWzPsvhErYyfGhTw.png" /></figure><p><strong>GET ALL DATA’S : GETENTITY SET , to get all the records ie fetch all the employees</strong></p><pre>METHOD EMPLOYEE_DETAILS_GET_ENTITYSET.</pre><pre>  DATA: lt_employee TYPE TABLE OF z63_employee,   &quot;Internal table - stores multiple rows<br>        ls_entity   TYPE zcl_zodata_63_mpc=&gt;ts_employee_details. &quot;Work area - one row</pre><pre>  SELECT * FROM z63_employee INTO TABLE lt_employee.  &quot;Read all records</pre><pre>LOOP AT lt_employee INTO DATA(ls_employee).<br>    CLEAR ls_entity.                          &quot;Clear previous loop data<br>    ls_entity-emp_id   = ls_employee-emp_id. &quot;Copies database data to OData structure.<br>    ls_entity-emp_name = ls_employee-emp_name.<br>    ls_entity-dept     = ls_employee-dept.<br>    ls_entity-salary   = ls_employee-salary.<br>    APPEND ls_entity TO et_entityset.         &quot;Add to OData response<br>  ENDLOOP.<br>ENDMETHOD.</pre><p><strong>Save and Activate</strong> then again goto SAP Gateway client</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*cP3QSTIRw4RshWUvdzlY_Q.png" /></figure><p><strong>Test URL:</strong></p><pre>/sap/opu/odata/sap/ZODATA_63_SRV/employee_detailsSet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*28cVRlIGmyBcMLeB2VyY1w.png" /></figure><h3>Step 4 : GET_ENTITY (Read Single Record)</h3><p>This fetches <strong>one record</strong> using a key value from the URL. SAP Gateway automatically parses the key from the URL and stores it in it_key_tab before calling this method.</p><p><strong>GETENTITY - GET SINGLE RECORD - </strong>Used to fetch one employee using key.</p><p>same as before redefine the get_entity and write the method then save and activate</p><pre>METHOD EMPLOYEE_DETAILS_GET_ENTITY. &quot;This method is automatically triggered when a GET request for a single record is called.</pre><pre>  DATA: lv_empid TYPE z63_employee-emp_id,<br>        ls_data  TYPE z63_employee.</pre><pre>&quot;Extract key from URL → it_key_tab is auto filled by SAP Gateway<br>  READ TABLE it_key_tab INTO DATA(ls_key)<br>    WITH KEY name = &#39;EmpId&#39;.&quot; “it_key_tab -&gt; It contains key values from URL.<br>  IF sy-subrc = 0.<br>    lv_empid = ls_key-value.” Moves employee ID from URL key table into variable.<br>  ENDIF.<br>  &quot;Fetch matching record from DB<br>  SELECT SINGLE * FROM z63_employee INTO ls_data<br>    WHERE emp_id = lv_empid.</pre><pre>  IF sy-subrc = 0.<br>    er_entity-emp_id   = ls_data-emp_id.<br>    er_entity-emp_name = ls_data-emp_name.<br>    er_entity-dept     = ls_data-dept.<br>    er_entity-salary   = ls_data-salary.<br>  ENDIF.</pre><pre>ENDMETHOD.</pre><p><strong>Test URL:</strong></p><pre>/sap/opu/odata/sap/ZODATA_63_SRV/employee_detailsSet(&#39;01&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*U6OmPCHp6D4R7nlIfGS4xw.png" /></figure><h3>Step 5 : CREATE_ENTITY (Insert New Record)</h3><p>Called when a <strong>POST</strong> request is sent with a JSON body. The incoming payload is read using io_data_provider→read_entry_data() this object is <strong>automatically provided</strong> by SAP Gateway. You do not create it manually.</p><pre>METHOD employee_details_create_entity.</pre><pre>  DATA: ls_input TYPE zcl_zodata_63_mpc=&gt;ts_employee_details, &quot;OData payload holder<br>        ls_db    TYPE z63_employee.                           &quot;DB structure</pre><pre>&quot;Read JSON body sent from frontend/Postman<br>  io_data_provider-&gt;read_entry_data(<br>    IMPORTING<br>      es_data = ls_input ).Reads JSON payload sent from Gateway Client/UI.and the datas are stored in ls_input , moving the odata data to db structure</pre><pre>&quot;Map OData payload → DB structure<br>  ls_db-emp_id   = ls_input-emp_id. ” Copies Employee ID from payload to DB structure.<br>  ls_db-emp_name = ls_input-emp_name.<br>  ls_db-dept     = ls_input-dept.<br>  ls_db-salary   = ls_input-salary.</pre><pre>  INSERT z63_employee FROM ls_db.   &quot;Insert into DB</pre><pre>IF sy-subrc = 0. &quot;checking for insertion successful<br>    er_entity-emp_id   = ls_db-emp_id.&quot;Returns inserted Employee ID to response.<br>    er_entity-emp_name = ls_db-emp_name.<br>    er_entity-dept     = ls_db-dept.<br>    er_entity-salary   = ls_db-salary.<br>  ENDIF.</pre><pre>ENDMETHOD.</pre><p><strong>Test URL:</strong></p><pre>/sap/opu/odata/sap/ZODATA_63_SRV/employee_detailsSet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*1bciPiVkeT0LTqVNQ8p_2A.png" /></figure><blockquote><strong><em>Before testing POST:</em></strong><em> Go to </em><strong><em>SICF</em></strong><em>, find your OData service, double click it, and save. Also verify in SEGW that all CRUD operation checkboxes are ticked under Service Implementation.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*T2zrGz_dWxi7aAI8887aPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*OUwEOIkA02B-_djvRfJZog.png" /></figure><p>Double click on the odata name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*HP4pw8W-rVsSfJw36-rzHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*KNzIDFypGLh7RdLc-_8ziQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*Ki07979kyNE0zG65-JrpPg.png" /></figure><p>click save a<strong>nd also in segw check whether all the required functional are ticked</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*0Nu8PhXU9zTX9XdiXiFWsQ.png" /></figure><p>Now check in <strong>segw</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*jHnymJ1uHTrT4BBdJHUpcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*SeBIU4x0OWacZvOXCAOEXQ.png" /></figure><h3>Step 6 : UPDATE_ENTITY (Modify a Record)</h3><p>Called via <strong>PUT</strong> request. The key (EmpId) comes from the <strong>URL</strong> via it_key_tab, and the new field values come from the <strong>request body</strong> via io_data_provider. Never confuse the two sources.</p><p><strong>Update - Put - to update the single record</strong></p><p>This method executes when PUT request is sent.</p><pre>METHOD EMPLOYEE_DETAILS_UPDATE_ENTITY.</pre><pre>DATA: ls_input TYPE zcl_zodata_63_mpc=&gt;ts_employee_details,” Declares structure to hold incoming OData payload.<br>        ls_db    TYPE z63_employee,” Database work area structure.Used to update database table.<br>        lv_empid TYPE z63_employee-emp_id.” Variable to store Employee ID from URL.</pre><pre>&quot;Key from URL<br>  READ TABLE it_key_tab INTO DATA(ls_key) “Reads one row from internal table. Stores found row into work area LS_KEY<br>    WITH KEY name = &#39;EmpId&#39;.<br>  IF sy-subrc = 0.<br>    lv_empid = ls_key-value.<br>  ENDIF.</pre><pre>  &quot;New field values from request body<br>  io_data_provider-&gt;read_entry_data(<br>    IMPORTING es_data = ls_input ).</pre><ul><li>what is io_data_provider</li><li>IO_DATA_PROVIDER is an object automatically provided by SAP Gateway framework.You do NOT create it manually.</li><li>SAP passes it automatically to methods like: create_entity and update_entity</li><li>It is used to read incoming request payload data.</li><li>SAP framework creates object and sends it automatically during request processing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*QelT-UJxmSe5rau25ImKxw.png" /></figure><pre>  ls_db-emp_id   = lv_empid.            &quot;ID always from URL<br>  ls_db-emp_name = ls_input-emp_name.   &quot;Values from JSON body<br>  ls_db-dept     = ls_input-dept.<br>  ls_db-salary   = ls_input-salary.</pre><pre>  UPDATE z63_employee FROM ls_db.</pre><pre>  IF sy-subrc = 0.<br>    er_entity-emp_id   = ls_db-emp_id.<br>    er_entity-emp_name = ls_db-emp_name.<br>    er_entity-dept     = ls_db-dept.<br>    er_entity-salary   = ls_db-salary.<br>  ENDIF.<br>ENDMETHOD.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*2JIfq0bEPtjRMSitmhOG7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*SNnKaqe5kvJz5uzLHrhYwQ.png" /></figure><h3>Step 7 : DELETE_ENTITY (Remove a Record)</h3><p>Called via <strong>DELETE</strong> request. SAP Gateway parses the key from the URL, stores it in it_key_tab, and calls this method. You just read the key and delete.</p><p><strong>DELETE ENTITY , Delete , </strong>This method is used to delete one employee record from database table.</p><pre>METHOD EMPLOYEE_DETAILS_DELETE_ENTITY.“This method executes when DELETE request is sent.</pre><pre>  DATA: lv_empid TYPE z63_employee-emp_id,<br>        ls_key   TYPE /iwbep/s_mgw_name_value_pair.</pre><pre>  READ TABLE it_key_tab INTO ls_key<br>    WITH KEY name = &#39;EmpId&#39;.</pre><pre>IF sy-subrc = 0.<br>    lv_empid = ls_key-value.<br>  ENDIF.<br>  DELETE FROM z63_employee WHERE emp_id = lv_empid.<br>ENDMETHOD.</pre><pre>“When the user sends a DELETE request using the URL /sap/opu/odata/sap/ZODATA_63_SRV/employee_detailsSet(&#39;01&#39;), SAP Gateway automatically calls the DELETE_ENTITY method. The employee ID present in the URL is first stored inside the internal table IT_KEY_TAB. Using the READ TABLE statement, the program extracts the key value EmpId and stores it into the variable LV_EMPID. Finally, the DELETE statement uses this employee ID in the WHERE condition to remove the matching employee record from the database table Z63_EMPLOYEE.&quot;</pre><p><strong>Test URL (DELETE request):</strong></p><pre>/sap/opu/odata/sap/ZODATA_63_SRV/employee_detailsSet(&#39;01&#39;)</pre><p>When a DELETE request hits this URL, SAP Gateway extracts &#39;01&#39; from the URL, places it in it_key_tab under the name EmpId, and your code picks it up via READ TABLE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*NGXNzkM7ZgkZV_e5IT4Slw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*cRJ5fu2RFxxXiRN8_xd0eA.png" /></figure><h3>Summary</h3><p>Here’s a one Line recap of everything:</p><ul><li><strong>SEGW</strong> → Build the ervice model and generate classes</li><li><strong>MPC_EXT</strong> → Define structure (rarely touched)</li><li><strong>DPC_EXT</strong> → Write all your CRUD logic here</li><li><strong>it_key_tab</strong> → Where URL keys land (GET, UPDATE, DELETE)</li><li><strong>io_data_provider</strong> → Where request body data lands (POST, PUT)</li><li><strong>er_entity</strong> → Send back a single record</li><li><strong>et_entityset</strong> → Send back all records</li></ul><p>OData in ABAP can look intimidating at first, but once you understand that every HTTP verb maps to one ABAP method and that SAP Gateway handles all the routing and parsing for you it becomes very straightforward.</p><h3>Final Thoughts</h3><p>OData CRUD operations are not just about exposing data they provide a powerful and standardized way to interact with SAP backend records from any modern frontend, whether it’s Fiori, UI5, or even external tools like Postman.</p><p>Understanding how OData works along with SAP Gateway, SEGW project setup, and the MPC/DPC class architecture helps you build efficient, user friendly, and real time data integration solutions.</p><p>Mastering OData CRUD concepts can:</p><ul><li>Enable real-time database operations directly from frontend applications</li><li>Improve user experience with seamless and responsive SAP integrations</li><li>Reduce complexity compared to traditional BAPI or RFC based approaches</li><li>Help you build reusable and maintainable OData services in SAP ABAP</li><li>Strengthen your core ABAP skills in modern SAP development</li></ul><p>This blog is written as a simple guide for beginners and a handy reference for real time OData CRUD implementation in SAP ABAP projects.</p><p>I’ll be documenting my SAP ABAP learning journey here follow along for more practical and beginner friendly insights.</p><p>Thanks for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8764e480a2ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Editable ALV Report with Table Maintenance Integration in ABAP]]></title>
            <link>https://medium.com/@asmamalica07/building-an-editable-alv-report-with-table-maintenance-integration-in-abap-d26c16be69a1?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d26c16be69a1</guid>
            <category><![CDATA[sap-abap]]></category>
            <category><![CDATA[alv]]></category>
            <category><![CDATA[sm30-maintenance]]></category>
            <category><![CDATA[editable-alv-report]]></category>
            <category><![CDATA[tmg-in-sap]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Sun, 17 May 2026 10:05:35 GMT</pubDate>
            <atom:updated>2026-05-17T10:05:35.583Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Every SAP ABAP developer has faced this familiar request from business users:</p><blockquote><em>“Why do we need to open SM30 just to update a few records? Can’t we edit the data directly in the report?”</em></blockquote><p>At first glance, it seems like a minor convenience. But solving this requirement elegantly can dramatically improve the user experience.</p><p>Instead of forcing users to jump between transactions, imagine giving them a single screen where they can view data, edit values directly in an ALV grid, save their changes, and instantly see those updates reflected in SM30.</p><p>That is exactly what we will build in this blog.</p><p>In SAP, ALV (ABAP List Viewer) is one of the most widely used tools for presenting structured data. While most developers use ALV for display purposes, its true power lies in its ability to become interactive. By enabling edit mode, an ALV report can evolve from a simple reporting tool into a lightweight data maintenance application.</p><p>In this step by step guide, we will create a complete end to end solution that includes:</p><ul><li>A custom transparent table to store business data</li><li>Table Maintenance Generator (TMG) for maintenance through SM30</li><li>An editable ALV report using REUSE_ALV_GRID_DISPLAY_LVC</li><li>Save logic to persist user changes to the database</li><li>Automatic synchronization so updates are immediately visible in SM30</li></ul><p>The objective is simple but powerful: build an editable ALV report where any changes made by users are written directly to the custom table and reflected seamlessly in standard SAP table maintenance.</p><p>This is more than just another ALV example , it is a practical design pattern that combines reporting, editing, and maintenance into a single efficient solution. Once you understand this approach, you can reuse it in countless real world scenarios where users need both visibility and control over business data.</p><p>The main objective of this task is:</p><blockquote>Create a custom table and an editable ALV report where changes made in ALV are updated directly in the database and reflected in TMG (SM30).</blockquote><h3>Tools and Transactions Used</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*W4xdL2H4L7WU-kOO7MkBUQ.png" /><figcaption>Transactions used</figcaption></figure><h3>Step 1 : Create Custom Table in SE11</h3><p>Create a custom table named: Z63_EMPLOYEE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*Y4ul3nxIckT9eZJpA2VrWQ.png" /></figure><p><strong>Goto Tcode SE80 to create a function Group</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*OE1yH381wbd70CBX-ND-3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*N7AGBxv74DMMlkiIFbqzAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*v8NdHaMGQtwW4UCjPVaIFw.png" /></figure><h3>Important Notes</h3><ul><li>Set EMP_ID as the primary key.</li><li>Activate the table after creation.</li><li>Assign the object to a package.</li></ul><h3>Step 2: Generate Table Maintenance Generator (TMG)</h3><p>After activating the table:</p><ol><li>Open transaction SE54 or use utilities inside SE11</li><li>Generate Table Maintenance Generator</li><li>Choose:</li></ol><ul><li>Authorization Group</li><li>Function Group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*yS2SiWqDse8ytIqrVvJo3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*z9XUwtLH62G0_oWc0ACqJQ.png" /></figure><p><strong>Save and activate</strong></p><p>Now the table can be maintained through: SM30 , the data can be inserted using SM30.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*KEGKFJ7dgJ6suJLuFzOmdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*2BiqDkQfQwu35GYJNO3qLQ.png" /></figure><h3>Step 3: Create Editable ALV Report in SE38</h3><p>Create a report program:ZREP_EMPLOYEE63</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*qa6CyO-Bmpq9Y5DVQQ3OpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*qQydoRaTx8tDaIb71IbPig.png" /></figure><p><strong>Goto se80 and copy the standard fullscreen function group</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*vkbKjLByjeEPnaTDk_y0tA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*oWSbPPa0T0PL6jJ516yDSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*MT_gbt0shk6kPF7q4aa1ow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*KNQMe2sJXhGfd1lNn1PqeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*2kL_88eg_cwTNNdld0IoFg.png" /></figure><h3>The report performs the following operations:</h3><ol><li>Fetches employee data from the custom table</li><li>Displays records in editable ALV format</li><li>Allows user modifications</li><li>Saves changes directly into the database table</li><li>Reflects changes automatically in SM30</li></ol><h3>Code :</h3><pre>*&amp;---------------------------------------------------------------------* <br>*&amp; Report ZREP_EMPLOYEE63 <br>*&amp;---------------------------------------------------------------------* <br> <br>REPORT zrep_employee63. <br>TABLES: z63_employee. <br>TYPE-POOLS: slis. <br> <br>TYPES: BEGIN OF ty_emp, <br>         emp_id   TYPE z63_employee-emp_id, <br>         emp_name TYPE z63_employee-emp_name, <br>         dept     TYPE z63_employee-dept, <br>         salary   TYPE z63_employee-salary, <br>       END OF ty_emp. <br> <br>DATA: gt_emp      TYPE STANDARD TABLE OF ty_emp, <br>      gt_emp_old  TYPE STANDARD TABLE OF ty_emp, <br>      gs_emp      TYPE ty_emp. <br> <br>DATA: gt_fieldcat TYPE lvc_t_fcat, <br>      gs_fieldcat TYPE lvc_s_fcat. <br> <br>DATA: gs_layout TYPE lvc_s_layo. <br> <br>SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. <br>SELECT-OPTIONS: <br>  s_empid FOR z63_employee-emp_id, <br>  s_name  FOR z63_employee-emp_name, <br>  s_dept  FOR z63_employee-dept, <br>  s_sal   FOR z63_employee-salary. <br>SELECTION-SCREEN END OF BLOCK b1. <br> <br>START-OF-SELECTION. <br> SELECT emp_id emp_name dept salary <br>    FROM z63_employee <br>    INTO TABLE gt_emp <br>    WHERE emp_id   IN s_empid <br>      AND emp_name IN s_name <br>      AND dept     IN s_dept <br>      AND salary   IN s_sal. <br> <br>gt_emp_old = gt_emp. <br> IF gt_emp IS INITIAL. <br>    MESSAGE &#39;No data found&#39; TYPE &#39;I&#39;. <br>    EXIT. <br>  ENDIF. <br> <br> CLEAR gs_fieldcat. <br>  gs_fieldcat-fieldname = &#39;EMP_ID&#39;. <br>  gs_fieldcat-coltext   = &#39;Employee ID&#39;. <br>  gs_fieldcat-key       = &#39;X&#39;. <br>  APPEND gs_fieldcat TO gt_fieldcat. <br> CLEAR gs_fieldcat. <br>  gs_fieldcat-fieldname = &#39;EMP_NAME&#39;. <br>  gs_fieldcat-coltext   = &#39;Employee Name&#39;. <br>  gs_fieldcat-edit      = &#39;X&#39;. <br>  APPEND gs_fieldcat TO gt_fieldcat. <br>CLEAR gs_fieldcat. <br>  gs_fieldcat-fieldname = &#39;DEPT&#39;. <br>  gs_fieldcat-coltext   = &#39;Department&#39;. <br>  gs_fieldcat-edit      = &#39;X&#39;. <br>  APPEND gs_fieldcat TO gt_fieldcat. <br> CLEAR gs_fieldcat. <br>  gs_fieldcat-fieldname = &#39;SALARY&#39;. <br>  gs_fieldcat-coltext   = &#39;Salary&#39;. <br>  gs_fieldcat-edit      = &#39;X&#39;. <br>  APPEND gs_fieldcat TO gt_fieldcat. <br> CLEAR gs_layout. <br>  gs_layout-edit      = &#39;X&#39;. <br>  gs_layout-zebra     = &#39;X&#39;. <br>  gs_layout-cwidth_opt = &#39;X&#39;. <br> <br> CALL FUNCTION &#39;REUSE_ALV_GRID_DISPLAY_LVC&#39; <br>    EXPORTING <br>      i_callback_program       = sy-repid <br>      i_callback_pf_status_set = &#39;PF_STATUS&#39; <br>      i_callback_user_command  = &#39;USER_COMMAND&#39; <br>      is_layout_lvc            = gs_layout <br>      it_fieldcat_lvc          = gt_fieldcat <br>    TABLES <br>      t_outtab                 = gt_emp <br>    EXCEPTIONS <br>      program_error            = 1 <br>      OTHERS                   = 2. <br> <br>  IF sy-subrc &lt;&gt; 0. <br>    MESSAGE &#39;Error while displaying ALV&#39; TYPE &#39;E&#39;. <br>  ENDIF. <br> <br>FORM pf_status USING rt_extab TYPE slis_t_extab. <br>  SET PF-STATUS &#39;ZSTANDARD_FULLSCREEN&#39;. <br>ENDFORM. <br> <br>FORM user_command USING r_ucomm     LIKE sy-ucomm <br>                        rs_selfield TYPE slis_selfield. <br>  DATA: ls_old TYPE ty_emp. <br>  CASE r_ucomm. <br> WHEN &#39;&amp;DATA_SAVE&#39;. <br> LOOP AT gt_emp INTO gs_emp. <br>        UPDATE z63_employee <br>           SET emp_name = gs_emp-emp_name <br>               dept     = gs_emp-dept <br>               salary   = gs_emp-salary <br>         WHERE emp_id   = gs_emp-emp_id. <br>      ENDLOOP. <br>  LOOP AT gt_emp_old INTO ls_old. <br>        READ TABLE gt_emp INTO gs_emp <br>          WITH KEY emp_id = ls_old-emp_id. <br>        IF sy-subrc &lt;&gt; 0. <br>          DELETE FROM z63_employee <br>            WHERE emp_id = ls_old-emp_id. <br>        ENDIF. <br>      ENDLOOP. <br>  COMMIT WORK. <br>    gt_emp_old = gt_emp. <br>    rs_selfield-refresh = &#39;X&#39;. <br>      MESSAGE &#39;Database updated successfully&#39; TYPE &#39;S&#39;. <br> WHEN &#39;&amp;BACK&#39;. <br>      LEAVE TO SCREEN 0. <br>  WHEN &#39;&amp;EXIT&#39;. <br>      LEAVE PROGRAM. <br>  WHEN &#39;&amp;CANCEL&#39;. <br>      LEAVE PROGRAM. <br>  ENDCASE. <br>ENDFORM. </pre><h3>Output :</h3><p>After execution:</p><ul><li>Employee data appears in editable ALV format</li><li>Users can modify records directly</li><li>Clicking Save updates the database table</li><li>Changes become visible in SM30 instantly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*nn4IBt6fyZCIp3Oc26v8-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*ptQpDZOuvEp_J0iBopq3rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*25nIG0z-gKbShUUEVWPM1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*CFAf650IINy62ezzG4Lgog.png" /></figure><h3>Final Thoughts :</h3><p>Editable ALV Reports are not just about displaying data, they provide a powerful way to interact with and maintain database records directly within SAP applications. Understanding how Editable ALV works along with custom tables and Table Maintenance Generator (TMG) helps you build efficient, user friendly, and real time data management solutions.</p><p>Mastering Editable ALV concepts can:</p><ul><li>Enable real time database updates directly from reports</li><li>Improve user experience with interactive data maintenance</li><li>Reduce manual effort compared to traditional SM30 maintenance</li><li>Help you build reusable and maintainable ABAP reports</li><li>Strengthen your core ABAP reporting and database handling skills</li></ul><p>This blog is written as:</p><p>A simple guide for beginners and a handy reference for real time Editable ALV implementation in SAP ABAP projects.</p><p>I’ll be documenting my SAP ABAP learning journey here , follow along for more practical and beginner friendly insights.</p><p>Thanks for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d26c16be69a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ABAP Data Dictionary (DDIC): Complete Beginner Guide]]></title>
            <link>https://medium.com/@asmamalica07/abap-data-dictionary-ddic-complete-beginner-guide-f964a322f05c?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f964a322f05c</guid>
            <category><![CDATA[data-dictionary-ddic]]></category>
            <category><![CDATA[data-element]]></category>
            <category><![CDATA[abap-se11]]></category>
            <category><![CDATA[domains]]></category>
            <category><![CDATA[abap-tutorial]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 07:41:00 GMT</pubDate>
            <atom:updated>2026-03-18T07:41:00.911Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>ABAP DDIC stands for ABAP Data Dictionary. It is the central metadata repository in the SAP system. Think of it as the “brain” that stores definitions of all data structures used in the SAP environment. It sits between the ABAP Workbench (where developers write code) and the underlying Database (where data is physically stored).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3JfsxIYO6CwPXiYzPlBIA.png" /><figcaption>ABAP DDIC</figcaption></figure><h3>Key Facts</h3><ul><li>T Code: SE11</li><li>Purpose: Used for data storage and managing database objects.</li><li>Function: Central place in SAP that stores information about data (metadata). Helps create and manage database tables and defines reusable data types (structure, domain, data elements).</li><li>Storage: Stored inside the SAP database.</li><li>Scope: Known as the global area. Objects in the dictionary are global to all ABAP programs and can be referenced directly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*m_Hz3rUDRNOyfqTuX0VZLg.png" /><figcaption>Initial screen of Abap Dictionary</figcaption></figure><h3>The Three Basic Objects in ABAP Dictionary</h3><h3>1. Domain (Data Type : How data is stored)</h3><ul><li>Defines the set of values in a field.</li><li>Provides technical definitions such as data type, length, and decimals.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*rcsv-uQvFlW1qr_utBqZKg.png" /><figcaption>Domain</figcaption></figure><h3>2. Data Element (Data Meaning : What data means)</h3><ul><li>Provides semantic definition (short description).</li><li>Describes the meaning of a domain.</li><li>Type definition for a field: Describes a single field in the dictionary.</li><li><strong>Types of Data Elements:</strong></li><li>Elementary Data Element: Based on a domain or predefined type. Used for normal data types such as CHAR, NUMC, DEC, etc.</li><li>Reference Data Element: Refers to reference types (class or structure). Used in Object Oriented ABAP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*eKRdTCKzm86u3zPCbC15BQ.png" /><figcaption>Data Element</figcaption></figure><h3>Why Data Element?</h3><ul><li>Provides field labels, search help, and help text.</li><li>Links to a Domain (which holds technical details like data type, length, decimals).</li><li>Data Type: Technical Datatype (e.g., CHAR, NUMC, DATS).</li></ul><h3>3. Table (Data Storage)</h3><ul><li>Used to hold real data.</li><li>A structured data storage object in ABAP code used to store business-related data in rows.<br> 1 . Each Row: A record (entry).<br> 2 . Each Column: A field (attribute).</li><li>Elements in a Table: Field Name, Key Flag, Data Type, Field Type, Field Length, Description.</li><li>Field: Name of the column in the table.</li><li>Primary Key: Unique identifier.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00PDiE0yXF0cCA_Ll3Ug2A.png" /></figure><h3>SAP Tables: Types and Attributes</h3><h3>Types of Tables</h3><ol><li>Transparent Table: Directly stores application data.</li><li>Cluster Table: Stores control data and system data (multiple tables are stored in a single database table).</li><li>Pooled Table: Logical tables grouped into a single database table.</li><li>Internal Table: Exists only in program memory during execution. Used by ABAP programs to process data dynamically.</li><li>System Table: Contains SAP system data (runtime and configuration).</li><li>Custom Tables: Created for specific customer needs.</li></ol><h3>Table Attributes</h3><p>Attributes show general properties of the table such as package and table description.</p><h4>1. Delivery and Maintenance</h4><p>Defines delivery class and Data Browser/Table View settings.</p><p>Delivery Class: Specifies how the table is managed and transported between SAP systems (DEV → QA → PROD).</p><ul><li>A Application Data: Stores master data and transaction data (business data). Data is not transported between systems.</li><li>C Customizing Table: Customer maintenance only. Stores configuration (customizing data) maintained by the customer.</li><li>L Local Data: Data is local to the system and not transported. Used for temporary or local system tables.</li><li>G Customizing (Protected against SAP Upgrade): Stores customizing data but protected from SAP standard upgrade. Only insert is allowed; update and delete are restricted.</li><li>E Control Table: SAP and customer have separate key areas. Used where both SAP and customer store entries in different key ranges.</li><li>S System Table: Edited and maintained only by SAP. Delivered by SAP and not changed by the customer.</li><li>W System Table (Transport Depends): Contents are transported using transport requests (TR).</li></ul><h4>2. Data Class</h4><p>Defines where the table should be created.</p><ul><li>Appl0: Master Data -&gt; Relatively static data, doesn’t change often.</li><li>Appl1: Transaction Data -&gt; Dynamic data, changes frequently.</li><li>Appl2: Organizational &amp; Customizing Data -&gt; Configuration / Control data.</li></ul><h4>3. BW Concepts</h4><ul><li>Fact Table: Core table of an InfoCube.</li><li>Dimension Table: Stores descriptive/contextual information.</li><li>ODS (Operational Data Store) Table: Used for detailed, line level data.</li></ul><h4>4. Data Size</h4><p>It tells SAP how many records you expect in the table. Based on this, SAP decides how much initial space to allocate in the database.</p><ul><li>What happens if records go beyond?</li><li>Tables are stored in blocks of memory called extents.</li><li>If the initial space is filled, the DB extends the table by new extents.</li><li>So, the table will not stop working if the records exceed the limit.</li></ul><h4>5. Data Browser / Table View</h4><ul><li>Display/Maintenance Not Allowed: Security Related Tables. Table data cannot be displayed or edited. Used for highly sensitive tables.</li><li>Display/Maintenance Allowed with Restriction: Tables can be displayed or edited based on authorization. Controlled by authorization object S_TABU_DIS. Only authorized users can edit the table.</li><li>Display/Maintenance Allowed: Both display and change activities are allowed (activity-based control). Commonly used for testing or small custom tables.</li><li>Display/Maintenance Allowed with Authorization Group: Maintenance is allowed but controlled by an Authorization Group. Used for sensitive customizing tables.</li><li>Authorization groups are stored in TDDAT (Table for Authorization Groups in Table Maintenance).</li><li><em>Example:</em> Discount rates visible only to Finance team using authorization group FIN1 in TDDAT. Only users assigned to FIN1 can edit the table; others cannot.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4r5uZzTaWgvpOKToSHq_A.png" /></figure><h4>6. Buffering</h4><p>Stores table data in application server memory to reduce database hits &amp; improve performance. Instead of going to DB every time, SAP fetches data directly from memory (buffer).</p><ul><li>Single Record Buffering: Only individual rows are buffered.</li><li>Generic Area Buffering: Buffer a set of records based on the leftmost part of key field.</li><li>Full Buffering: Entire table is buffered in memory at once.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*cO89bJ5a35lpyA1YNhN5PQ.png" /></figure><h4>7. Log Changes</h4><p>The setting decides if changes to table records (new, update, delete) should be logged. Helps in tracking changes, useful in sensitive/customizing tables.</p><ul><li>Logged in change document tables (DBTABLOG).</li></ul><h4>8. Sharing</h4><p>SAP supports a multi-tenant environment. Each client (100, 200, 300) represents a separate business entity. Some tables are client-specific, while others are cross-client (shared across all clients).</p><ul><li>C → Tenant table: Client dependent table.</li><li>R → Table shared by tenant: Read only.</li><li>N → Table with mixed content: Separated using key range.</li><li>T → Table with mixed content: Separated using TADIR.</li><li>S → Table with mixed content: System objects only — SAP repository objects only.</li></ul><h3>Other DDIC Objects</h3><h3>Structure</h3><ul><li>A data object made up of components of any datatype stored one after another in memory.</li><li>Defined using the TYPES statement.</li><li>Can have a maximum of 1024 fields.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_ywE10eM2vANul58iHzdQ.png" /></figure><h3>View</h3><p>A view looks like a table but does not store data physically. It displays data from one or more database tables.</p><ul><li>Why Views?</li><li>To see specific data from one or more tables together.</li><li>To hide unwanted fields.</li><li>To simplify access without complex joins.</li><li>To control user access.</li><li><strong>Types of Views:<br></strong>1<strong> .</strong> Database View: Combines data from multiple tables using inner join.<br>2 . Projection View: Displays selected fields from a single table.<br>3 . Maintenance View: Allows viewing and updating data from multiple tables.<br>4 . Help View: Used to show data in Search Help (F4 Help).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*5v5sEg3lD-BKYsGb1nhNFw.png" /><figcaption>Types of View</figcaption></figure><h3>Search Help</h3><ul><li>Provides input options for user selection.</li><li>Displays all the possible values for a field in the form of a list, also called a hitlist.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*cTw96IxlKi2_ChEH4Ui4Cg.png" /></figure><h3>Lock Object</h3><p>Used to prevent multiple users from editing the same record simultaneously. It is a feature offered by SAP Dictionary used to synchronize access to the same data by more than one program. It ensures that data remains consistent in the database.</p><ul><li>Components: 2 main components are Field &amp; Module.</li><li>Lock Arguments: Key fields used to identify the record to lock.</li><li>Function Module: Automatically generated functions:</li><li>ENQUEUE_ (Set Lock)</li><li>DEQUEUE_ (Release Lock)</li><li><strong>Types of Locks:<br></strong>1<strong> . </strong>Read Lock (Shared Lock): Multiple programs can read, none can change.<br>2 . Write Lock (Exclusive Lock): Only one program can read/change.<br>3 . Enhanced Write Lock: Prevents further read access.<br>4 . Optimistic Lock: Checks if data changed during processing.</li></ul><h3>Modularization</h3><p>Definition: Breaking a big, complex program into small, reusable, and easy to understand parts (modules). Organizing a program into smaller independent blocks, so that each block performs a specific task.</p><h3>Types of Modularization</h3><h4>1. Source Code Level</h4><p><em>Small reusable code within the same program.</em></p><ul><li>Local Macros: Short code snippets defined with DEFINE &amp; END-OF-DEFINITION.</li><li>Include Programs: External reusable code files.</li></ul><h4>2. Processing Blocks</h4><p><em>Bigger reusable modules that can be called from different programs.</em></p><ul><li>Subroutines: (FORM…ENDFORM) – A set of ABAP statements performing one task.</li><li>Function Modules: (CALL FUNCTION) – Reusable, global procedure stored in function groups.</li></ul><h4>3. Event Block &amp; Dialog Module</h4><ul><li>Event Blocks: Automatic program action like START-OF-SELECTION.</li><li>Dialog Modules: User-triggered screen action like MODULE USER_COMMAND.</li></ul><h3>Subroutine</h3><ul><li>Defined with FORM &amp; ENDFORM.</li><li>It is a module &amp; reusable block of code within an ABAP program.</li></ul><h3><strong>Final Thoughts</strong></h3><p>ABAP Data Dictionary (DDIC) is not just about defining tables, it’s the foundation of how data is structured, managed, and reused across the entire SAP system. Understanding Domains, Data Elements, Tables, and other DDIC objects helps you build clean, consistent, and efficient applications.</p><p>Mastering DDIC concepts can:</p><ul><li>Ensure data consistency across programs</li><li>Improve performance using buffering and proper table design</li><li>Help you create reusable and maintainable data definitions</li><li>Strengthen your core ABAP development skills</li><li>Make database handling more structured and efficient</li></ul><p>This blog is written as:</p><p>A simple guide for beginners and a handy reference for real time DDIC usage in projects.</p><p>I’ll be documenting my SAP ABAP learning journey here , follow along for more practical and beginner friendly insights.</p><p>Thanks for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f964a322f05c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the ABAP Enhancement Framework: Implicit vs.]]></title>
            <link>https://medium.com/@asmamalica07/mastering-the-abap-enhancement-framework-implicit-vs-abac200396f4?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/abac200396f4</guid>
            <category><![CDATA[explicit-enhancement]]></category>
            <category><![CDATA[modification]]></category>
            <category><![CDATA[sap-abap-enhancement]]></category>
            <category><![CDATA[implicit-enhancement]]></category>
            <category><![CDATA[customer-exit]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 07:27:55 GMT</pubDate>
            <atom:updated>2026-03-03T15:04:47.981Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mastering the ABAP Enhancement Framework: Implicit vs. Explicit Enhancements, Customer Exits, BAdIs &amp; Beyond</h3><h3>WHAT is Enhancement?</h3><p>Enhancement allows you to customize standard SAP functionality such as adding logic, fields, or screens WITHOUT modifying the original source code. You enhance SAP functionality in the customer namespace (Z or Y).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MaVyizgtJzzemTKBlSmi6g.png" /></figure><h3>WHAT is Modification?</h3><p>Modification enhances in the SAP namespace (objects NOT starting with Z or Y) this is risky and should be avoided!</p><h3>WHY Enhancement?</h3><ul><li>Upgrade Safe: Your customizations survive system upgrades</li><li>SAP Supported: Officially supported by SAP</li><li>No Conflicts: Doesn’t touch standard SAP code</li><li>Easy Maintenance: Clean separation between standard and custom</li><li>Future Proof: Works across S/4HANA migrations</li></ul><h3>WHY not Modification?</h3><ul><li>Overwritten during upgrades</li><li>Voids SAP support</li><li>Creates upgrade nightmares</li><li>Hard to maintain</li></ul><h3>WHEN to Use Enhancements?</h3><ul><li>Adding custom validation logic</li><li>Including custom fields in screens</li><li>Modifying standard business processes</li><li>Integrating with external systems</li><li>Adding custom menu items</li><li>ALWAYS use enhancement before considering modification</li></ul><h3>TYPES OF ENHANCEMENTS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0XiiP6bj-hCU9oM1RvhmA.png" /></figure><h4>1. Implicit Enhancement Points</h4><p>Available automatically at strategic locations:</p><ul><li>Start/end of programs</li><li>Beginning/end of subroutines</li><li>Entry/exit of function modules</li></ul><p><strong>How to implement </strong>:</p><ol><li>Open transaction SE37, load function module REUSE_ALV_GRID_DISPLAY</li><li>Go to <em>Edit → Enhancement Operations → Show Implicit Enhancement Options</em></li><li>Notice the highlighted first/last lines</li><li>Position cursor → Press Shift+F4 → <em>Enhancement Operations → Create Implementation</em></li><li>Choose implementation type: <em>Declaration</em>, <em>Code</em>, or <em>Include</em></li><li>Write your custom logic → Activate</li></ol><p>⚠️ Critical Practice Tip: When experimenting in standard SAP objects (like above), always undo your changes afterward. Never activate implementations directly in SAP namespace objects this becomes a modification</p><h4>2. Explicit Enhancement Points &amp; Sections</h4><p>Inserted deliberately by SAP developers at precise locations needing flexibility:</p><pre>ENHANCEMENT-POINT ep_sales_order_validation SPOTS esd_sales.<br><br>ENHANCEMENT-SECTION es_validate_pricing SPOTS esd_pricing.<br>  &quot; Standard SAP pricing logic here<br>END-ENHANCEMENT-SECTION.</pre><ul><li>Enhancement Point: Inject code <em>at</em> a specific line</li><li>Enhancement Section: <em>Replace</em> an entire block of standard code with your custom version</li></ul><p>These give SAP-controlled flexibility while maintaining architectural integrity.</p><h3>The Power Tools in the Enhancement Toolkit</h3><h4>1. Customer Exits</h4><p>Customer exits let you plug custom logic into SAP via predefined hooks — all within your Z/Y namespace.</p><p>Three Types:</p><pre>┌──────────────────────┬──────────────────────────────┬────────────────────────┐<br>│      TYPE            │          PURPOSE             │     SYNTAX HOOK        │<br>├──────────────────────┼──────────────────────────────┼────────────────────────┤<br>│ Function Module Exit │ Add custom logic during      │ CALL CUSTOMER-FUNCTION │<br>│                      │ process flow                 │ &#39;001&#39;                  │<br>├──────────────────────┼──────────────────────────────┼────────────────────────┤<br>│   Menu Exit          │ Inject custom menu items     │ Function codes         │<br>│                      │ into SAP GUI                 │ starting with +        │<br>├──────────────────────┼──────────────────────────────┼────────────────────────┤<br>│   Screen Exit        │ Add custom fields/screens    │ CALL CUSTOMER-         │<br>│                      │ to SAP transactions          │ SUBSCREEN              │<br>└──────────────────────┴──────────────────────────────┴────────────────────────┘</pre><p><strong>Function Module Exits</strong></p><p>Finding Function Module Exits:</p><ul><li>Set breakpoint on CALL CUSTOMER-FUNCTION</li><li>Transaction SMOD → Utilities → Find → Enter package name</li><li>Transaction SE84 → Enhancements → Customer Exits → Filter by package</li></ul><p>Implementation Workflow (CMOD):</p><ol><li>Transaction CMOD → Create Project (e.g., Z_SALES_ENHANCE)</li><li><em>Enhancement Assignment</em> tab → Assign customer exit name (e.g., VA01_001)</li><li><em>Components</em> tab → Double-click function module</li><li>Code your logic in the Z include (never modify standard includes!)</li><li>Activate the project</li></ol><p><strong>Menu Exit Implementation: </strong>After assigning the exit in CMOD:</p><ul><li>Double click the menu exit component</li><li>Define: Function text, icon, tooltip text</li><li>Your custom menu item appears instantly in the SAP GUI menu bar</li></ul><p><strong>Screen Exit Implementation:</strong></p><ol><li>Identify subscreen area via System → Status (note screen number)</li><li>Check screen flow logic for CALL CUSTOMER-SUBSCREEN &lt;area_name&gt;</li><li>In CMOD component tab → Create your subscreen (screen type = <em>Subscreen</em>)</li><li>Design layout → Link via INCLUDING &lt;prog_name&gt; &lt;screen_no&gt;</li><li>Activate → Custom fields render seamlessly within SAP’s standard screen</li></ol><h4>2. BAdI (Business Add Ins) : The OOP Powerhouse</h4><p>BAdIs leverage Object-Oriented Programming for cleaner, more maintainable enhancements.</p><pre>┌──────────────────┬─────────────────────────┬─────────────────────────┐<br>│     ASPECT       │    CLASSIC BAdI         │   NEW (KERNEL) BAdI     │<br>├──────────────────┼─────────────────────────┼─────────────────────────┤<br>│ Finding Method   │ CL_EXITHANDLER=&gt;        │ Breakpoint on           │<br>│                  │ GET_INSTANCE            │ GET BADI / CALL BADI    │<br>├──────────────────┼─────────────────────────┼─────────────────────────┤<br>│   Structure      │ Direct definition →     │ Enhancement Spot →      │<br>│                  │ implementation          │ Enhancement Impl → BAdI │<br>├──────────────────┼─────────────────────────┼─────────────────────────┤<br>│ Class Creation   │ Auto-generated          │ Manual class name       │<br>│                  │ class name              │ assignment              │<br>├──────────────────┼─────────────────────────┼─────────────────────────┤<br>│  Transaction     │ SE18 (Definition),      │ Same, but with          │<br>│                  │ SE19 (Implementation)   │ enhancement containers  │<br>└──────────────────┴─────────────────────────┴─────────────────────────┘</pre><p>Classic BAdI Implementation (SE19):</p><ol><li>SE19 → Select <em>Classic BAdI</em> → Enter definition name (e.g., MB_DOCUMENT_BADI)</li><li>Create implementation → Provide name/description (e.g., Z_MB_DOC_VAL)</li><li><em>Interface</em> tab → Double-click auto-generated class</li><li>Implement methods → Activate class → Activate BAdI</li></ol><p>New BAdI Implementation:</p><ol><li>SE19 → Select <em>New BAdI</em> → Enter Enhancement Spot name</li><li>Create Enhancement Implementation (container)</li><li>Within it, create BAdI Implementation + assign custom class</li><li>Code your logic → Activate entire stack</li></ol><blockquote>Discovery Shortcut: In SE18, press F4 on BAdI name → Check <em>Package</em> field to find relevant BAdIs for your module.</blockquote><h4>3. BTE (Business Transaction Events)</h4><p>BTE attaches custom function modules to financial events — perfect for accounting validations, custom postings, or integration triggers.</p><ul><li>Transaction: FIBF (Event activation &amp; configuration)</li><li>Two Models:<br> Process Interface: Single custom implementation per event<br> Publish &amp; Subscribe: Multiple subscribers can react to same event</li></ul><blockquote>Best For: FI/CO teams needing event driven customizations without touching core financial code.</blockquote><h4>4. User Exits -The SD Module Specialist</h4><p>User exits are subroutine-based hooks exclusive to SD module (Sales &amp; Distribution). They appear as USEREXIT_* forms in programs like MV45AFZZ.</p><blockquote>Important: Though called “exits,” these live in SAP namespace technically modifications. Use only when no BAdI/Enhancement Point exists.</blockquote><p>✅ <strong>Final Thoughts</strong></p><p>The ABAP Enhancement Framework is not just a technical feature , it’s a mindset shift from modifying SAP to extending it intelligently and safely.</p><p>Understanding the difference between enhancements and modifications is crucial for every SAP developer. While modifications may seem quick, they create long-term risks. Enhancements, on the other hand, ensure stability, scalability, and upgrade safety across systems like SAP S/4HANA.</p><p>Mastering tools like Enhancement Points, Customer Exits, BAdIs, and BTEs allows you to:</p><p>🔹Build solutions without breaking standard SAP<br>🔹Design cleaner and maintainable code using OOP principles<br>🔹Choose the right enhancement technique for each business scenario<br>🔹Ensure smooth upgrades and long-term system reliability<br>🔹Deliver real-world SAP solutions with confidence</p><p>The key takeaway is simple: <strong>Always enhance, never modify (unless absolutely necessary).</strong></p><p>This approach not only aligns with SAP best practices but also makes you a smarter and more future-ready ABAP developer.</p><p>This blog is written as:<br>🔹A practical guide for beginners and intermediate developers<br>🔹A quick reference during real time SAP project implementations</p><p>I’ll continue sharing more structured and real world SAP knowledge , follow along to grow step by step in your SAP journey.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abac200396f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SAP Workflow for Beginners : Triggering Processes from an ALV Report]]></title>
            <link>https://medium.com/@asmamalica07/sap-workflow-for-beginners-triggering-processes-from-an-alv-report-0a38be9b5f1e?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a38be9b5f1e</guid>
            <category><![CDATA[process-automation]]></category>
            <category><![CDATA[hotspots]]></category>
            <category><![CDATA[abap-alv]]></category>
            <category><![CDATA[sap-workflow]]></category>
            <category><![CDATA[bor-object]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 14:16:50 GMT</pubDate>
            <atom:updated>2026-02-20T14:16:50.765Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction</h3><p>Welcome to the world of SAP Workflow ! If you are new to SAP, the term “Workflow” might sound complicated. But in reality, it is something we do every day in real life.</p><p>Imagine you want to buy a laptop for your company.</p><ol><li>You raise a request.</li><li>Your Manager approves it.</li><li>The Purchase Department orders it.</li><li>You get the laptop.</li></ol><p>This sequence of steps is a Workflow. In SAP, we automate this so that emails are sent automatically, approvals happen in the system, and nothing gets lost.</p><p>In this blog , we will learn how to create a simple report where a user clicks a button (Hotspot) to trigger a Workflow event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMglQwpjqt2FbFSFPZDuBA.png" /><figcaption>Workflow</figcaption></figure><h3>2. The “ Wh ” Questions of Workflow</h3><p>Before we write code, let’s understand the basics .</p><h3>What is SAP Workflow?</h3><p>SAP Workflow is a tool that automates business processes. It moves information and tasks from one person to another automatically based on rules.</p><h3>Why do we need it?</h3><ul><li>Speed: No need to walk to a manager’s desk for a signature.</li><li>Accuracy: The system ensures no step is skipped.</li><li>Tracking: You can see exactly who approved what and when.</li><li>Automation: Emails and notifications are sent without human intervention.</li></ul><h3>When should we use it?</h3><ul><li>When a process requires approval (e.g., Leave Request, Purchase Order).</li><li>When a task needs to be done repeatedly by different people.</li><li>When you need to notify someone about an important change.</li></ul><h3>Who uses it?</h3><ul><li>Initiator: The person who starts the process (You, clicking the button).</li><li>Agent: The person who has to do the work (The Manager who approves).</li><li>Administrator: The person who configures the workflow (The ABAP Developer/Consultant).</li></ul><h3>3. Workflow Dictionary: Key Terms Defined</h3><p>To understand workflow, you must know the language. Here are the basic definitions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*hIKRvrbRJeQTFbjWPQNpaA.png" /><figcaption>Workflow dictionary</figcaption></figure><h3>4. Our Scenario: The “Send Mail” Hotspot</h3><p>In this task, we are building a report that shows Purchase Orders.</p><ol><li>The report displays data in an ALV Grid.</li><li>We add a special column called “SEND MAIL”.</li><li>This column is a Hotspot (clickable link).</li><li>When clicked, it raises an Event (PURCHASE_EVENT).</li><li>This Event can trigger a Workflow.</li></ol><h3>5. Step by Step Implementation</h3><h3>Step 1: Create the Business Object (Transaction SWO1)</h3><p>Before coding, we need to tell SAP what object we are working with.</p><ol><li>Go to Transaction SWO1.</li><li>Create a new Object Type: ZBUS_PO63.</li><li>Description: Z Purchase Order Object.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*mLypba_U75tRcKpE5NkLMw.png" /></figure><p>4. Key Field: Add a field to identify the object (e.g., EBELN or a generic character field). This is the Purchase Order Number. click on yes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*T9M2B0Tv4OvQ1u4POICD3g.png" /><figcaption>click on yes for creating the key field</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yofonI8aTQgl0gasSfA3og.png" /></figure><p>5. Events Tab: Create a new Event named PURCHASE_EVENT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*xPqv-Lqd45fkf3hSMtFOYQ.png" /></figure><p>6. Generate the object.</p><blockquote><em>Why? The ABAP code needs to know where to send the signal. </em><em>ZBUS_P is the address, and </em><em>PURCHASE_EVENT is the doorbell.</em></blockquote><h3>Step 2: The ABAP Code</h3><p>Here is the complete code with beginner friendly explanations.Write the code in se38 (report) .</p><pre>REPORT ZREPORT_WORKFLOW.<br><br>TABLES: ekko. &quot;Purchase Order Header Table<br>SELECT-OPTIONS: s_ebeln FOR ekko-ebeln. &quot;Input field for PO Number<br><br>CLASS localclass DEFINITION.<br>  PUBLIC SECTION.<br>    METHODS:<br>      get_data,      &quot;Fetches data from database<br>      display_alv,   &quot;Shows data on screen<br>      hotspot        &quot;Handles the click event<br>        FOR EVENT link_click OF cl_salv_events_table<br>        IMPORTING row column.<br>  PRIVATE SECTION.<br>    TYPES: BEGIN OF ty_ekko,<br>             ebeln     TYPE ekko-ebeln,<br>             bukrs     TYPE ekko-bukrs,<br>             lifnr     TYPE ekko-lifnr,<br>             ekorg     TYPE ekko-ekorg,<br>             send_mail TYPE string, &quot;Virtual column for the button<br>           END OF ty_ekko.<br>    DATA:<br>      lt_ekko   TYPE TABLE OF ty_ekko,<br>      lo_alv    TYPE REF TO cl_salv_table,<br>      lo_events TYPE REF TO cl_salv_events_table.<br>ENDCLASS.<br><br>CLASS localclass IMPLEMENTATION.<br><br>  METHOD get_data.<br>    &quot;1. Get Data from Database<br>    SELECT ebeln bukrs lifnr ekorg<br>      INTO CORRESPONDING FIELDS OF TABLE lt_ekko<br>      UP TO 5 ROWS<br>      FROM ekko<br>      WHERE ebeln IN s_ebeln.<br><br>    &quot;2. Fill the Hotspot column with text<br>    LOOP AT lt_ekko INTO DATA(ls_ekko).<br>      ls_ekko-send_mail = &#39;SEND MAIL&#39;. <br>      MODIFY lt_ekko FROM ls_ekko.<br>    ENDLOOP.<br>  ENDMETHOD.<br><br>  METHOD display_alv.<br>    DATA: lo_columns TYPE REF TO cl_salv_columns_table,<br>          lo_column  TYPE REF TO cl_salv_column_table.<br><br>    IF lt_ekko IS INITIAL.<br>      MESSAGE &#39;No data found&#39; TYPE &#39;I&#39;.<br>      RETURN.<br>    ENDIF.<br><br>    TRY.<br>        &quot;Create the ALV Grid<br>        cl_salv_table=&gt;factory(<br>          IMPORTING r_salv_table = lo_alv<br>          CHANGING  t_table      = lt_ekko ).<br><br>        &quot;Enable standard functions (Export, Print)<br>        lo_alv-&gt;get_functions( )-&gt;set_all( abap_true ).<br>        lo_alv-&gt;get_display_settings( )-&gt;set_list_header( &#39;Purchase Orders&#39; ).<br><br>        &quot;--- MAKE THE COLUMN CLICKABLE (HOTSPOT) ---&quot;<br>        lo_columns = lo_alv-&gt;get_columns( ).<br>        TRY.<br>            lo_column ?= lo_columns-&gt;get_column( &#39;SEND_MAIL&#39; ).<br>            &quot;This line makes the text look like a link<br>            lo_column-&gt;set_cell_type( if_salv_c_cell_type=&gt;hotspot ).<br>            <br>            &quot;Set Column Headers<br>            lo_column-&gt;set_short_text( &#39;Mail&#39; ).<br>            lo_column-&gt;set_medium_text( &#39;Send Mail&#39; ).<br>            lo_column-&gt;set_long_text( &#39;Send Mail to Vendor&#39; ).<br>          CATCH cx_salv_not_found.<br>        ENDTRY.<br><br>        &quot;--- REGISTER THE EVENT HANDLER ---&quot;<br>        lo_events = lo_alv-&gt;get_event( ).<br>        &quot;Tell the system: If clicked, run method &#39;hotspot&#39;<br>        SET HANDLER me-&gt;hotspot FOR lo_events.<br><br>        lo_alv-&gt;display( ).<br><br>      CATCH cx_salv_msg INTO DATA(lx_msg).<br>        MESSAGE lx_msg-&gt;get_text( ) TYPE &#39;E&#39;.<br>    ENDTRY.<br>  ENDMETHOD.<br><br>  METHOD hotspot.<br>    DATA: ls_ekko   TYPE ty_ekko,<br>          lv_objkey TYPE swo_typeid.<br><br>    &quot;Find which row was clicked<br><br>    READ TABLE lt_ekko INTO ls_ekko INDEX row.<br>    IF sy-subrc = 0 AND column = &#39;SEND_MAIL&#39;.<br>      &quot;Get the Purchase Order Number<br>      lv_objkey = ls_ekko-ebeln.<br>      &quot;--- TRIGGER THE WORKFLOW EVENT ---&quot;<br>      CALL FUNCTION &#39;SWE_EVENT_CREATE&#39;<br>        EXPORTING<br>          objtype = &#39;ZBUS_P&#39;        &quot;BOR Object we created<br>          objkey  = lv_objkey       &quot;PO Number<br>          event   = &#39;PURCHASE_EVENT&#39; &quot;Event Name<br>        EXCEPTIONS<br>          OTHERS  = 1.<br>      IF sy-subrc = 0.<br>        COMMIT WORK. &quot;Save the event to database<br>        MESSAGE &#39;Mail sent&#39; TYPE &#39;I&#39;.<br>      ELSE.<br>        MESSAGE &#39;Failed to Trigger Event&#39; TYPE &#39;E&#39;.<br>      ENDIF.<br>    ENDIF.<br>  ENDMETHOD.<br>ENDCLASS.<br>START-OF-SELECTION.<br>  DATA: lo_report TYPE REF TO localclass.<br>  CREATE OBJECT lo_report.<br>  lo_report-&gt;get_data( ).<br>  lo_report-&gt;display_alv( ).</pre><h3>Code Explanation for Beginners</h3><ol><li>send_mail TYPE string: We created a fake column in our data table. It doesn&#39;t exist in the database. We use it just to show the word &quot;SEND MAIL&quot; on the screen.</li><li>set_cell_type( ... =&gt; hotspot ): This line tells the ALV grid to render that text as a underlined link.</li><li>FOR EVENT link_click: This tells the hotspot method to run only when someone clicks a link.</li><li>SWE_EVENT_CREATE: This Function Module is the bridge between ABAP and Workflow. It shouts &quot;Hey! Something happened!&quot; to the Workflow system.</li></ol><h3>Step 3 : Create Workflow Template (SWDD)</h3><ol><li>Go to Transaction SWDD (Workflow Builder)</li><li>Create New Workflow:</li></ol><ul><li>Click the Create button</li><li>Enter Workflow Template name (e.g., WS92000139)</li><li>Description: “Purchase Order Mail Notification”</li><li>Click Enter</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKXplroAWSJXHuoNH40X1A.png" /><figcaption>workflow step</figcaption></figure><p>3. Add Send Mail Step:</p><ul><li>In the “Step Types That Can Be Inserted” panel (left side), select Send Mail</li><li>Drag and drop it into the workflow canvas</li><li>Or double-click on “Send Mail” to add it</li></ul><p>4 . Configure Send Mail Step :</p><ul><li>Recipient Type: Organizational Object (or &quot;G&quot;)</li><li>Expression: &amp; WF_INITIATOR &amp;</li><li>This sends the mail to the person who triggered the workflow</li><li>Subject: purchase order</li><li>Body/Text: po listed</li><li>click on goto and move on to the basic data .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x3tPOELq829DHkvw30wXuA.png" /></figure><p>5. Save and Activate:</p><ul><li>Click the Save button (Ctrl+S)</li><li>Click the Activate button (F8)</li><li>Note the Workflow ID (starts with WS)</li></ul><h3>Step 4 : How to Test Your Work</h3><ol><li>Run the Report: Execute ZREPORT_WORKFLOW.</li><li>Enter a PO Number: Put a valid Purchase Order number in the selection screen.</li><li>Click the Hotspot: Click on the “SEND MAIL” text in the grid.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*LasP04W-qY6cChPYJHm1-A.png" /></figure><p>4. Check the Message: You should see “Mail sent ” as the information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*rdvrI7llgWBzcu3L9XcELw.png" /></figure><p>5 . Verify the Event (Important!):</p><ul><li>Go to Transaction SWEL (Event Trace).</li><li>Click Execute.</li><li>Go back to your report and click the hotspot again.</li><li>Refresh SWEL.</li><li>You will see a new entry with Object ZBUS_P and Event PURCHASE_EVENT. This proves your code works!</li></ul><p>6. Check Inbox:</p><ul><li>If you linked a real workflow in SWO1, go to Transaction SBWP (Business Workplace).</li><li>Check the Inbox. You might see a new Work Item .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yvIxvyQ_tCFrXhzIp8AhuA.png" /></figure><h3>✅Final Thoughts</h3><p>SAP Workflow Integration is not just about triggering events, it’s about automating business processes seamlessly. Knowing how to use BOR objects, ALV hotspots, event linkage, and workflow templates makes automation powerful, structured, and time efficient.</p><p>Mastering these techniques can:</p><ul><li>Save manual effort on approvals</li><li>Improve overall process understanding</li><li>Help you confidently trigger background processes</li><li>Make you more effective in real-time automation projects</li></ul><p>This blog is written as:</p><p>A simple guide for beginners a future reference during real project workflow implementation .</p><p>I’ll be documenting my SAP ABAP learning journey here , follow to stay connected with practical and beginner friendly insights.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a38be9b5f1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Object-Oriented Programming (OOPS) in ABAP — A Practical Guide with Examples]]></title>
            <link>https://medium.com/@asmamalica07/object-oriented-programming-oops-in-abap-a-practical-guide-with-examples-ea925c4dd0fa?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea925c4dd0fa</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[abap]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 17:06:10 GMT</pubDate>
            <atom:updated>2026-02-06T17:06:10.831Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Object-Oriented Programming (OOPS) in ABAP — A Practical Guide with Examples</h3><p>SAP ABAP has evolved significantly over the years, and <strong>Object-Oriented Programming (OOPS)</strong> is at the heart of modern ABAP development. If you’re still thinking in procedural terms, this guide will help you transition smoothly into OOP with <strong>real ABAP examples</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qr1f3tWHFeGPqlBeDzv22g.png" /><figcaption>OOP in SABAP</figcaption></figure><p>Let’s break everything down step by step 👇</p><h3>🔹 What is OOPS?</h3><p><strong>Object-Oriented Programming System (OOPS)</strong> is a programming paradigm based on <strong>objects</strong> and <strong>classes</strong>, helping us write reusable, maintainable, and scalable code.</p><h3>🔸 Class</h3><p>A <strong>class</strong> is a blueprint or template that defines:</p><ul><li>Attributes (Data)</li><li>Methods (Logic)</li><li>Events</li><li>Interfaces</li><li>Types</li><li>Aliases</li><li>Friends</li><li>Properties</li></ul><h3>🔸 Object</h3><p>An <strong>object</strong> is an <strong>instance of a class</strong> — the real, usable result created from the class.</p><h3>🔹 Types of Classes in ABAP</h3><h3>1️⃣ Global Class</h3><ul><li>Created using <strong>T-Code: SE24 (Class Builder)</strong></li><li>Can be reused across multiple programs</li></ul><h3>2️⃣ Local Class</h3><ul><li>Exists only inside one program</li><li>Created in <strong>SE38</strong></li><li>Cannot be reused elsewhere</li></ul><h3>🔹 Types of ABAP Classes</h3><p>Class TypePurpose<strong>Usual ABAP Class</strong>Business logic (similar to Function Modules)<strong>Exception Class</strong>Raising and handling exceptions<strong>Persistence Class</strong>Database operations (INSERT, UPDATE, DELETE)<strong>Unit Test Class</strong>Writing unit test cases</p><h3>🔹 Structure of a Class</h3><ul><li><strong>Class Definition</strong> → Declarations</li><li><strong>Class Implementation</strong> → Logic</li></ul><h3>🧩 Usual ABAP Class (Global Class Example)</h3><p>Let’s create a global class <strong>ZUSUAL_ABAP_CLASS</strong> in SE24.</p><p>We write logic using <strong>methods</strong>.</p><h3>🔹 Types of Methods</h3><h3>🔸 Instance Method</h3><ul><li>Requires an object to be created</li><li>Called using -&gt;</li></ul><h3>🔸 Static Method</h3><ul><li>No object needed</li><li>Called using =&gt;</li></ul><h3>🔹 Method Visibility</h3><p>VisibilityAccess Scope<strong>Public</strong>Class, Subclasses, Outside<strong>Protected</strong>Class &amp; Subclasses<strong>Private</strong>Class only</p><h3>🔹 Method Parameters</h3><p>ParameterDescription<strong>IMPORTING</strong>Input<strong>EXPORTING</strong>Output<strong>CHANGING</strong>Input + Output<strong>RETURNING</strong>Only one allowed</p><h3>🧪 Example: Instance Method</h3><h3>📌 Method Implementation (Inside Class)</h3><pre>METHOD display.<br>  SELECT SINGLE erdat erzet ernam vbtyp<br>    FROM vbak<br>    INTO (perdat, perzet, pernam, pvbtyp)<br>    WHERE vbeln = pvbeln.</pre><pre>  IF sy-subrc &lt;&gt; 0.<br>    RAISE wrong_input.<br>  ENDIF.<br>ENDMETHOD.</pre><h3>📌 Report Program (Without Object Creation ❌)</h3><pre>DATA lo_obj TYPE REF TO zusual_abap_class.</pre><pre>CALL METHOD lo_obj-&gt;display.</pre><p>⚠️ <strong>Runtime Error!</strong><br>We declared the object but didn’t create it.</p><h3>✅ Correct Way: Create the Object</h3><pre>DATA lo_obj TYPE REF TO zusual_abap_class.<br>CREATE OBJECT lo_obj.</pre><pre>CALL METHOD lo_obj-&gt;display<br>  EXPORTING pvbeln = p_vbeln<br>  IMPORTING perdat = lv_erdat<br>            perzet = lv_erzet<br>            pernam = lv_ernam<br>            pvbtyp = lv_vbtyp.</pre><p>✔️ Works perfectly!</p><h3>🧪 Example: Static Method</h3><p>No object required 👇</p><pre>CALL METHOD zusual_abap_class=&gt;display<br>  EXPORTING pvbeln = p_vbeln<br>  IMPORTING perdat = lv_erdat<br>            perzet = lv_erzet<br>            pernam = lv_ernam<br>            pvbtyp = lv_vbtyp.</pre><h3>🏠 Local Class Example (SE38)</h3><p>Local classes are <strong>program-specific</strong>.</p><pre>CLASS localclass DEFINITION.<br>  PUBLIC SECTION.<br>    METHODS display<br>      IMPORTING pvbeln TYPE vbeln_va<br>      EXPORTING perdat TYPE erdat<br>                perzet TYPE erzet<br>                pernam TYPE ernam<br>                pvbtyp TYPE vbtyp.<br>ENDCLASS.</pre><pre>CLASS localclass IMPLEMENTATION.<br>  METHOD display.<br>    SELECT SINGLE erdat erzet ernam vbtyp<br>      FROM vbak<br>      INTO (perdat, perzet, pernam, pvbtyp)<br>      WHERE vbeln = pvbeln.<br>  ENDMETHOD.<br>ENDCLASS.</pre><h3>🔒 Final Class</h3><p>A <strong>final class cannot be inherited</strong>.</p><pre>CLASS finalclass DEFINITION FINAL.<br>  PUBLIC SECTION.<br>    METHODS display.<br>ENDCLASS.</pre><p>Attempting to inherit from it will cause a <strong>syntax error</strong> ❌</p><h3>🧬 Inheritance in ABAP</h3><p>Inheritance allows a subclass to reuse methods from a parent class.</p><p>✔️ <strong>Multiple inheritance is not supported</strong><br>✔️ Can be achieved using <strong>Interfaces</strong></p><h3>📌 Parent Class</h3><pre>CLASS zusual_abap_class DEFINITION.<br>  PUBLIC SECTION.<br>    METHODS display.<br>ENDCLASS.</pre><h3>📌 Subclass</h3><pre>CLASS subclass DEFINITION INHERITING FROM zusual_abap_class.<br>ENDCLASS.</pre><p>✔️ The subclass can directly use the display method.</p><h3>🧩 Abstract Class &amp; Polymorphism</h3><h3>🔹 Abstract Class</h3><ul><li>Contains at least <strong>one abstract method</strong></li><li>Cannot be instantiated</li><li>Only subclasses can be instantiated</li></ul><h3>🔹 Polymorphism</h3><ul><li>Same method name</li><li>Different behavior in different subclasses</li></ul><h3>📌 Local Abstract Class Example</h3><pre>CLASS abstract_class DEFINITION ABSTRACT.<br>  PUBLIC SECTION.<br>    METHODS display ABSTRACT.<br>ENDCLASS.</pre><h3>📌 Subclass 1 (VBAK)</h3><pre>CLASS zsubclass1 DEFINITION INHERITING FROM abstract_class.<br>  PUBLIC SECTION.<br>    METHODS display REDEFINITION.<br>ENDCLASS.</pre><pre>METHOD display.<br>  SELECT SINGLE erdat erzet ernam vbtyp<br>    FROM vbak<br>    INTO (perdat, perzet, pernam, pvbtyp)<br>    WHERE vbeln = pvbeln.<br>ENDMETHOD.</pre><h3>📌 Subclass 2 (VBRK)</h3><pre>METHOD display.<br>  SELECT SINGLE erdat erzet ernam vbtyp<br>    FROM vbrk<br>    INTO (perdat, perzet, pernam, pvbtyp)<br>    WHERE vbeln = pvbeln.<br>ENDMETHOD.</pre><h3>🎯 Final Thoughts</h3><p>OOPS in ABAP helps you:</p><ul><li>Write <strong>clean and reusable code</strong></li><li>Improve <strong>maintainability</strong></li><li>Implement <strong>real-world design patterns</strong></li><li>Prepare for <strong>modern SAP development</strong></li></ul><p>If you’re moving from classic procedural ABAP, mastering OOPS is a <strong>must</strong> 💡</p><p>👉 <em>If you found this useful, check out my previous blog:</em><br><a href="https://medium.com/@asmamalica07/understanding-different-types-of-sap-projects-a-beginner-friendly-guide-86f00497"><strong>Understanding Different Types of SAP Projects (Beginner Friendly Guide)</strong></a></p><p>I’ll continue sharing my <strong>SAP ABAP learning journey</strong> with beginner-friendly explanations.</p><p>Thanks for reading 😊<br>Happy coding with Modern ABAP 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea925c4dd0fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ABAP 7.4 New Syntax — Part 2 (Beginner-Friendly Guide)]]></title>
            <link>https://medium.com/@asmamalica07/abap-7-4-new-syntax-part-2-beginner-friendly-guide-db1e50d0beb7?source=rss-eca4c81ecad9------2</link>
            <guid isPermaLink="false">https://medium.com/p/db1e50d0beb7</guid>
            <category><![CDATA[abap]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Asmamalica]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 15:58:04 GMT</pubDate>
            <atom:updated>2026-02-02T17:11:56.635Z</atom:updated>
            <content:encoded><![CDATA[<h3>ABAP 7.4 New Syntax — Part 2 (Beginner-Friendly Guide)</h3><p>This blog is a <strong>continuation of Part 1</strong>, where we covered the basics of modern ABAP 7.4 syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4t6EhV3XmZD0kHA84WViw.png" /><figcaption>SAP ABAP 7.4 Syntax</figcaption></figure><p>In <strong>Part 2</strong>, we’ll explore <strong>more powerful and commonly used ABAP 7.4+ features</strong> with <strong>old vs new comparisons</strong>, explained in a simple way.</p><p>👉 <strong>If you haven’t read Part 1 yet:</strong><br><a href="https://medium.com/@asmamalica07/abap-7-4-new-syntax-part-1-beginner-friendly-guide-3485e4c05a5d">ABAP 7.4 New Syntax — Part 1 (Beginner-Friendly Guide)</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sJnVVjT0IG4KtiVSP0BMAA.png" /><figcaption>Modern ABAP Syntax</figcaption></figure><h3>9. ALPHA Keyword (Replacement for Conversion Function Modules)</h3><h3>OLD SYNTAX — Using Function Modules</h3><pre>DATA: lv_input  TYPE char10 VALUE &#39;123&#39;,<br>      lv_output TYPE char10.</pre><pre>CALL FUNCTION &#39;CONVERSION_EXIT_ALPHA_INPUT&#39;<br>  EXPORTING<br>    input  = lv_input<br>  IMPORTING<br>    output = lv_output.</pre><pre>WRITE lv_output.   &quot;Output: 0000000123</pre><p>To remove leading zeros:</p><pre>CALL FUNCTION &#39;CONVERSION_EXIT_ALPHA_OUTPUT&#39;<br>  EXPORTING<br>    input  = lv_output<br>  IMPORTING<br>    output = lv_input.</pre><pre>WRITE lv_input.    &quot;Output: 123</pre><h3>NEW SYNTAX — Using ALPHA Keyword</h3><pre>DATA(lv_input) = &#39;123&#39;.</pre><pre>DATA(lv_alpha_in)  = |{ lv_input ALPHA = IN }|.<br>DATA(lv_alpha_out) = |{ lv_alpha_in ALPHA = OUT }|.</pre><pre>WRITE: / lv_alpha_in, lv_alpha_out.</pre><p><strong>Why NEW is better?</strong></p><ul><li>No function modules</li><li>Cleaner and readable</li><li>Expression-based</li></ul><h3>10. NEW Keyword (Replacement for CREATE OBJECT)</h3><h3>OLD SYNTAX — CREATE OBJECT</h3><pre>DATA lo_object TYPE REF TO zclass_sum.</pre><pre>CREATE OBJECT lo_object.</pre><pre>lo_object-&gt;sum(<br>  EXPORTING<br>    pinput1 = 10<br>    pinput2 = 20<br>  IMPORTING<br>    poutput = DATA(lv_result)<br>).</pre><h3>NEW SYNTAX — NEW Keyword</h3><pre>DATA(lo_object) = NEW zclass_sum( ).</pre><pre>lo_object-&gt;sum(<br>  EXPORTING<br>    pinput1 = 10<br>    pinput2 = 20<br>  IMPORTING<br>    poutput = DATA(lv_result)<br>).</pre><p><strong>Why NEW?</strong></p><ul><li>Shorter</li><li>Modern ABAP style</li><li>Recommended in 7.4+</li></ul><h3>11. NEW Keyword with Constructor Parameters</h3><h3>OLD SYNTAX</h3><pre>DATA lo_object TYPE REF TO zclass_sum.</pre><pre>CREATE OBJECT lo_object<br>  EXPORTING<br>    pvalue = &#39;X&#39;.</pre><h3>NEW SYNTAX</h3><pre>DATA(lo_object) = NEW zclass_sum( pvalue = &#39;X&#39; ).</pre><p><strong>Key Point:</strong><br>Constructor parameters are passed <strong>directly inside NEW</strong>.</p><h3>12. LET Expression</h3><h3>OLD SYNTAX — Extra Variable Declaration</h3><pre>DATA x TYPE i VALUE 10.</pre><pre>lwa_data = VALUE lty_data(<br>  col1 = sy-index<br>  col2 = sy-index + x<br>).</pre><h3>NEW SYNTAX — LET Expression</h3><pre>lwa_data = VALUE lty_data(<br>  LET x = 10 IN<br>  col1 = sy-index<br>  col2 = sy-index + x<br>).</pre><p><strong>Why LET?</strong></p><ul><li>Variable scope is local</li><li>No extra declarations</li><li>Cleaner logic</li></ul><h3>13. CONV Operator (Type Conversion)</h3><h3>OLD SYNTAX — Helper Variable</h3><pre>DATA lv_file TYPE string.<br>lv_file = pfile.</pre><pre>CALL FUNCTION &#39;GUI_UPLOAD&#39;<br>  EXPORTING<br>    filename = lv_file.</pre><h3>NEW SYNTAX — CONV Operator</h3><pre>CALL FUNCTION &#39;GUI_UPLOAD&#39;<br>  EXPORTING<br>    filename = CONV string( pfile ).</pre><p><strong>Why CONV?</strong></p><ul><li>No helper variables</li><li>Inline type conversion</li></ul><h3>14. REDUCE Operator (Replacement for LOOP)</h3><h3>OLD SYNTAX — LOOP</h3><pre>DATA lv_sum TYPE i VALUE 0.</pre><pre>DO 5 TIMES.<br>  lv_sum = lv_sum + sy-index.<br>ENDDO.</pre><pre>WRITE lv_sum.</pre><h3>NEW SYNTAX — REDUCE</h3><pre>DATA(lv_sum) = REDUCE i(<br>  INIT result = 0<br>  FOR i = 1 UNTIL i &gt; 5<br>  NEXT result = result + i<br>).</pre><pre>WRITE lv_sum.</pre><p><strong>Why REDUCE?</strong></p><ul><li>No loop</li><li>Functional style</li><li>Compact code</li></ul><h3>15. FILTER Operator</h3><h3>OLD SYNTAX — LOOP + APPEND</h3><pre>LOOP AT lt_data INTO lwa_data.<br>  IF lwa_data-vbtyp = &#39;C&#39;.<br>    APPEND lwa_data TO lt_temp.<br>  ENDIF.<br>ENDLOOP.</pre><h3>NEW SYNTAX — FILTER</h3><pre>lt_temp = FILTER #(<br>  lt_data<br>  WHERE vbtyp = &#39;C&#39;<br>).</pre><p><strong>Important Notes:</strong></p><ul><li>Source table must be SORTED or HASHED</li><li>OR is not allowed</li><li>EXCEPT is supported</li></ul><h3>16. New Open SQL Features (ABAP 7.4+)</h3><h3>a) Host Variables &amp; Comma-Separated Fields</h3><h4>OLD SYNTAX</h4><pre>SELECT vbeln erdat ernam<br>  FROM vbak<br>  INTO TABLE lt_data<br>  WHERE vbeln IN s_vbeln.</pre><h4>NEW SYNTAX</h4><pre>SELECT vbeln, erdat, ernam<br>  FROM vbak<br>  INTO TABLE @DATA(lt_data)<br>  WHERE vbeln IN @s_vbeln.</pre><h3>b) CASE in Open SQL</h3><h4>OLD SYNTAX</h4><pre>IF vbtyp = &#39;C&#39;.<br>  desc = &#39;Internal&#39;.<br>ELSE.<br>  desc = &#39;External&#39;.<br>ENDIF.</pre><h4>NEW SYNTAX</h4><pre>SELECT vbeln,<br>       CASE<br>         WHEN vbtyp = &#39;C&#39; THEN &#39;Internal&#39;<br>         ELSE &#39;External&#39;<br>       END AS description<br>  FROM vbak<br>  INTO TABLE @DATA(lt_data).</pre><h3>c) Aggregate Functions (SUM)</h3><h4>OLD SYNTAX — Application Layer</h4><pre>LOOP AT lt_data INTO lwa.<br>  COLLECT lwa INTO lt_final.<br>ENDLOOP.</pre><h4>NEW SYNTAX — Database Layer</h4><pre>SELECT erdat, SUM( netwr ) AS amount<br>  FROM vbak<br>  INTO TABLE @DATA(lt_data)<br>  GROUP BY erdat.</pre><h3>d) Element List After FROM</h3><pre>SELECT FROM vbak<br>  FIELDS vbeln, erdat<br>  WHERE vbeln IN @s_vbeln<br>  INTO TABLE @DATA(lt_data).</pre><h3>Final Thoughts</h3><p>ABAP 7.4 transforms ABAP into a <strong>modern, expression-based language</strong>.</p><p>By using:</p><ul><li>NEW</li><li>VALUE</li><li>COND</li><li>REDUCE</li><li>FILTER</li><li>Modern Open SQL</li></ul><p>You write <strong>cleaner, faster, and maintainable ABAP code</strong>.</p><p>I’ll continue sharing my <strong>SAP ABAP learning journey</strong> with beginner-friendly explanations.</p><p>Thanks for reading 😊<br>Happy coding with Modern ABAP 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db1e50d0beb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>