<?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 Priyatharsini Sivalingam  on Medium]]></title>
        <description><![CDATA[Stories by Priyatharsini Sivalingam  on Medium]]></description>
        <link>https://medium.com/@Priyatharsini06?source=rss-53d2560e633f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QSu4LmufPwicpeaXCLvmeQ.jpeg</url>
            <title>Stories by Priyatharsini Sivalingam  on Medium</title>
            <link>https://medium.com/@Priyatharsini06?source=rss-53d2560e633f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:21:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Priyatharsini06/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[SAP CPI Explained: What It Is, Why It Matters, and What It Can Do for You]]></title>
            <link>https://medium.com/@Priyatharsini06/sap-cpi-explained-what-it-is-why-it-matters-and-what-it-can-do-for-you-8fbb25645094?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fbb25645094</guid>
            <category><![CDATA[groovy-script]]></category>
            <category><![CDATA[sap-cpi]]></category>
            <category><![CDATA[third-party-integrations]]></category>
            <category><![CDATA[cloud-integration]]></category>
            <category><![CDATA[sap-btp]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 10:21:01 GMT</pubDate>
            <atom:updated>2026-06-22T10:21:01.098Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 1 of my SAP Integration Suite series</em></p><p>If you’ve worked anywhere near an SAP landscape, you’ve probably heard the term <strong>SAP CPI</strong> thrown around in meetings — usually right before someone says “we need to integrate S/4HANA with [insert third-party system here].” But what actually <em>is</em> CPI, and why has it become such a central piece of modern SAP architecture?</p><p>In this first article of my integration series, I’ll break down SAP CPI in plain terms — no jargon overload, just a clear picture of what it does and why it’s worth learning.</p><h3>What is SAP CPI?</h3><p><strong>SAP Cloud Integration (CPI)</strong>, formally part of the <strong>SAP Integration Suite</strong>, is SAP’s cloud-based integration platform (iPaaS — Integration Platform as a Service). It allows you to connect different systems — SAP and non-SAP, cloud and on-premise — so they can exchange data reliably and securely.</p><p>Think of it as the “traffic controller” sitting between your systems: when Salesforce needs to talk to S/4HANA, or your e-commerce platform needs to push orders into SAP, CPI is the layer that receives, transforms, routes, and delivers that data correctly.</p><p>It replaced SAP PI/PO (Process Integration/Orchestration) as SAP’s strategic integration tool, moving the same core ideas — message processing, mapping, adapters — into a cloud-native, browser-based design environment.</p><h3>Why SAP CPI?</h3><p>Here’s the real-world problem CPI solves: <strong>businesses rarely run on a single system.</strong></p><p>A typical enterprise landscape might include:</p><ul><li>SAP S/4HANA for core operations</li><li>SAP SuccessFactors for HR</li><li>Salesforce or a custom CRM for sales</li><li>Third-party logistics or banking platforms</li><li>Legacy on-premise applications that can’t just be switched off</li></ul><p>Each of these systems speaks a different “language” — different data formats, protocols, and security standards. Without integration, you end up with manual data entry, spreadsheets, and a high risk of errors. CPI exists to eliminate that friction by giving you a single, governed platform to handle integration logic instead of building ad-hoc point-to-point connections everywhere.</p><p>It also fits naturally into SAP’s cloud-first direction — as more SAP products move to the cloud (S/4HANA Cloud, SuccessFactors, Ariba, etc.), having a cloud-native integration layer becomes essential rather than optional.</p><h3>What Can SAP CPI Do?</h3><p>At a high level, CPI lets you build <strong>integration flows (iFlows)</strong> — visual, drag-and-drop pipelines that define how a message moves from a sender to a receiver, and what happens to it along the way.</p><p>Key capabilities include:</p><ul><li><strong>Adapters for multiple protocols and systems</strong> — SOAP, REST/OData, SFTP, IDoc, JDBC, Mail, Successfactors, Ariba, and many more, so you can connect almost anything.</li><li><strong>Message transformation/mapping</strong> — convert data between formats (XML, JSON, flat files) using graphical mapping, XSLT, or scripting (Groovy/JavaScript).</li><li><strong>Routing and orchestration</strong> — split, merge, filter, and route messages based on content or conditions.</li><li><strong>Security handling</strong> — OAuth, certificates, encryption, and credential management for safe data exchange.</li><li><strong>Pre-built content packages</strong> — SAP and partners publish ready-made integration packages for common scenarios (e.g., SuccessFactors to S/4HANA), so you don’t always start from scratch.</li><li><strong>Monitoring and error handling</strong> — a built-in dashboard to track message status, debug failures, and reprocess errors without digging through logs manually.</li></ul><h3>Benefits of Using SAP CPI</h3><ul><li><strong>Faster integration delivery</strong> — pre-built adapters and templates cut development time significantly compared to custom point-to-point coding.</li><li><strong>Scalability</strong> — being cloud-native, it scales with your landscape without needing dedicated on-premise infrastructure.</li><li><strong>Centralized governance</strong> — one place to monitor, secure, and manage all your integration flows instead of scattered scripts across systems.</li><li><strong>Reduced maintenance overhead</strong> — SAP manages the platform updates and infrastructure, so your team focuses on building flows, not patching servers.</li><li><strong>Future-proofing</strong> — as SAP pushes customers toward S/4HANA Cloud and RISE with SAP, CPI is the recommended (and often required) integration backbone.</li></ul><h3>Common Use Cases</h3><ul><li>Integrating <strong>S/4HANA with SuccessFactors</strong> for employee master data sync</li><li>Connecting <strong>e-commerce platforms</strong> to SAP for real-time order and inventory updates</li><li><strong>B2B integrations</strong> with partners using IDoc, EDI, or file-based exchanges</li><li><strong>Bank-to-SAP</strong> integrations for payment processing and reconciliation</li><li>Hybrid scenarios where <strong>on-premise ECC/S4 systems</strong> need to talk to <strong>cloud-based applications</strong></li></ul><h3>Wrapping Up</h3><p>SAP CPI isn’t just another tool in the SAP toolbox — it’s increasingly the backbone connecting modern SAP landscapes to the rest of the digital world. Whether you’re integrating HR systems, syncing orders, or exchanging files with a bank, CPI gives you a structured, secure, and scalable way to do it.</p><p>In the next article in this series, I’ll go hands-on and walk through <strong>building your first iFlow in SAP CPI</strong> — covering the actual steps, adapter configuration, and a simple mapping scenario.</p><p><em>If you found this useful, follow along for the rest of the series, and feel free to drop questions or topics you’d like covered next.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fbb25645094" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Section 4 — Filtering Data: AND, OR, NOT, IN, BETWEEN, LIKE]]></title>
            <link>https://medium.com/@Priyatharsini06/section-4-filtering-data-and-or-not-in-between-like-85f4f73268ff?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/85f4f73268ff</guid>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 16:54:27 GMT</pubDate>
            <atom:updated>2026-06-01T16:54:27.047Z</atom:updated>
            <content:encoded><![CDATA[<h3>Real Queries Need Multiple Conditions</h3><p>In real business situations, you almost never filter by just one thing. Your manager doesn’t ask <em>“show me customers from Sri Lanka”</em> — they ask <em>“show me customers from Sri Lanka who spent more than 10,000 AND joined after January 2023.”</em></p><p>This section teaches you how to combine and layer filters.</p><p>We’ll use this expanded customers table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ghdvcqb3W0AcmZtLL-2bQ.png" /></figure><h3>AND — Both Conditions Must Be True</h3><p>Use AND when you want rows that satisfy <strong>all</strong> your conditions.</p><p><strong>Business question:</strong> <em>“Find active customers from Sri Lanka.”</em></p><pre>SELECT name, country, status<br>FROM customers<br>WHERE country = &#39;Sri Lanka&#39;<br>  AND status = &#39;active&#39;;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StX1uuIyh2OLsMjJJObOVQ.png" /></figure><p>Both conditions must be true for a row to appear.</p><h3>OR — At Least One Condition Must Be True</h3><p>Use OR when you want rows that satisfy <strong>any</strong> of your conditions.</p><p><strong>Business question:</strong> <em>“Find customers from Sri Lanka OR Singapore.”</em></p><p>sql</p><pre>SELECT name, country, total_spent<br>FROM customers<br>WHERE country = &#39;Sri Lanka&#39;<br>   OR country = &#39;Singapore&#39;;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UzgM50fSgoLlcPsUZkyBaQ.png" /></figure><h3>NOT — Exclude a Condition</h3><p>NOT reverses a condition. It says: <em>&quot;Give me everything except this.&quot;</em></p><p><strong>Business question:</strong> <em>“Find all customers who are NOT from the USA.”</em></p><p>sql</p><pre>SELECT name, country<br>FROM customers<br>WHERE NOT country = &#39;USA&#39;;</pre><h3>IN — Match a List of Values</h3><p>Instead of writing multiple OR conditions, use IN for a clean list.</p><p><strong>Without IN (messy):</strong></p><p>sql</p><pre>WHERE country = &#39;Sri Lanka&#39;<br>   OR country = &#39;India&#39;<br>   OR country = &#39;Singapore&#39;</pre><p><strong>With IN (clean):</strong></p><pre>SELECT name, country, total_spent<br>FROM customers<br>WHERE country IN (&#39;Sri Lanka&#39;, &#39;India&#39;, &#39;Singapore&#39;);</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wiBeYdgRbe-U0izCHVnADw.png" /></figure><h3>BETWEEN — Filter a Range</h3><p>BETWEEN filters values within a range (inclusive on both ends).</p><p><strong>Business question:</strong> <em>“Find customers who spent between 5,000 and 20,000.”</em></p><p>sql</p><pre>SELECT name, total_spent<br>FROM customers<br>WHERE total_spent BETWEEN 5000 AND 20000;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obqR5v-fXwW4bZydbZeb1w.png" /></figure><p>BETWEEN works with numbers AND dates:</p><pre>-- Find customers who joined in 2023<br>WHERE joined_date BETWEEN &#39;2023-01-01&#39; AND &#39;2023-12-31&#39;</pre><h3>LIKE — Search with Patterns</h3><p>LIKE lets you search for partial text matches using wildcards:</p><ul><li>% — means <em>&quot;anything can go here&quot;</em> (any number of characters)</li><li>_ — means <em>&quot;exactly one character&quot;</em></li></ul><p><strong>Business question:</strong> <em>“Find customers whose email ends with @email.com.”</em></p><pre>SELECT name, email<br>FROM customers<br>WHERE email LIKE &#39;%@email.com&#39;;</pre><p><strong>Business question:</strong> <em>“Find customers whose name starts with ‘S’.”</em></p><pre>SELECT name<br>FROM customers<br>WHERE name LIKE &#39;S%&#39;;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*o2YENM0RHnuqWtaKJjGQdA.png" /></figure><p><strong>Business question:</strong> <em>“Find customers whose name contains ‘an’.”</em></p><pre>SELECT name<br>FROM customers<br>WHERE name LIKE &#39;%an%&#39;;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6nmAk6MPPLxjWT8lKrQ12w.png" /></figure><h3>Combining Everything</h3><p><strong>Real scenario:</strong> <em>“Find active customers from South/South-East Asia who spent more than 8,000.”</em></p><pre>SELECT name, country, total_spent, status<br>FROM customers<br>WHERE country IN (&#39;Sri Lanka&#39;, &#39;India&#39;, &#39;Singapore&#39;)<br>  AND status = &#39;active&#39;<br>  AND total_spent &gt; 8000;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TCf4Hql1LvomLobQEqP5aw.png" /></figure><h3>⚠️ Common Mistakes</h3><p><strong>Mixing AND/OR without parentheses</strong></p><pre>-- ❌ Ambiguous - which condition applies first?<br>WHERE country = &#39;USA&#39; OR country = &#39;India&#39; AND total_spent &gt; 10000<br><br>-- ✅ Clear with parentheses<br>WHERE (country = &#39;USA&#39; OR country = &#39;India&#39;) AND total_spent &gt; 10000</pre><p>SQL follows operator precedence (AND before OR), which can give unexpected results. <strong>Always use parentheses when mixing AND and OR.</strong></p><h3>🔑 Key Takeaways</h3><ul><li>AND → all conditions must be true.</li><li>OR → at least one condition must be true.</li><li>NOT → excludes matching rows.</li><li>IN → cleaner alternative to multiple OR conditions.</li><li>BETWEEN → filters a range (inclusive). Works on numbers and dates.</li><li>LIKE → pattern matching. % is a wildcard for any characters.</li><li>Always use parentheses when mixing AND and OR.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85f4f73268ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Section 3 — Your First SQL Query: SELECT, FROM, WHERE]]></title>
            <link>https://medium.com/@Priyatharsini06/section-3-your-first-sql-query-select-from-where-38f65ab23297?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/38f65ab23297</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[select]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 08:24:16 GMT</pubDate>
            <atom:updated>2026-04-10T08:24:16.644Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*kqz1NnT66pd3Aj31OIhwaQ.png" /></figure><h3>Time to Write Real SQL</h3><p>You now know what a database looks like. Let’s write actual queries.</p><p>We will use our online store database for every example. Here are the two tables we’ll work with in this section:</p><p><strong>customers table:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EaVX6Z6c_NvZv_BsQ5_zSw.png" /></figure><h3>The SELECT Statement — Ask for Data</h3><p>SELECT is the most fundamental SQL command. It tells the database: <em>&quot;Give me this data.&quot;</em></p><h3>Selecting Specific Columns</h3><pre>SELECT name, email<br>FROM customers;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4AhXpiixEGHF_zDj7nmENQ.png" /></figure><p>You told the database: <em>“From the customers table, give me only the name and email columns.”</em> Every row is returned, but only 2 columns.</p><h3>Selecting All Columns</h3><p>Want everything? Use the * wildcard:</p><p>sql</p><pre>SELECT *<br>FROM customers;</pre><p>This returns every column for every row. Use this carefully on large tables — retrieving unnecessary data wastes resources.</p><h3>The WHERE Clause — Filter Your Results</h3><p>WHERE lets you add a condition. Instead of getting every row, you get only rows that match your criteria.</p><h3>Example 1: Find all customers from Sri Lanka</h3><p>sql</p><pre>SELECT name, email, country<br>FROM customers<br>WHERE country = &#39;Sri Lanka&#39;;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mVoM-CCWn6oMmNlz8rs-hw.png" /></figure><h3>Example 2: Find customers who spent more than 10,000</h3><pre>SELECT name, country, total_spent<br>FROM customers<br>WHERE total_spent &gt; 10000;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f43_bBi36ttjeJcptopbaA.png" /></figure><h3>Comparison Operators in WHERE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFJG4mt_XNX0l2tg2j98VQ.png" /></figure><h3>Putting It All Together</h3><p>Let’s say your manager asks: <em>“Give me the names and spending of all customers from Sri Lanka.”</em></p><pre>SELECT name, total_spent<br>FROM customers<br>WHERE country = &#39;Sri Lanka&#39;;</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*8-WskmbZ9_NxNzAW65Ko_Q.png" /></figure><p>Three keywords. One clean answer. That is the power of SQL.</p><h3>⚠️ Common Mistakes</h3><p><strong>1. Forgetting quotes around text values</strong></p><p>sql</p><pre>-- ❌ Wrong<br>WHERE country = Sri Lanka<br>-- ✅ Correct<br>WHERE country = &#39;Sri Lanka&#39;</pre><p>Numbers don’t need quotes. Text always does.</p><p><strong>2. Using = for text comparison with the wrong case</strong></p><pre>-- This might return nothing if stored as &#39;Sri Lanka&#39;<br>WHERE country = &#39;sri lanka&#39;</pre><p>SQL text comparisons are often case-sensitive depending on your database. Always match the exact case of stored data.</p><p><strong>3. Selecting </strong><strong>* when you only need a few columns</strong> On tables with millions of rows and 50 columns, SELECT * is expensive. Always select only what you need.</p><h3>🔑 Key Takeaways</h3><ul><li>SELECT specifies which columns you want.</li><li>FROM specifies which table to pull from.</li><li>WHERE filters rows based on a condition.</li><li>Text values need single quotes. Numbers do not.</li><li>Use specific column names instead of * whenever possible.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38f65ab23297" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Cloud Fundamentals: Module 1 — Introducing Google Cloud]]></title>
            <link>https://medium.com/@Priyatharsini06/google-cloud-fundamentals-module-1-introducing-google-cloud-25535e1c67eb?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/25535e1c67eb</guid>
            <category><![CDATA[google-cloud]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[associate-cloud-engineer]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 08:20:46 GMT</pubDate>
            <atom:updated>2026-04-10T08:20:46.706Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part of my Get Certified 2026 series | Associate Cloud Engineer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*ewEQwb3T8SeAsNPW" /></figure><h3>1. What Is Cloud Computing?</h3><p>The term “cloud computing” was defined by the <strong>US National Institute of Standards and Technology (NIST)</strong>. According to them, cloud computing has five core traits:</p><p><strong>01. On-demand and self-service</strong> You get compute resources — processing power, storage, network — through a web interface, without needing to call anyone or wait for human approval.</p><p><strong>02. Accessible over the internet, from anywhere</strong> As long as you have a connection, you can access your cloud resources from anywhere in the world.</p><p><strong>03. Resource pooling</strong> The cloud provider maintains a large shared pool of resources and allocates them to users. This lets providers buy in bulk and pass savings on to customers. You don’t need to know or care where the physical hardware is.</p><p><strong>04. Elastic (flexible) resources</strong> Need more compute? Scale up. Traffic dropped? Scale back. Resources adjust quickly to what you actually need.</p><p><strong>05. Pay only for what you use</strong> No usage = no charges. You pay for what you consume, or reserve as you go.</p><h3>2. A Quick History of Cloud Computing</h3><p>Understanding <em>why</em> cloud matters requires a quick look at how we got here.</p><p><strong>First Wave — Colocation</strong> Instead of building and owning data centers, companies started <em>renting physical space</em> in shared facilities. More financially efficient, but still hands-on.</p><p><strong>Second Wave — Virtualized Data Centers</strong> Physical hardware became virtual — servers, CPUs, disks, load balancers all existed as software. Enterprises could configure and control virtual infrastructure. But they still <em>maintained</em> it. It was still a user-controlled, user-configured environment.</p><p><strong>Third Wave — Container-based Architecture (Google’s approach)</strong> Google realized the virtualization model was too slow for its own needs. So it switched to a <strong>fully automated, elastic, container-based architecture</strong> — where services automatically provision and configure the infrastructure your application needs.</p><p>This third-wave cloud is what Google Cloud makes available to customers today.</p><blockquote><em>Google’s belief: every company will eventually become a data company. Great software needs great data.</em></blockquote><h3>3. IaaS vs PaaS vs SaaS</h3><p>When virtualized data centers came along, two major service models emerged:</p><h3>Infrastructure as a Service (IaaS)</h3><p>Delivers <strong>raw compute, storage, and network</strong> virtually — similar to a physical data center, but in the cloud.</p><ul><li>You manage what runs on it.</li><li>You <strong>pay for what you allocate</strong> (reserved ahead of time).</li><li>Google Cloud example: <strong>Compute Engine</strong></li></ul><h3>Platform as a Service (PaaS)</h3><p>Binds your <strong>application code to libraries</strong> that handle the underlying infrastructure. You focus on logic, not servers.</p><ul><li>You manage the application.</li><li>You <strong>pay for what you actually use</strong>.</li><li>Google Cloud example: <strong>App Engine</strong></li></ul><h3>Software as a Service (SaaS)</h3><p>The entire application is delivered over the internet. You just use it — no installation, no infrastructure.</p><ul><li>Google examples: <strong>Gmail, Google Docs, Google Drive</strong> (collectively: Google Workspace)</li></ul><h3>The Evolution Continues — Serverless</h3><p>Serverless goes one step further by removing even the need to think about infrastructure configuration.</p><ul><li><strong>Cloud Run</strong> — deploy containerized microservices in a fully managed environment</li><li><strong>Cloud Run Functions</strong> — event-driven code, pay-as-you-go</li></ul><h3>4. The Google Cloud Network</h3><p>Google’s network is the <strong>largest of its kind</strong>, backed by billions of dollars in investment.</p><h3>Designed for High Throughput</h3><p>Google uses <strong>100+ content caching nodes</strong> worldwide to serve requests from the location closest to the user, minimizing latency.</p><h3>Infrastructure Locations</h3><p>Google Cloud infrastructure spans <strong>7 major geographic locations</strong>: North America, South America, Europe, Africa, the Middle East, Asia, and Australia.</p><h3>Locations → Regions → Zones</h3><p>Level What it means <strong>Location</strong> A major geographic area (e.g., Asia) <strong>Region</strong> An independent geographic area within a location (e.g., europe-west2 = London) <strong>Zone</strong> Where your actual cloud resources are deployed (e.g., europe-west2-b)</p><p>Each region contains multiple zones. When you deploy a VM using Compute Engine, you specify which zone it runs in — this ensures <strong>resource redundancy</strong>.</p><p>You can also run resources across <strong>multiple regions</strong> — useful for serving global users with lower latency, and for protection against region-wide failures (like a natural disaster).</p><p>Some services also support <strong>multi-region</strong> configurations — like Cloud Spanner, which replicates data across zones in multiple regions simultaneously.</p><blockquote><em>As of this module, Google Cloud supports 127 zones across 42 regions.</em></blockquote><h3>5. Environmental Impact</h3><p>All those servers use a lot of power. Together, all existing data centers consume roughly <strong>2% of the world’s electricity</strong>.</p><p>Google works to minimize this:</p><ul><li>Google’s data centers were the <strong>first to achieve ISO 14001 certification</strong> — a framework for improving resource efficiency and reducing waste.</li><li>The data center in <strong>Hamina, Finland</strong> uses seawater from the Bay of Finland for cooling — the first of its kind in the world.</li><li><strong>Sustainability milestones:</strong></li><li><em>Founding decade:</em> First major company to become carbon neutral</li><li><em>Second decade:</em> First to achieve 100% renewable energy</li><li><em>By 2030:</em> Aims to be the first to operate fully carbon free</li></ul><h3>6. Security</h3><p>Google has <strong>nine services with over a billion users each</strong> (Android, Chrome, Gmail, Drive, Maps, Photos, Search, Play Store, YouTube). Security is not an afterthought — it’s built into every layer.</p><p>Here’s how Google Cloud security is structured:</p><p><strong>Hardware Infrastructure Level</strong></p><ul><li>Custom-designed server boards, chips, and networking equipment</li><li>Secure boot stack using cryptographic signatures (BIOS, bootloader, kernel, OS image)</li><li>Multi-layer physical security at data centers</li></ul><p><strong>Service Deployment Level</strong></p><ul><li>All inter-service communication uses <strong>RPC (Remote Procedure Calls)</strong></li><li>RPC traffic between data centers is automatically encrypted</li></ul><p><strong>User Identity Level</strong></p><ul><li>Google’s central identity service goes beyond username + password</li><li>Risk-based challenges (e.g., new device, unusual location)</li><li>Support for <strong>U2F (Universal 2nd Factor)</strong> security keys</li></ul><p><strong>Storage Services Level</strong></p><ul><li>Encryption at rest using centrally managed keys</li><li>Hardware encryption support in hard drives and SSDs</li></ul><p><strong>Internet Communication Level</strong></p><ul><li><strong>Google Front End (GFE):</strong> Ensures all public-facing services use TLS with valid certificates and best practices</li><li><strong>DoS Protection:</strong> Google’s infrastructure scale absorbs many attacks; multi-tier protection handles the rest</li></ul><p><strong>Operational Security Level</strong></p><ul><li>Intrusion detection using rules and machine intelligence</li><li>Red Team exercises to test defenses</li><li>Limited and monitored admin access (insider risk reduction)</li><li>All employees must use U2F Security Keys</li><li>All new code requires two-party review</li></ul><h3>7. Open APIs and Open Source</h3><p>Worried about vendor lock-in? Google addresses this directly.</p><ul><li>Google publishes key technologies under <strong>open source licenses</strong></li><li><strong>TensorFlow</strong> (machine learning library) was built at Google and released as open source</li><li><strong>Kubernetes</strong> and <strong>Google Kubernetes Engine (GKE)</strong> let you mix and match microservices across different cloud providers</li><li><strong>Google Cloud Observability</strong> lets you monitor workloads across multiple cloud providers</li></ul><p>Google’s position: if you ever decide to leave, you can.</p><h3>8. Pricing and Billing</h3><h3>Per-Second Billing</h3><p>Google was the <strong>first major cloud provider</strong> to offer per-second billing for IaaS compute. This applies to:</p><ul><li>Compute Engine</li><li>Google Kubernetes Engine (GKE)</li><li>Dataproc</li><li>App Engine flexible environment VMs</li></ul><h3>Compute Engine Billing Flexibility</h3><ul><li><strong>Sustained-use discounts:</strong> Automatically applied when you run a VM for more than 25% of a billing month</li><li><strong>Custom VM types:</strong> Fine-tune vCPU and memory to match your actual workload (and pay only for what you configure)</li></ul><h3>Billing Control Tools</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CLvYIfM8IFYoORmJm3Unag.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25535e1c67eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Section 2 — How Databases Work: Tables, Rows & Columns]]></title>
            <link>https://medium.com/@Priyatharsini06/section-2-how-databases-work-tables-rows-columns-6f497a935b1d?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f497a935b1d</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[microsoft-sql-server]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[dbms-and-rdbms]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 09:59:27 GMT</pubDate>
            <atom:updated>2026-04-10T08:24:59.352Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*kqz1NnT66pd3Aj31OIhwaQ.png" /></figure><h3>Think of a Database as a Collection of Spreadsheets</h3><p>Before writing a single line of SQL, you need to understand what you are actually talking to.</p><p>Imagine you run an online store. You have information about:</p><ul><li>Your <strong>customers</strong> (name, email, country)</li><li>Your <strong>products</strong> (name, price, category)</li><li>Your <strong>orders</strong> (who bought what, when, and how much)</li></ul><p>You could store all of this in an Excel file — but as your business grows to thousands of customers and millions of orders, Excel falls apart. It becomes slow, messy, and unreliable.</p><p>That is where a <strong>database</strong> comes in.</p><h3>What is a Database?</h3><p>A <strong>database</strong> is an organized collection of data stored electronically. It is managed by a system called a <strong>DBMS (Database Management System)</strong> — examples include MySQL, PostgreSQL, and Microsoft SQL Server.</p><p>Inside a database, data lives in <strong>tables.</strong></p><h3>What is a Table?</h3><p>A <strong>table</strong> is exactly what it sounds like — it looks like a spreadsheet, with rows and columns.</p><p>Let’s look at a real example. Here is a customers table from an online store:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oyg2ZTdDkCe1DXjD1UoHnA.png" /></figure><p>This table has:</p><ul><li><strong>5 rows</strong> — each row represents one customer (also called a <em>record</em>)</li><li><strong>5 columns</strong> — each column represents one piece of information (also called a <em>field</em>)</li></ul><h3>The Three Key Concepts</h3><h3>1. Columns (Fields)</h3><p>Columns define <strong>what type of information</strong> is stored. Each column has a name and a data type.</p><p>In our customers table:</p><ul><li>customer_id → a unique number for each customer</li><li>name → text</li><li>email → text</li><li>country → text</li><li>joined_date → a date</li></ul><h3>2. Rows (Records)</h3><p>Each row is <strong>one complete entry</strong> in the table. One row = one customer, one order, one product.</p><h3>3. Primary Key</h3><p>Notice the customer_id column? Every customer gets a unique ID: 1, 2, 3, 4, 5...</p><p>This is called a <strong>Primary Key</strong> — it uniquely identifies each row. No two customers can have the same customer_id. This is how the database keeps things organized and avoids confusion.</p><h3>A Real Database Has Many Tables That Connect</h3><p>In our online store, we would have multiple tables:</p><p><strong>products table:</strong></p><p>product_idnamecategoryprice101Wireless HeadphonesElectronics4999.00102Running ShoesSports8500.00103Coffee MakerKitchen12000.00104Yoga MatSports2200.00</p><p><strong>orders table:</strong></p><p>order_idcustomer_idproduct_idquantityorder_date1001110112024–01–101002310322024–01–121003110412024–01–151004210212024–01–20</p><p>See how the orders table uses customer_id and product_id to <em>link</em> to the other tables? This is the magic of relational databases — tables <strong>talk to each other</strong> using shared IDs. You don&#39;t need to duplicate all the customer information in every order. You just reference the ID.</p><h3>⚠️ Common Beginner Misconceptions</h3><p><strong>“One big table is easier, right?”</strong> Wrong. Storing everything in one giant table creates duplicate data, inconsistencies, and makes updates a nightmare. Imagine changing a customer’s email — you’d have to update it in 50 different rows.</p><p><strong>“A database is just Excel.”</strong> Excel works for hundreds of rows. Databases handle <strong>billions</strong> of rows with speed, multiple users at once, security controls, and automatic backups.</p><h3>🔑 Key Takeaways</h3><ul><li>A database is a structured collection of tables.</li><li>A table has columns (what type of data) and rows (individual records).</li><li>Each table has a Primary Key — a unique identifier for every row.</li><li>Multiple tables connect to each other using shared IDs (relationships).</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f497a935b1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Section 1 — What is SQL & Why Should You Learn It?]]></title>
            <link>https://medium.com/@Priyatharsini06/section-1-what-is-sql-why-should-you-learn-it-5bed7c294ebb?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bed7c294ebb</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[microsoft-sql-server]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 15:29:39 GMT</pubDate>
            <atom:updated>2026-03-31T15:29:39.385Z</atom:updated>
            <content:encoded><![CDATA[<h3>The World Runs on Data</h3><p>Every time you order something on Amazon, Instagram shows you a reel, or your bank sends you a transaction alert — <strong>a database is working behind the scenes.</strong></p><p>But here is the real question: how do people <em>talk</em> to that database? How do they ask it questions like:</p><ul><li><em>“Show me all customers who spent more than $500 this month.”</em></li><li><em>“Which product was returned the most last quarter?”</em></li><li><em>“How many new users signed up from Sri Lanka in the last 7 days?”</em></li></ul><p>The answer is <strong>SQL</strong> — pronounced <em>“sequel”</em> or <em>“S-Q-L.”</em></p><h3>So What Exactly is SQL?</h3><p><strong>SQL stands for Structured Query Language.</strong></p><p>Think of it as a language you use to <em>talk to a database.</em> Just like you use English to ask a friend a question, you use SQL to ask a database a question.</p><p>The beautiful thing about SQL is how close it is to plain English. Look at this:</p><pre>SELECT name, email<br>FROM customers<br>WHERE country = &#39;Sri Lanka&#39;;</pre><p>Even without knowing any SQL, you can almost read this like a sentence:</p><blockquote>“Select the name and email from the customers table, where the country is Sri Lanka.”</blockquote><p>That’s the power of SQL — it was <strong>designed to be readable by humans.</strong></p><h3>Where is SQL Used in Real Life?</h3><p>You might be wondering: <em>“Is this just for programmers?”</em></p><p>Not at all. SQL is used by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QPpEsRb7IEGSOalC5BBEA.png" /></figure><p>Almost every company in the world stores data in a database — and SQL is the universal language to access it.</p><h3>Why Learn SQL in 2025?</h3><p>Here are three honest reasons:</p><p><strong>1. It is everywhere.</strong> Whether you use MySQL, PostgreSQL, Microsoft SQL Server, or SQLite — they all speak SQL. Learn it once, use it everywhere.</p><p><strong>2. It is beginner-friendly.</strong> Unlike Python or Java, SQL does not require you to understand loops, objects, or complex logic to get started. You ask a question, you get an answer.</p><p><strong>3. It pays well.</strong> Data Analyst, Business Analyst, Data Engineer, Backend Developer — SQL is listed as a required skill in thousands of job postings. It is one of the highest ROI skills you can learn.</p><h3>🔑 Key Takeaways</h3><ul><li>SQL is the language used to communicate with databases.</li><li>It reads almost like plain English, making it beginner-friendly.</li><li>It is used across industries — e-commerce, banking, HR, marketing, and more.</li><li>Learning SQL opens doors to many high-paying career paths.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bed7c294ebb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 6 — Docker: Packaging Everything Into Containers]]></title>
            <link>https://medium.com/@Priyatharsini06/part-6-docker-packaging-everything-into-containers-932d03d32d97?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/932d03d32d97</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 15:27:26 GMT</pubDate>
            <atom:updated>2026-03-31T15:27:26.434Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The app works perfectly on my machine. But how do I make it work on any machine, any server, anywhere in the world?</em></p><h3>The Problem Every Developer Knows</h3><p>You build your application. It works perfectly on your laptop.</p><p>You send it to someone else. They try to run it.</p><pre>&quot;It doesn&#39;t work&quot;<br>&quot;What error?&quot;<br>&quot;It says .NET not found&quot;<br>&quot;Install .NET 8&quot;<br>&quot;Ok done. Now what?&quot;<br>&quot;Now install PostgreSQL&quot;<br>&quot;What version?&quot;<br>&quot;15&quot;<br>&quot;Ok. Now it says connection refused&quot;<br>&quot;Did you create the database?&quot;<br>&quot;How?&quot;<br>&quot;Run this SQL...&quot;</pre><p>Two hours later — still not working.</p><p>This is the famous <strong>“works on my machine”</strong> problem. Every developer has lived this nightmare.</p><p>Docker solves it completely.</p><h3>What is Docker?</h3><p>Docker lets you package your application with <strong>everything it needs</strong> into a single unit called a <strong>container</strong>.</p><p>The container includes:</p><ul><li>Your application code</li><li>The runtime (.NET 8, Node.js)</li><li>All dependencies</li><li>Configuration</li><li>Everything</li></ul><pre>Without Docker:<br>&quot;Here is my code. Good luck.&quot;<br>→ Install .NET, PostgreSQL, Node.js, configure nginx...<br>→ 2 hours of setup<br>→ Still might not work<br><br>With Docker:<br>&quot;Here is my container.&quot;<br>→ docker compose up<br>→ Running in 2 minutes<br>→ Works identically everywhere</pre><h3>Container vs Virtual Machine</h3><p>You might think — isn’t this the same as a Virtual Machine?</p><p>No. Very different.</p><pre>Virtual Machine:<br>┌─────────────────────────┐<br>│  Your App               │<br>│  Dependencies           │<br>│  Full Operating System  │  ← 20GB, slow to start<br>│  (Ubuntu, Windows...)   │<br>└─────────────────────────┘<br><br><br>Container:<br>┌─────────────────────────┐<br>│  Your App               │<br>│  Dependencies           │  ← 200MB, starts in seconds<br>│  (shares host OS)       │<br>└─────────────────────────┘</pre><p>Containers share the host operating system kernel. They are lightweight, fast to start, and use far less memory than virtual machines.</p><h3>What is a Dockerfile?</h3><p>A Dockerfile is a recipe — step by step instructions for building a container image.</p><p><strong>My .NET API Dockerfile:</strong></p><pre># RiceMillApi/Dockerfile<br><br># ── Stage 1: Build ──────────────────────────────────────<br>FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build<br>WORKDIR /app<br># Copy project file and restore dependencies first<br># (Docker caches this layer - speeds up future builds)<br>COPY *.csproj .<br>RUN dotnet restore<br># Copy everything else and build<br>COPY . .<br>RUN dotnet publish -c Release -o out<br># ── Stage 2: Runtime ─────────────────────────────────────<br>FROM mcr.microsoft.com/dotnet/aspnet:8.0<br>WORKDIR /app<br># Copy only the built output - not the full SDK<br>COPY --from=build /app/out .<br>EXPOSE 5000<br>ENV ASPNETCORE_URLS=http://+:5000<br>ENTRYPOINT [&quot;dotnet&quot;, &quot;RiceMillApi.dll&quot;]</pre><p>Let me explain every line:</p><pre>FROM sdk:8.0 AS build    → use Microsoft&#39;s .NET 8 SDK image as base<br>WORKDIR /app             → set working directory inside container<br>COPY *.csproj .          → copy project file first<br>RUN dotnet restore       → download all NuGet packages<br>COPY . .                 → copy rest of source code<br>RUN dotnet publish       → compile and publish release build<br><br>FROM aspnet:8.0          → switch to smaller runtime image (no SDK)<br>COPY --from=build        → copy compiled output from build stage<br>EXPOSE 5000              → tell Docker this container uses port 5000<br>ENTRYPOINT               → command to run when container starts</pre><p><strong>Why two stages?</strong></p><p>The SDK image is ~700MB. The runtime image is ~200MB. By building in stage 1 and copying only the output to stage 2 — the final container is small. You never ship the compiler to production.</p><p><strong>My React Frontend Dockerfile:</strong></p><pre># rice-mill-ui/Dockerfile<br># ── Stage 1: Build React ─────────────────────────────────<br>FROM node:18-alpine AS build<br>WORKDIR /app<br>COPY package*.json .<br>RUN npm install<br>COPY . .<br>RUN npm run build<br># ── Stage 2: Serve with Nginx ─────────────────────────────<br>FROM nginx:alpine<br>COPY --from=build /app/build /usr/share/nginx/html<br>COPY nginx.conf /etc/nginx/conf.d/default.conf<br>EXPOSE 80</pre><p>Same two-stage pattern:</p><ul><li>Stage 1 — Node.js builds the React app into static files</li><li>Stage 2 — Nginx serves those static files</li></ul><p>The final image has no Node.js. No npm. Just Nginx serving HTML, CSS, and JavaScript files.</p><h3>What is Docker Compose?</h3><p>Your system has three services:</p><ul><li>PostgreSQL database</li><li>.NET API</li><li>React frontend</li></ul><p>You could start them one by one:</p><pre>docker run postgres...<br>docker run ricemill-api...<br>docker run ricemill-frontend...</pre><p>But they need to talk to each other. They need shared networks. They need environment variables. They need to start in the right order.</p><p><strong>Docker Compose</strong> manages all of this in one file.</p><p><strong>My docker-compose.yml:</strong></p><pre>version: &#39;3.8&#39;<br><br>services:<br>  # ── PostgreSQL Database ────────────────────────────────<br>  db:<br>    image: postgres:15<br>    container_name: ricemill_db<br>    environment:<br>      POSTGRES_DB: RiceMillDb<br>      POSTGRES_USER: postgres<br>      POSTGRES_PASSWORD: postgres<br>    ports:<br>      - &quot;5433:5432&quot;<br>    volumes:<br>      - pgdata:/var/lib/postgresql/data<br>  # ── .NET API ───────────────────────────────────────────<br>  api:<br>    image: yourdockerhubusername/ricemill-api:latest<br>    container_name: ricemill_api<br>    depends_on:<br>      - db<br>    environment:<br>      - ConnectionStrings__DefaultConnection=Host=db;Port=5432;Database=RiceMillDb;Username=postgres;Password=postgres<br>      - JwtSettings__SecretKey=RiceMillSecretKey2024<br>      - JwtSettings__Issuer=RiceMillApi<br>      - JwtSettings__Audience=RiceMillClient<br>      - JwtSettings__ExpiryHours=8<br>    ports:<br>      - &quot;5000:5000&quot;<br>  # ── React Frontend ─────────────────────────────────────<br>  frontend:<br>    image: yourdockerhubusername/ricemill-frontend:latest<br>    container_name: ricemill_frontend<br>    depends_on:<br>      - api<br>    ports:<br>      - &quot;3000:80&quot;<br>volumes:<br>  pgdata:</pre><p>Let me explain every important part:</p><p><strong>image:</strong> — which Docker image to use. Pulled from Docker Hub.</p><p><strong>container_name:</strong> — a friendly name for the container.</p><p><strong>environment:</strong> — environment variables passed into the container. This is how the API gets the database connection string without hardcoding it.</p><p><strong>ports: &quot;5000:5000&quot;</strong> — maps host port to container port.</p><pre>&quot;5000:5000&quot;<br>  ↑      ↑<br>host   container<br>port   port<br><br>Request hits EC2 port 5000<br>→ Docker forwards to container port 5000</pre><p><strong>depends_on:</strong> — start order.</p><pre>db starts first<br>api starts after db<br>frontend starts after api</pre><p><strong>volumes: pgdata</strong> — persistent storage for PostgreSQL.</p><pre>Without volume:<br>docker compose down → all database data deleted forever<br><br>With volume:<br>docker compose down → data saved on host disk<br>docker compose up   → data restored automatically</pre><p><strong>Host=db</strong> — inside Docker Compose, containers talk to each other by service name. The API connects to the database using Host=db — not localhost. Docker resolves db to the database container automatically.</p><h3>What is Docker Hub?</h3><p>Docker Hub is like GitHub — but for Docker images instead of code.</p><pre>GitHub  = store and share code<br>DockerHub = store and share Docker images</pre><p>I pushed my built images to Docker Hub:</p><pre>docker build -t yourusername/ricemill-api:latest ./RiceMillApi<br>docker push yourusername/ricemill-api:latest<br><br>docker build -t yourusername/ricemill-frontend:latest ./rice-mill-ui<br>docker push yourusername/ricemill-frontend:latest</pre><p>Now the images are available publicly. My EC2 server can pull them:</p><pre>docker pull yourusername/ricemill-api:latest<br>docker pull yourusername/ricemill-frontend:latest</pre><p>This is the key to CI/CD — build once, push to Docker Hub, pull anywhere.</p><h3>Running Everything</h3><p>One command starts the entire system:</p><pre>docker compose up -d</pre><pre>-d = detached mode (runs in background)</pre><p>What happens:</p><pre>docker compose up -d<br>        ↓<br>Docker pulls postgres:15 image<br>Docker pulls ricemill-api image<br>Docker pulls ricemill-frontend image<br>        ↓<br>Creates network between containers<br>        ↓<br>Starts db container<br>        ↓<br>Starts api container (waits for db)<br>EF Core migrations run automatically<br>27 accounts seeded<br>        ↓<br>Starts frontend container<br>        ↓<br>All three running ✅</pre><p>Check everything is running:</p><pre>docker ps</pre><pre>CONTAINER ID   IMAGE                      STATUS<br>abc123         ricemill-api:latest        Up 2 minutes<br>def456         ricemill-frontend:latest   Up 2 minutes<br>ghi789         postgres:15                Up 2 minutes</pre><p>Check logs if something goes wrong:</p><pre>docker compose logs api       # API logs<br>docker compose logs db        # database logs<br>docker compose logs frontend  # nginx logs</pre><h3>The Moment It All Worked</h3><p>I ran docker compose up --build for the first time on my local machine and saw:</p><pre>✔ Container ricemill_db        Created<br>✔ Container ricemill_api       Created<br>✔ Container ricemill_frontend  Created<br><br>ricemill_api | info: Applying migration &#39;InitialCreate&#39;<br>ricemill_api | info: Now listening on: http://[::]:5000<br>ricemill_frontend | nginx: configuration complete; ready for start up</pre><p>I opened <a href="http://localhost:3000.">http://localhost:3000.</a></p><p>The login page appeared.</p><p>I logged in. The dashboard loaded. I saved a test sale. It appeared in the database.</p><p><strong>Three services. One command. Everything working.</strong></p><p>That feeling — when three completely separate technologies start together and talk to each other perfectly — is one of the best moments in software development.</p><h3>Useful Docker Commands</h3><pre># Start everything<br>docker compose up -d<br># Stop everything<br>docker compose down<br># Rebuild and start (after code changes)<br>docker compose up --build -d<br># View running containers<br>docker ps<br># View logs<br>docker compose logs api<br>docker compose logs -f api    # -f = follow (live logs)<br># Go inside a container<br>docker exec -it ricemill_api bash<br>docker exec -it ricemill_db psql -U postgres -d RiceMillDb<br># Remove everything including volumes (careful - deletes data)<br>docker compose down -v<br># Remove unused images (free up disk space)<br>docker image prune -f</pre><h3>Before and After Docker</h3><pre>Before Docker:<br>New server setup = 2 hours<br>  → install .NET manually<br>  → install PostgreSQL manually<br>  → configure connection strings<br>  → set environment variables<br>  → debug why it doesn&#39;t work<br>  → probably give up<br><br>After Docker:<br>New server setup = 5 minutes<br>  → install Docker<br>  → docker compose up<br>  → done</pre><p>Docker does not just solve the “works on my machine” problem. It makes deployment repeatable, predictable, and fast — every single time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=932d03d32d97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 5 — Building the React Frontend]]></title>
            <link>https://medium.com/@Priyatharsini06/part-5-building-the-react-frontend-6a26b532c60f?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a26b532c60f</guid>
            <category><![CDATA[mui]]></category>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[useeffect]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 17:16:12 GMT</pubDate>
            <atom:updated>2026-03-24T17:16:12.748Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The API is done. Every endpoint tested in Postman. Now the user needs something to actually look at and click.</em></p><h3>The Problem</h3><p>Your API is working perfectly.</p><p>But right now the only way to use it is by typing JSON into Postman.</p><pre>POST /api/transactions/rice-sale<br>{<br>  &quot;date&quot;: &quot;2026-03-01&quot;,<br>  &quot;amount&quot;: 50000,<br>  &quot;customerId&quot;: 1<br>}</pre><p>No rice mill owner is going to do that.</p><p>They need buttons. Forms. Tables. A screen that makes sense to a non-technical person.</p><p>That is the frontend.</p><h3>What is React?</h3><p>React is a JavaScript library for building user interfaces. Created by Facebook in 2013. Used everywhere today.</p><p>The key idea behind React is simple:</p><blockquote><em>Break your UI into small, reusable, independent pieces called </em><strong><em>components</em></strong><em>.</em></blockquote><p>Instead of one giant HTML file with thousands of lines — you build small focused pieces:</p><pre>&lt;App&gt;<br>  ├── &lt;Sidebar /&gt;<br>  ├── &lt;Header /&gt;<br>  └── &lt;MainContent&gt;<br>        ├── &lt;SaleForm /&gt;<br>        └── &lt;SalesHistory /&gt;<br>      &lt;/MainContent&gt;<br>&lt;/App&gt;</pre><p>Each component manages its own data and appearance. Change one — the others are unaffected.</p><h3>Why Not Plain HTML and JavaScript?</h3><p>Let me show you the difference with a real example.</p><p>A user saves a sale. You want the sales table to update immediately without refreshing the page.</p><p><strong>Plain HTML + JavaScript:</strong></p><pre>// You manually find the table<br>const table = document.getElementById(&#39;sales-table&#39;);<br>// You manually create a new row<br>const row = document.createElement(&#39;tr&#39;);<br>// You manually add each cell<br>row.innerHTML = `&lt;td&gt;${sale.date}&lt;/td&gt;&lt;td&gt;${sale.amount}&lt;/td&gt;`;<br>// You manually add it to the table<br>table.appendChild(row);<br>// You manually update the total<br>document.getElementById(&#39;total&#39;).innerText = newTotal;<br>// Miss one step → bug</pre><p><strong>React:</strong></p><pre>// Update the data<br>setSales([...sales, newSale]);<br>// React automatically re-renders everything that changed<br>// You write zero DOM manipulation code</pre><p>React watches your data. When data changes — React updates the screen. You never touch the HTML manually.</p><h3>Project Setup</h3><pre>npx create-react-app rice-mill-ui<br>cd rice-mill-ui<br>npm install @mui/material @emotion/react @emotion/styled<br>npm install @mui/x-data-grid<br>npm install @mui/icons-material<br>npm install axios<br>npm install dayjs<br>npm install react-router-dom</pre><p>What each package does:</p><pre>@mui/material        → pre-built UI components (buttons, forms, tables)<br>@mui/x-data-grid     → advanced data table with sorting and pagination<br>@mui/icons-material  → Material Design icons<br>axios                → HTTP client — talks to your API<br>dayjs                → date formatting (lighter than moment.js)<br>react-router-dom     → navigation between pages</pre><h3>Project Structure</h3><pre>rice-mill-ui/src/<br>├── pages/<br>│   ├── Transactions/<br>│   │   ├── RiceSale.jsx<br>│   │   ├── PaddyPurchase.jsx<br>│   │   ├── Expense.jsx<br>│   │   └── ReceiptPayment.jsx<br>│   ├── Reports/<br>│   │   ├── BalanceSheet.jsx<br>│   │   ├── ProfitLoss.jsx<br>│   │   └── CashBook.jsx<br>│   ├── Cheques/<br>│   │   └── Cheques.jsx<br>│   ├── Parties/<br>│   │   └── Parties.jsx<br>│   └── Dashboard/<br>│       └── Dashboard.jsx<br>├── api/<br>│   └── index.js      ← all API calls in one place<br>├── components/<br>│   └── Layout.jsx    ← sidebar + header<br>└── App.js            ← routing</pre><h3>The API File — One Place for Everything</h3><p>Every single API call lives in one file. This is the most important organisation decision I made.</p><pre>// src/api/index.js<br>import axios from &#39;axios&#39;;<br><br>const api = axios.create({<br>  baseURL: &#39;http://localhost:5000/api&#39;,<br>});<br>// Attach JWT token to EVERY request automatically<br>api.interceptors.request.use((config) =&gt; {<br>  const token = localStorage.getItem(&#39;token&#39;);<br>  if (token) config.headers.Authorization = `Bearer ${token}`;<br>  return config;<br>});<br>// Auto logout on 401 - token expired or invalid<br>api.interceptors.response.use(<br>  (res) =&gt; res,<br>  (err) =&gt; {<br>    if (err.response?.status === 401) {<br>      localStorage.clear();<br>      window.location.href = &#39;/login&#39;;<br>    }<br>    return Promise.reject(err);<br>  }<br>);<br>// Auth<br>export const login = (data) =&gt; api.post(&#39;/auth/login&#39;, data);<br>// Accounts<br>export const getAccounts = () =&gt; api.get(&#39;/accounts&#39;);<br>export const getAccountBalance = (id, asOf) =&gt;<br>  api.get(`/accounts/${id}/balance`, { params: { asOf } });<br>// Transactions<br>export const riceSale = (data) =&gt;<br>  api.post(&#39;/transactions/rice-sale&#39;, data);<br>export const paddyPurchase = (data) =&gt;<br>  api.post(&#39;/transactions/paddy-purchase&#39;, data);<br>export const getTransactions = (params) =&gt;<br>  api.get(&#39;/transactions&#39;, { params });<br>// Reports<br>export const getBalanceSheet = (asOf) =&gt;<br>  api.get(&#39;/reports/balancesheet&#39;, { params: { asOf } });<br>export const getProfitLoss = (params) =&gt;<br>  api.get(&#39;/reports/profitloss&#39;, { params });<br>// Cheques<br>export const getCheques = (params) =&gt;<br>  api.get(&#39;/cheques&#39;, { params });<br>export const clearCheque = (id) =&gt;<br>  api.post(`/cheques/${id}/clear`);<br>export const bounceCheque = (id, data) =&gt;<br>  api.post(`/cheques/${id}/bounce`, data);</pre><p><strong>What is Axios?</strong></p><p>Axios is an HTTP client — it sends requests from your React app to your .NET API.</p><p>Without Axios you would use the browser’s built-in fetch:</p><pre>// fetch — verbose and awkward<br>const res = await fetch(&#39;/api/accounts&#39;, {<br>  headers: { Authorization: `Bearer ${token}` }<br>});<br>const data = await res.json();<br>if (!res.ok) throw new Error(&#39;failed&#39;);</pre><p>With Axios:</p><pre>// axios — clean and simple<br>const { data } = await getAccounts();</pre><p>Plus Axios has <strong>interceptors</strong> — middleware that runs before every request and after every response. I used this to:</p><ul><li>Automatically attach the JWT token to every request</li><li>Automatically redirect to login on 401</li></ul><p>You write this once. Every API call benefits. Forever.</p><h3>What is useState?</h3><p>useState is how React components remember data.</p><pre>const [sales, setSales] = useState([]);</pre><p>This creates:</p><ul><li>sales — the current value (starts as empty array)</li><li>setSales — a function to update it</li></ul><p>When you call setSales(newData) — React automatically re-renders the component with the new data.</p><pre>// Wrong — React doesn&#39;t know this changed<br>sales.push(newSale);<br><br>// Correct - React sees the change and re-renders<br>setSales([...sales, newSale]);</pre><h3>What is useEffect?</h3><p>useEffect runs code when a component loads or when something changes.</p><pre>useEffect(() =&gt; {<br>  loadSales();     // runs when component first appears on screen<br>}, []);            // empty [] = run only once on mount<br><br>useEffect(() =&gt; {<br>  loadSales();     // runs every time &#39;dateFilter&#39; changes<br>}, [dateFilter]);</pre><p>Every page that loads data follows the same pattern:</p><pre>const [data, setData]       = useState([]);<br>const [loading, setLoading] = useState(true);<br>const [error, setError]     = useState(&#39;&#39;);<br><br>useEffect(() =&gt; { load(); }, []);<br>const load = async () =&gt; {<br>  setLoading(true);<br>  try {<br>    const res = await getTransactions();<br>    setData(res.data);<br>  } catch {<br>    setError(&#39;Failed to load&#39;);<br>  } finally {<br>    setLoading(false);<br>  }<br>};</pre><h3>Building the Rice Sale Form</h3><p>Here is the complete Rice Sale page simplified:</p><pre>// pages/Transactions/RiceSale.jsx<br>import { useState, useEffect } from &#39;react&#39;;<br>import { Box, TextField, MenuItem, Button, Alert } from &#39;@mui/material&#39;;<br>import { riceSale, getParties } from &#39;../../api&#39;;<br><br>const load = async () =&gt; {<br>    const res = await getBalanceSheet(asOf);<br>    setData(res.data);<br>  };<br>  useEffect(() =&gt; { load(); }, []);<br>  return (<br>    &lt;Box&gt;<br>      &lt;TextField<br>        type=&quot;date&quot; value={asOf}<br>        onChange={(e) =&gt; setAsOf(e.target.value)}<br>      /&gt;<br>      &lt;Button onClick={load}&gt;Load&lt;/Button&gt;<br>      {data &amp;&amp; (<br>        &lt;Grid container spacing={3}&gt;<br>          {/* Assets side */}<br>          &lt;Grid item xs={6}&gt;<br>            {data.assets.items.map(account =&gt; (<br>              &lt;AccountRow key={account.accountId} {...account} asOf={asOf} /&gt;<br>            ))}<br>            &lt;Typography&gt;Total Assets: {data.assets.total}&lt;/Typography&gt;<br>          &lt;/Grid&gt;<br>          {/* Liabilities side */}<br>          &lt;Grid item xs={6}&gt;<br>            {data.liabilities.items.map(account =&gt; (<br>              &lt;AccountRow key={account.accountId} {...account} asOf={asOf} /&gt;<br>            ))}<br>            &lt;Typography&gt;Total Liabilities: {data.liabilities.total}&lt;/Typography&gt;<br>          &lt;/Grid&gt;<br>        &lt;/Grid&gt;<br>      )}<br>    &lt;/Box&gt;<br>  );<br>}</pre><p>When user clicks <strong>Save Sale</strong>:</p><pre>handleSave() runs<br>      ↓<br>calls riceSale(form) from api/index.js<br>      ↓<br>Axios sends POST /api/transactions/rice-sale<br>with JWT token in header<br>      ↓<br>.NET API receives it<br>validates, creates journal entries, saves to PostgreSQL<br>      ↓<br>Returns { message: &quot;Sale saved&quot;, txnId: 1 }<br>      ↓<br>React shows green success alert<br>form resets to empty</pre><h3>What is MUI?</h3><p>MUI (Material UI) is a component library — pre-built, pre-styled React components.</p><p>Without MUI:</p><pre>// Build a data table from scratch<br>// 200+ lines of HTML, CSS, JavaScript<br>// 2 days of work<br>// Still looks average<br>// No sorting, no pagination</pre><p>With MUI DataGrid:</p><pre>&lt;DataGrid<br>  rows={sales}<br>  columns={columns}<br>  pageSizeOptions={[25, 50]}<br>  autoHeight<br>/&gt;</pre><p>One component. Built-in sorting. Built-in pagination. Built-in filtering. Looks professional. Done in 5 minutes.</p><p>For a solo developer building a full system alone — MUI was not optional. It was survival.</p><h3>Building the Balance Sheet</h3><p>The Balance Sheet was the most complex page. It needed:</p><ul><li>Real-time data as of any date</li><li>Clickable accounts that expand to show all transactions</li><li>Print to A4</li></ul><pre>// Simplified Balance Sheet<br>export default function BalanceSheet() {<br>  const [asOf, setAsOf] = useState(dayjs().format(&#39;YYYY-MM-DD&#39;));<br>  const [data, setData] = useState(null);<br><br>const load = async () =&gt; {<br>    const res = await getBalanceSheet(asOf);<br>    setData(res.data);<br>  };<br>  useEffect(() =&gt; { load(); }, []);<br>  return (<br>    &lt;Box&gt;<br>      &lt;TextField<br>        type=&quot;date&quot; value={asOf}<br>        onChange={(e) =&gt; setAsOf(e.target.value)}<br>      /&gt;<br>      &lt;Button onClick={load}&gt;Load&lt;/Button&gt;<br>      {data &amp;&amp; (<br>        &lt;Grid container spacing={3}&gt;<br>          {/* Assets side */}<br>          &lt;Grid item xs={6}&gt;<br>            {data.assets.items.map(account =&gt; (<br>              &lt;AccountRow key={account.accountId} {...account} asOf={asOf} /&gt;<br>            ))}<br>            &lt;Typography&gt;Total Assets: {data.assets.total}&lt;/Typography&gt;<br>          &lt;/Grid&gt;<br>          {/* Liabilities side */}<br>          &lt;Grid item xs={6}&gt;<br>            {data.liabilities.items.map(account =&gt; (<br>              &lt;AccountRow key={account.accountId} {...account} asOf={asOf} /&gt;<br>            ))}<br>            &lt;Typography&gt;Total Liabilities: {data.liabilities.total}&lt;/Typography&gt;<br>          &lt;/Grid&gt;<br>        &lt;/Grid&gt;<br>      )}<br>    &lt;/Box&gt;<br>  );<br>}</pre><p><strong>AccountRow</strong> — each account is clickable and expands to show all transactions:</p><pre>function AccountRow({ accountId, name, balance, asOf }) {<br>  const [open,    setOpen]    = useState(false);<br>  const [entries, setEntries] = useState([]);<br>  const fetchedRef            = useRef(false);<br><br>const toggle = async () =&gt; {<br>    // First click → fetch transactions<br>    if (!fetchedRef.current) {<br>      const res = await getAccountBalance(accountId, asOf);<br>      setEntries(res.data.entries);<br>      fetchedRef.current = true;<br>    }<br>    setOpen(o =&gt; !o);<br>  };<br>  return (<br>    &lt;&gt;<br>      {/* Click to expand */}<br>      &lt;Box onClick={toggle} sx={{ cursor: &#39;pointer&#39;, &#39;&amp;:hover&#39;: { bgcolor: &#39;#f5f8ff&#39; } }}&gt;<br>        &lt;Typography&gt;{name}&lt;/Typography&gt;<br>        &lt;Typography&gt;{balance}&lt;/Typography&gt;<br>      &lt;/Box&gt;<br>      {/* Expanded transactions table */}<br>      {open &amp;&amp; (<br>        &lt;Table&gt;<br>          {entries.map((e, i) =&gt; (<br>            &lt;TableRow key={i}&gt;<br>              &lt;TableCell&gt;{e.txnDate}&lt;/TableCell&gt;<br>              &lt;TableCell&gt;{e.journalDesc}&lt;/TableCell&gt;<br>              &lt;TableCell&gt;{e.drAmount &gt; 0 ? e.drAmount : &#39;-&#39;}&lt;/TableCell&gt;<br>              &lt;TableCell&gt;{e.crAmount &gt; 0 ? e.crAmount : &#39;-&#39;}&lt;/TableCell&gt;<br>            &lt;/TableRow&gt;<br>          ))}<br>        &lt;/Table&gt;<br>      )}<br>    &lt;/&gt;<br>  );<br>}</pre><p>Click <strong>Cash (24)</strong> → expands to show every cash transaction with journal description like Cash DR / Capital CR.</p><h3>Routing — Multiple Pages</h3><pre>// App.js<br>import { BrowserRouter, Routes, Route } from &#39;react-router-dom&#39;;<br><br>export default function App() {<br>  return (<br>    &lt;BrowserRouter&gt;<br>      &lt;Routes&gt;<br>        &lt;Route path=&quot;/login&quot;            element={&lt;Login /&gt;} /&gt;<br>        &lt;Route path=&quot;/&quot;                 element={&lt;Dashboard /&gt;} /&gt;<br>        &lt;Route path=&quot;/rice-sale&quot;        element={&lt;RiceSale /&gt;} /&gt;<br>        &lt;Route path=&quot;/paddy-purchase&quot;   element={&lt;PaddyPurchase /&gt;} /&gt;<br>        &lt;Route path=&quot;/cheques&quot;          element={&lt;Cheques /&gt;} /&gt;<br>        &lt;Route path=&quot;/balance-sheet&quot;    element={&lt;BalanceSheet /&gt;} /&gt;<br>        &lt;Route path=&quot;/profit-loss&quot;      element={&lt;ProfitLoss /&gt;} /&gt;<br>        &lt;Route path=&quot;/parties&quot;          element={&lt;Parties /&gt;} /&gt;<br>      &lt;/Routes&gt;<br>    &lt;/BrowserRouter&gt;<br>  );<br>}</pre><p>Each URL = one page component. React Router handles navigation without full page reloads.</p><h3>The Complete Frontend Flow</h3><pre>User opens https://ricemillacc.ddns.net<br>              ↓<br>Nginx serves React build files (index.html)<br>              ↓<br>React loads in browser<br>              ↓<br>Login page → user enters credentials<br>              ↓<br>POST /api/auth/login<br>              ↓<br>JWT token received → stored in localStorage<br>              ↓<br>Dashboard loads<br>              ↓<br>User clicks Rice Sale<br>              ↓<br>React Router shows RiceSale component<br>              ↓<br>useEffect → GET /api/parties?type=customer<br>              ↓<br>Axios adds JWT token automatically<br>              ↓<br>Customers load in dropdown<br>              ↓<br>User fills form → clicks Save<br>              ↓<br>POST /api/transactions/rice-sale<br>              ↓<br>Success → table refreshes</pre><h3>One Lesson I Learned</h3><p>I started building the React frontend before the API was fully tested.</p><p>Result — I spent hours debugging not knowing if the bug was in React or in the API.</p><p><strong>Never do this.</strong></p><p>Finish the entire API. Test every endpoint in Postman. Get 200 responses for everything. Then open React.</p><p>When you build on a working foundation — frontend development is fast and enjoyable. When you build on an untested foundation — everything is confusion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a26b532c60f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 4 — Building the REST API with ASP.NET Core]]></title>
            <link>https://medium.com/@Priyatharsini06/part-4-building-the-rest-api-with-asp-net-core-942bd2d3a51a?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/942bd2d3a51a</guid>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[postman-testing]]></category>
            <category><![CDATA[jwt-authentication]]></category>
            <category><![CDATA[rest-api-architecture]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 17:14:07 GMT</pubDate>
            <atom:updated>2026-03-24T17:14:07.261Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Database is ready. 8 tables. 27 accounts. Everything structured perfectly. But nobody can touch it yet. You need a door.</em></p><h3>The Problem</h3><p>Imagine your database is a warehouse full of stock.</p><p>The warehouse has no entrance. No windows. No phone line.</p><p>Your React frontend is standing outside saying:</p><pre>&quot;Hey I need the sales list&quot;<br>&quot;Hey save this new purchase&quot;<br>&quot;Hey what is the current balance?&quot;</pre><p>Nobody answers. Nothing happens.</p><p>You need someone standing at the door — receiving requests, going inside, getting what is needed, and bringing it back.</p><p>That someone is the <strong>API</strong>.</p><h3>What is an API?</h3><p><strong>API</strong> — Application Programming Interface.</p><p>Forget the definition. Here is the real explanation:</p><blockquote><em>An API is a waiter in a restaurant.</em></blockquote><pre>You (Frontend)<br>  → tells waiter &quot;I want the sales report&quot;<br><br>Waiter (API)<br>  → goes to kitchen with the order<br>Kitchen (Database)<br>  → prepares the data<br>Waiter (API)<br>  → brings it back to you as JSON<br>You (Frontend)<br>  → displays it on screen</pre><p>The customer never walks into the kitchen. The kitchen never talks to the customer directly. The waiter is always in the middle.</p><p>This is how every web application in the world works.</p><h3>What is REST?</h3><p>REST is a set of rules for how your API behaves.</p><p>The most important rule — every piece of data has a <strong>URL address</strong> and you interact with it using <strong>HTTP methods</strong>.</p><p>4 methods you must know:</p><p>Method Meaning Example GET Read data Get all sales POST Create new data Save a new sale PUT Update existing Edit party name DELETE Remove data Deactivate account</p><p>Your entire API is just a collection of URLs:</p><pre>GET    /api/accounts              → get all accounts<br>POST   /api/accounts              → create new account<br>GET    /api/accounts/5/balance    → get account 5 balance<br>POST   /api/transactions/rice-sale → save a rice sale<br>POST   /api/cheques/3/clear       → clear cheque number 3<br>GET    /api/reports/balancesheet  → get balance sheet</pre><p>Simple. Predictable. Every URL does exactly one thing.</p><h3>Project Structure</h3><p>Before writing any code, here is how I organised the project:</p><pre>RiceMillApi/<br>├── Controllers/<br>│   ├── AccountsController.cs<br>│   ├── AuthController.cs<br>│   ├── ChequesController.cs<br>│   ├── PartiesController.cs<br>│   ├── TransactionsController.cs<br>│   ├── ReportsController.cs<br>│   ├── AdvancesController.cs<br>│   └── FiscalYearsController.cs<br>├── Models/<br>│   ├── Account.cs<br>│   ├── Transaction.cs<br>│   ├── TransactionEntry.cs<br>│   ├── Party.cs<br>│   ├── Cheque.cs<br>│   ├── Advance.cs<br>│   ├── FiscalYear.cs<br>│   └── User.cs<br>├── Data/<br>│   └── AppDbContext.cs<br>├── Program.cs<br>└── appsettings.json</pre><p>One controller per feature. One model per table. Clean and predictable.</p><h3>What is a Controller?</h3><p>A Controller is a C# class that handles incoming HTTP requests.</p><p>Here is the simplest possible controller — the Accounts controller:</p><pre>[ApiController]<br>[Route(&quot;api/[controller]&quot;)]<br>public class AccountsController : ControllerBase<br>{<br>    private readonly AppDbContext _db;<br><br>public AccountsController(AppDbContext db)<br>    {<br>        _db = db;<br>    }<br>    // GET /api/accounts<br>    [HttpGet]<br>    public async Task&lt;IActionResult&gt; GetAll()<br>    {<br>        var accounts = await _db.Accounts<br>            .Where(a =&gt; a.IsActive)<br>            .OrderBy(a =&gt; a.AccountCode)<br>            .ToListAsync();<br>        return Ok(accounts);<br>    }<br>    // POST /api/accounts<br>    [HttpPost]<br>    public async Task&lt;IActionResult&gt; Create([FromBody] AccountDto dto)<br>    {<br>        var account = new Account {<br>            AccountCode = dto.AccountCode,<br>            AccountName = dto.AccountName,<br>            AccountType = dto.AccountType,<br>            Category    = dto.Category<br>        };<br>        _db.Accounts.Add(account);<br>        await _db.SaveChangesAsync();<br>        return Ok(new { message = &quot;Account created&quot;, id = account.AccountId });<br>    }<br>}</pre><p>Let me explain every piece:</p><pre>[ApiController]        → tells .NET this handles API requests<br>[Route(&quot;api/accounts&quot;)]→ all endpoints here start with /api/accounts<br>ControllerBase         → base class giving you Ok(), NotFound() etc.<br>AppDbContext _db       → your database connection<br>[HttpGet]              → responds to GET /api/accounts<br>[HttpPost]             → responds to POST /api/accounts<br>[FromBody]             → reads JSON from request body<br>return Ok(accounts)    → sends 200 status + data as JSON</pre><h3>What is Dependency Injection?</h3><p>You noticed this in the controller:</p><pre>public AccountsController(AppDbContext db)<br>{<br>    _db = db;<br>}</pre><p>You never wrote new AppDbContext(). ASP.NET Core gave it to you automatically.</p><p>This is <strong>Dependency Injection</strong> — one of the most important concepts in modern software.</p><p><strong>Without DI — the wrong way:</strong></p><pre>// You create everything yourself<br>var db = new AppDbContext(connectionString);<br><br>// Every class creates its own copy<br>// You manage when to create it<br>// You manage when to destroy it<br>// Testing becomes a nightmare</pre><p><strong>With DI — the right way:</strong></p><pre>// Register ONCE in Program.cs<br>builder.Services.AddDbContext&lt;AppDbContext&gt;(options =&gt;<br>    options.UseNpgsql(connectionString));<br><br>// Every class creates its own copy<br>// You manage when to create it<br>// You manage when to destroy it<br>// Testing becomes a nightmare</pre><p>Think of it like this:</p><pre>Without DI = every employee buys their own coffee machine<br>With DI    = office has one shared machine, everyone uses it,<br>             office manager maintains it</pre><p>You just use it. You never worry about managing it.</p><h3>What is JWT Authentication?</h3><p>Your API is now live. But there is a big problem —</p><p><strong>Anyone in the world can call it.</strong></p><p>No login. No security. Anyone could save fake transactions, delete data, or read confidential financial records.</p><p>You need to make sure only <strong>logged-in users</strong> can access endpoints.</p><p>This is where <strong>JWT</strong> comes in.</p><p><strong>JWT — JSON Web Token</strong></p><p>Here is how it works in plain English:</p><pre>Step 1 — User logs in:<br>POST /api/auth/login<br>{ &quot;username&quot;: &quot;admin&quot;, &quot;password&quot;: &quot;password123&quot; }<br><br>Step 2 - Server checks credentials:<br>Password correct?<br>→ Generate a token - a long encrypted string:<br>  &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbi...&quot;<br>Step 3 - Frontend stores token in browser memory<br>Step 4 - Every future request includes the token:<br>GET /api/transactions<br>Authorization: Bearer eyJhbGciOiJIUzI1NiIs...<br>Step 5 - Server reads the token on every request:<br>Valid token?  → allow request ✅<br>Invalid?      → return 401 Unauthorized ❌<br>Expired?      → return 401 Unauthorized ❌</pre><p>The token expires after 8 hours. After that, the user must log in again.</p><p><strong>Protecting an endpoint is one line:</strong></p><pre>[Authorize]   // ← one attribute blocks all unauthenticated requests<br>[HttpGet]<br>public async Task&lt;IActionResult&gt; GetAll()<br>{<br>    // Only logged-in users with valid token reach here<br>}</pre><p>Without a valid token — ASP.NET Core returns 401 automatically. You write zero security logic.</p><p><strong>Setting up JWT in Program.cs:</strong></p><pre>builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)<br>    .AddJwtBearer(options =&gt;<br>    {<br>        options.TokenValidationParameters = new TokenValidationParameters<br>        {<br>            ValidateIssuer           = true,<br>            ValidateAudience         = true,<br>            ValidateLifetime         = true,<br>            ValidateIssuerSigningKey = true,<br>            ValidIssuer              = &quot;RiceMillApi&quot;,<br>            ValidAudience            = &quot;RiceMillClient&quot;,<br>            IssuerSigningKey         = new SymmetricSecurityKey(<br>                                         Encoding.UTF8.GetBytes(&quot;YourSecretKey&quot;))<br>        };<br>    });</pre><h3>Setting Up HTTPS</h3><p>The API is running. JWT is protecting it. But there is still one problem.</p><p>HTTP sends everything as <strong>plain text</strong>. Username. Password. Financial data. Every byte visible to anyone watching the network.</p><pre>HTTP:<br>Browser sends → &quot;password123&quot;<br>Hacker sees   → &quot;password123&quot;  ✅ dangerous<br>HTTPS:<br>Browser sends → &quot;x7$kL#9mQ2...&quot; (encrypted)<br>Hacker sees   → gibberish       ❌ useless to them</pre><p>I used <strong>Let’s Encrypt</strong> — a free SSL certificate provider — with <strong>Certbot</strong>:</p><pre>sudo apt install certbot python3-certbot-nginx<br>sudo certbot --nginx -d ricemillacc.ddns.net</pre><p>Certbot automatically:</p><ul><li>Generated the SSL certificate</li><li>Updated Nginx config to use HTTPS</li><li>Set up HTTP → HTTPS redirect</li><li>Scheduled auto-renewal every 90 days</li></ul><p>My actual Nginx config after Certbot:</p><pre># HTTPS server<br>server {<br>    listen 443 ssl;<br>    server_name ricemillacc.ddns.net;<br><br># Certificates from Let&#39;s Encrypt<br>    ssl_certificate     /etc/letsencrypt/live/ricemillacc.ddns.net/fullchain.pem;<br>    ssl_certificate_key /etc/letsencrypt/live/ricemillacc.ddns.net/privkey.pem;<br>    # API requests → .NET backend<br>    location /api/ {<br>        proxy_pass http://localhost:5001/api/;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>    }<br>    # Everything else → React frontend<br>    location / {<br>        proxy_pass http://localhost:3000;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>    }<br>}<br># Force HTTP → HTTPS redirect<br>server {<br>    listen 80;<br>    server_name ricemillacc.ddns.net;<br>    return 301 https://$host$request_uri;<br>}</pre><p>What each part does:</p><pre>listen 443 ssl      → handles secure HTTPS connections<br>ssl_certificate     → certificate file from Let&#39;s Encrypt<br>location /api/      → routes API calls to .NET on port 5001<br>location /          → routes everything else to React on port 3000<br>listen 80 + 301     → anyone on http:// gets forced to https://</pre><p>The entire HTTPS setup took 15 minutes and costs nothing.</p><h3>Writing the First Real Endpoint</h3><p>After controllers, JWT, and HTTPS — I wrote my first real business endpoint. A rice sale:</p><pre>[HttpPost(&quot;rice-sale&quot;)]<br>public async Task&lt;IActionResult&gt; RiceSale([FromBody] SaleDto dto)<br>{<br>    // Step 1 — create transaction record<br>    var txn = new Transaction {<br>        TxnDate     = dto.Date,<br>        TxnType     = &quot;sale&quot;,<br>        TotalAmount = dto.Amount,<br>        PartyId     = dto.CustomerId,<br>        PaymentMode = dto.PaymentMode,<br>        FiscalYearId = activeFiscalYear.FiscalYearId<br>    };<br><br>// Step 2 - create journal entries (double entry)<br>    // Cash sale: DR Cash (24) / CR Sales (7)<br>    txn.Entries = new List&lt;TransactionEntry&gt; {<br>        new() { AccountId = 26, DrAmount = dto.Amount, CrAmount = 0 },<br>        new() { AccountId = 7,  DrAmount = 0, CrAmount = dto.Amount }<br>    };<br>    _db.Transactions.Add(txn);<br>    await _db.SaveChangesAsync();<br>    return Ok(new { message = &quot;Sale saved&quot;, txnId = txn.TxnId });<br>}</pre><p>I opened <strong>Postman</strong>, sent a POST request with:</p><pre>{<br>  &quot;date&quot;: &quot;2026-03-01&quot;,<br>  &quot;amount&quot;: 50000,<br>  &quot;customerId&quot;: 1,<br>  &quot;paymentMode&quot;: &quot;cash&quot;<br>}</pre><p>Response:</p><pre>{<br>  &quot;message&quot;: &quot;Sale saved&quot;,<br>  &quot;txnId&quot;: 1<br>}</pre><p>Then opened pgAdmin and saw the row sitting in the database.</p><p><strong>That moment — when code you wrote creates real data in a real database — is when you feel like a developer.</strong></p><h3>What is Postman?</h3><p>Before building the React frontend, I tested every single endpoint using <strong>Postman</strong>.</p><p>Postman is a tool that lets you send HTTP requests manually — without a frontend.</p><pre>Instead of:<br>Building a form in React just to test saving a sale<br>→ 1 hour of work<br>→ Still not sure if the bug is frontend or backend<br><br>With Postman:<br>Send POST request directly to /api/transactions/rice-sale<br>→ 30 seconds<br>→ You know immediately if the API works<br>→ Frontend and backend tested separately</pre><p><strong>Always build and test your entire API in Postman first. Only then start React.</strong></p><h3>My Build Order</h3><p>This is the exact order I built the API — and the order I recommend:</p><pre>1. Design database on paper<br>2. Write C# models<br>3. Create DbContext<br>4. Run migration → tables created<br>5. Write one controller<br>6. Test in Postman<br>7. Fix bugs<br>8. Write next controller<br>9. Repeat steps 6-8 for all controllers<br>10. Only start React when ALL endpoints work</pre><p>Never build frontend and backend at the same time when working alone. Finish the API completely. Then build the UI on top of a working foundation.</p><h3>Full Traffic Flow — Everything Connected</h3><pre>User visits https://ricemillacc.ddns.net<br>              ↓<br>           Nginx (port 443 — HTTPS)<br>              ↓<br>    /api/*  ──────────→  .NET API (port 5001)<br>                              ↓<br>                         JWT verified ✅<br>                              ↓<br>                         Business logic<br>                              ↓<br>                         EF Core query<br>                              ↓<br>                         AWS RDS PostgreSQL<br>                              ↓<br>                         Data returned as JSON<br>    /*      ──────────→  React Frontend (port 3000)</pre><p>One request. Five layers. Every layer doing exactly one job.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=942bd2d3a51a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module Pool in SAP ABAP — The Complete Medium Story]]></title>
            <link>https://medium.com/@Priyatharsini06/module-pool-in-sap-abap-the-complete-medium-story-5b7d00f6aad9?source=rss-53d2560e633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b7d00f6aad9</guid>
            <category><![CDATA[pbo]]></category>
            <category><![CDATA[module-pool]]></category>
            <category><![CDATA[pai]]></category>
            <category><![CDATA[sap-abap]]></category>
            <category><![CDATA[report-program]]></category>
            <dc:creator><![CDATA[Priyatharsini Sivalingam ]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 16:35:25 GMT</pubDate>
            <atom:updated>2026-03-22T16:35:25.290Z</atom:updated>
            <content:encoded><![CDATA[<p>Now think about a transaction like VA01 — Create Sales Order.</p><p>You open it. A screen appears. You fill in the customer number and press Enter. SAP validates it and automatically fills in the customer’s address. You move to the next screen. You add line items. You press another button. A popup appears asking for delivery details. You fill that. You go back. You change something. You press Save.</p><p>Multiple screens. Multiple user actions. Data flowing between screens. Validation happening at every step. The program is having a full two-way conversation with the user — back and forth, screen after screen.</p><p>A Report Program cannot do that.</p><p>That is why Module Pool exists.</p><p>Think of it this way.</p><p>A Report Program is like a vending machine. You press a button. You get your drink. Transaction done.</p><p>A Module Pool is like a restaurant. You sit down. A waiter takes your order. You change your mind and modify it. Food comes. You ask for something extra. You pay. You leave. A full, multi-step interaction managed by the restaurant — not a single button press.</p><p>Module Pool programs are also called Dialog Programs because they hold a dialog — a genuine back-and-forth conversation — between the user and the system.</p><p>Before we write a single line of code, you need to understand three building blocks. Everything else is built on top of these three things.</p><p>The first is the Screen — also called a Dynpro (Dynamic Program).</p><p>The second is the PBO — Process Before Output.</p><p>The third is the PAI — Process After Input.</p><p>Let me explain each one clearly.</p><p>A Screen in Module Pool is not just a visual thing. It is a living object. It has a number (like 100, 200, 300). It has fields connected to ABAP variables. It has a flow logic — a set of instructions that runs automatically.</p><p>Every time a screen is about to be shown to the user, SAP runs the PBO — Process Before Output. This is your chance to prepare the screen. Fill in default values. Set field visibility. Load dropdown options. Think of PBO as the waiter setting the table before you sit down.</p><p>Every time the user fills something and presses Enter or a button, SAP runs the PAI — Process After Input. This is your chance to read what the user typed, validate it, process it, and decide what happens next. Think of PAI as the waiter coming back to take your order and checking if what you asked for is actually on the menu.</p><p>These two events — PBO and PAI — repeat in a loop for every single screen. Show screen → PBO runs → user acts → PAI runs → show next screen → PBO runs → and so on.</p><p>That loop is the heartbeat of every Module Pool program.</p><p>Now let’s build something real.</p><p>We are going to build a Customer Maintenance transaction. The user can search for a customer, view their details on a screen, edit them, and save.</p><p>Three screens: Screen 100 — Search screen (enter customer number) Screen 200 — Detail screen (view and edit customer data) Screen 300 — Confirmation popup (confirm before saving)</p><p>Let’s start from the very beginning.</p><p>First, you create a Module Pool program in SE80 or SE38, but with program type M (Module Pool) instead of the usual executable type. The program starts with a declaration section — your global data.</p><pre>*&amp;---------------------------------------------------------------------*<br>*&amp; Module Pool: SAPMZCUSTOMER_MAINT<br>*&amp; Description: Customer Maintenance Dialog Program<br>*&amp;---------------------------------------------------------------------*<br>PROGRAM sapmzcustomer_maint.*----------------------------------------------------------------------*<br>* Global Data - available across ALL screens and modules<br>*----------------------------------------------------------------------*<br>DATA: gs_customer    TYPE kna1,          &quot; Customer master data<br>      gv_kunnr       TYPE kna1-kunnr,    &quot; Customer number input<br>      gv_mode        TYPE char1,         &quot; &#39;D&#39; Display, &#39;E&#39; Edit<br>      gv_save_flag   TYPE char1,         &quot; &#39;X&#39; = user confirmed save<br>      gv_message     TYPE string,        &quot; Message to show user<br>      ok_code        TYPE sy-ucomm.      &quot; Captures button/function code<br></pre><p>Notice that global data here means something different than in a Report. In Module Pool, global variables live as long as the transaction is open. Screen 100 can set a value. Screen 200 can read it. Screen 300 can change it. They all share the same memory — the same global space.</p><p>Now let’s look at Screen 100 — the Search Screen.</p><p>A screen in Module Pool has two parts. The visual layout (designed in Screen Painter, transaction SE51) and the flow logic (written in code). The flow logic is what connects the screen to your ABAP modules.</p><p>The flow logic of Screen 100 looks like this:</p><pre>PROCESS BEFORE OUTPUT.<br>  MODULE status_0100.          &quot; Set screen title, button states<br>PROCESS AFTER INPUT.<br>  MODULE cancel AT EXIT-COMMAND.   &quot; Handle Back/Cancel first<br>  MODULE validate_input_0100.      &quot; Validate what user typed<br>  MODULE process_input_0100.       &quot; Process the input, decide next screen</pre><p>That’s it. The flow logic is intentionally minimal. It just says which MODULE to call at each stage. The actual logic lives inside those modules in your ABAP program.</p><p>Now let’s write those modules.</p><pre>*======================================================================*<br>* SCREEN 100 - SEARCH SCREEN<br>*======================================================================*<br>*----------------------------------------------------------------------*<br>* PBO Module for Screen 100<br>* Runs before the screen is shown to the user<br>*----------------------------------------------------------------------*<br>MODULE status_0100 OUTPUT.<br>  &quot; Set the GUI status (which buttons appear in the toolbar)<br>  SET PF-STATUS &#39;STATUS_100&#39;.<br>  &quot; Set the title bar text<br>  SET TITLEBAR &#39;TITLE_100&#39;.<br>  &quot; Clear previous search results<br>  CLEAR gs_customer.<br>  &quot; Show a hint message if coming from a failed search<br>  IF gv_message IS NOT INITIAL.<br>    MESSAGE gv_message TYPE &#39;I&#39;.<br>    CLEAR gv_message.<br>  ENDIF.<br>ENDMODULE.<br>*----------------------------------------------------------------------*<br>* PAI Module - Handle Back and Cancel buttons<br>* AT EXIT-COMMAND means this runs BEFORE field validation<br>* Important for exit buttons - we don&#39;t want to validate before leaving<br>*----------------------------------------------------------------------*<br>MODULE cancel AT EXIT-COMMAND.<br>  CASE ok_code.<br>    WHEN &#39;BACK&#39; OR &#39;EXIT&#39; OR &#39;CANC&#39;.<br>      LEAVE PROGRAM.    &quot; Close the transaction completely<br>  ENDCASE.<br>ENDMODULE.<br>*----------------------------------------------------------------------*<br>* PAI Module - Validate user input on Screen 100<br>*----------------------------------------------------------------------*<br>MODULE validate_input_0100 INPUT.<br>  &quot; Check if customer number was entered<br>  IF gv_kunnr IS INITIAL.<br>    MESSAGE &#39;Please enter a customer number.&#39; TYPE &#39;E&#39;.<br>    &quot; TYPE &#39;E&#39; in Module Pool re-displays the SAME screen with the error<br>    &quot; The user cannot proceed until they fix it<br>  ENDIF.<br>  &quot; Check if it&#39;s numeric (customer numbers are numeric in standard SAP)<br>  IF gv_kunnr CO &#39;0123456789 &#39;.<br>    &quot; Valid - do nothing<br>  ELSE.<br>    MESSAGE &#39;Customer number must be numeric.&#39; TYPE &#39;E&#39;.<br>  ENDIF.<br>ENDMODULE.<br>*----------------------------------------------------------------------*<br>* PAI Module - Process the input and navigate to next screen<br>*----------------------------------------------------------------------*<br>MODULE process_input_0100 INPUT.<br>  &quot; Read the button the user pressed<br>  CASE ok_code.<br>    WHEN &#39;SEARCH&#39; OR &#39;ENTER&#39;.<br>      &quot; Fetch customer from database<br>      SELECT SINGLE * FROM kna1<br>        INTO @gs_customer<br>        WHERE kunnr = @gv_kunnr.<br>      IF sy-subrc = 0.<br>        &quot; Customer found - go to detail screen<br>        gv_mode = &#39;D&#39;.           &quot; Start in Display mode<br>        LEAVE TO SCREEN 200.     &quot; Navigate to Screen 200<br>      ELSE.<br>        &quot; Customer not found - stay on this screen with message<br>        MESSAGE |Customer { gv_kunnr } not found in the system.| TYPE &#39;E&#39;.<br>      ENDIF.<br>  ENDCASE.<br>  CLEAR ok_code.    &quot; Always clear ok_code after processing<br>ENDMODULE.</pre><p>Notice that LEAVE TO SCREEN 200 at the end. That is how navigation works in Module Pool. You don&#39;t call the next screen — you leave to it. SAP handles the transition, runs the PBO of Screen 200, shows it, and waits for the user.</p><p>Now Screen 200 — the Detail Screen.</p><p>This is where the customer data is displayed. The user can switch to Edit mode, change values, and trigger a save.</p><p>The screen has input fields bound directly to gs_customer-name1, gs_customer-ort01, gs_customer-land1 and so on. These bindings happen in Screen Painter — you draw the fields and link them to your ABAP structure.</p><p>The flow logic:</p><pre>PROCESS BEFORE OUTPUT.<br>  MODULE status_0200.<br>  MODULE fill_screen_0200.        &quot; Populate screen fields<br>PROCESS AFTER INPUT.<br>  MODULE cancel AT EXIT-COMMAND.<br>  MODULE validate_input_0200.<br>  MODULE process_input_0200.</pre><p>And the modules:</p><pre>*======================================================================*<br>* SCREEN 200 - CUSTOMER DETAIL SCREEN<br>*======================================================================*<br>*----------------------------------------------------------------------*<br>* PBO Module for Screen 200<br>*----------------------------------------------------------------------*<br>MODULE status_0200 OUTPUT.<br>  SET PF-STATUS &#39;STATUS_200&#39;.<br>  SET TITLEBAR &#39;TITLE_200&#39;.<br>  &quot; Change button states based on current mode<br>  IF gv_mode = &#39;D&#39;.<br>    &quot; Display mode - show Edit button, hide Save button<br>    SET PF-STATUS &#39;STATUS_200&#39;<br>      EXCLUDING &#39;SAVE&#39;.        &quot; Grey out Save button in display mode<br>  ELSEIF gv_mode = &#39;E&#39;.<br>    &quot; Edit mode - show Save button, hide Edit button<br>    SET PF-STATUS &#39;STATUS_200&#39;<br>      EXCLUDING &#39;EDIT&#39;.<br>  ENDIF.<br>ENDMODULE.<br>*----------------------------------------------------------------------*<br>* PBO Module - Fill the screen fields with data<br>*----------------------------------------------------------------------*<br>MODULE fill_screen_0200 OUTPUT.<br>  &quot; Screen fields are automatically filled because they are<br>  &quot; bound to gs_customer in Screen Painter<br>  &quot; But here we can do extra preparation<br>  &quot; Convert country code to description for display<br>  &quot; (In a real scenario you&#39;d call a FM to get the description)<br>  &quot; Set field editability based on mode<br>  IF gv_mode = &#39;D&#39;.<br>    LOOP AT SCREEN.<br>      &quot; Make all fields read-only in display mode<br>      screen-input = 0.<br>      MODIFY SCREEN.<br>    ENDLOOP.<br>  ELSEIF gv_mode = &#39;E&#39;.<br>    LOOP AT SCREEN.<br>      &quot; Allow editing of specific fields only (not the key field)<br>      IF screen-name = &#39;GS_CUSTOMER-KUNNR&#39;.<br>        screen-input = 0.    &quot; Customer number is never editable<br>      ELSE.<br>        screen-input = 1.    &quot; Everything else is editable<br>      ENDIF.<br>      MODIFY SCREEN.<br>    ENDLOOP.<br>  ENDIF.<br>ENDMODULE.<br>*----------------------------------------------------------------------*<br>* PAI Module - Validate Screen 200 inputs<br>*----------------------------------------------------------------------*<br>MODULE validate_input_0200 INPUT.<br>  &quot; Only validate if in Edit mode and user is saving<br>  CHECK gv_mode = &#39;E&#39;.<br>  CHECK ok_code = &#39;SAVE&#39;.<br>  &quot; Name is mandatory<br>  IF gs_customer-name1 IS INITIAL.<br>    MESSAGE &#39;Customer name cannot be empty.&#39; TYPE &#39;E&#39;.<br>  ENDIF.<br>  &quot; Country must be 2 characters<br>  IF STRLEN( gs_customer-land1 ) &lt;&gt; 2.<br>    MESSAGE &#39;Country code must be exactly 2 characters.&#39; TYPE &#39;E&#39;.<br>  ENDIF.<br>ENDMODULE.<br>*----------------------------------------------------------------------*<br>* PAI Module - Process Screen 200 actions<br>*----------------------------------------------------------------------*<br>MODULE process_input_0200 INPUT.<br>  CASE ok_code.<br>    WHEN &#39;EDIT&#39;.<br>      &quot; Switch from Display to Edit mode<br>      gv_mode = &#39;E&#39;.<br>      &quot; Stay on same screen - just re-run PBO with new mode<br>      LEAVE TO SCREEN 200.<br>    WHEN &#39;SAVE&#39;.<br>      &quot; Go to confirmation popup before saving<br>      LEAVE TO SCREEN 300.<br>    WHEN &#39;BACK&#39;.<br>      &quot; Go back to Search screen<br>      CLEAR: gs_customer, gv_mode.<br>      LEAVE TO SCREEN 100.<br>    WHEN &#39;NEW&#39;.<br>      &quot; Clear everything and go back to search for another customer<br>      CLEAR: gs_customer, gv_kunnr, gv_mode.<br>      LEAVE TO SCREEN 100.<br>  ENDCASE.<br>  CLEAR ok_code.<br>ENDMODULE.</pre><p>Something important to notice here. LOOP AT SCREEN — that is how you control individual field behaviour at runtime. Every field on the screen has properties: screen-input (0=read only, 1=editable), screen-visible (0=hidden, 1=visible), screen-required (0=optional, 1=mandatory). You loop through all screen elements, check the name, change the property, and call MODIFY SCREEN. This is one of the most powerful things Module Pool can do that a Report Program never can.</p><p>Now Screen 300 — the Confirmation Popup.</p><p>This is a small modal screen, not a full page. In Screen Painter you set its type to Modal Dialog Box and give it a small size. It shows the user “Are you sure you want to save?” with Yes and No buttons.</p><pre>PROCESS BEFORE OUTPUT.<br>  MODULE status_0300.<br>PROCESS AFTER INPUT.<br>  MODULE process_input_0300.<br>*======================================================================*<br>* SCREEN 300 - CONFIRMATION POPUP<br>*======================================================================*<br>MODULE status_0300 OUTPUT.<br>  SET PF-STATUS &#39;STATUS_300&#39;.<br>  SET TITLEBAR &#39;TITLE_300&#39;.<br>ENDMODULE.<br>MODULE process_input_0300 INPUT.<br>  CASE ok_code.<br>    WHEN &#39;YES&#39;.<br>      &quot; User confirmed - perform the actual database update<br>      PERFORM save_customer_data.<br>      IF sy-subrc = 0.<br>        gv_message = |Customer { gs_customer-kunnr } saved successfully.|.<br>        &quot; Close popup and go back to search screen<br>        LEAVE TO SCREEN 100.<br>      ELSE.<br>        MESSAGE &#39;Error saving customer. Please try again.&#39; TYPE &#39;E&#39;.<br>      ENDIF.<br>    WHEN &#39;NO&#39;.<br>      &quot; User cancelled - go back to detail screen without saving<br>      LEAVE TO SCREEN 200.<br>  ENDCASE.<br>  CLEAR ok_code.<br>ENDMODULE.</pre><p>The actual save logic lives in a subroutine called from the module. This keeps your modules clean and focused on navigation — not on business logic.</p><pre>*----------------------------------------------------------------------*<br>* FORM - Save Customer Data to Database<br>*----------------------------------------------------------------------*<br>FORM save_customer_data.<br>  &quot; Update the customer record in the database<br>  UPDATE kna1 FROM gs_customer.<br>  IF sy-subrc = 0.<br>    &quot; Commit the change - make it permanent<br>    COMMIT WORK AND WAIT.<br>    sy-subrc = 0.<br>  ELSE.<br>    &quot; Roll back - undo any partial changes<br>    ROLLBACK WORK.<br>    sy-subrc = 4.<br>  ENDIF.<br>ENDFORM.</pre><p>COMMIT WORK AND WAIT is critical. In Module Pool, database changes are not permanent until you commit. If something fails midway, ROLLBACK WORK undoes everything. This is how SAP ensures data consistency across complex multi-step transactions.</p><p>Now let’s talk about something that confuses every beginner — the difference between screen-level field validation and module-level validation.</p><p>In Module Pool, field validation can happen at two levels.</p><p>The first level is in the flow logic itself, using the FIELD statement:</p><pre>PROCESS AFTER INPUT.<br>  FIELD gv_kunnr MODULE check_kunnr ON REQUEST.<br>  &quot; ON REQUEST means: only call this module if the user<br>  &quot; actually changed this field. Smart — avoids unnecessary calls.</pre><p>The second level is inside your module using normal IF checks, as we did above.</p><p>The rule of thumb: use FIELD for single-field validation. Use module-level checks for cross-field validation (where the validity of one field depends on another).</p><p>Here is the complete navigation flow of our program, laid out plainly:</p><pre>&quot; Transaction starts → Screen 100 shown<br>&quot;<br>&quot; User enters customer number and presses Search<br>&quot;   → PAI of Screen 100 runs<br>&quot;   → Customer fetched from DB<br>&quot;   → LEAVE TO SCREEN 200<br>&quot;<br>&quot; Screen 200 shown in Display mode<br>&quot; User presses Edit<br>&quot;   → PAI runs, mode changes to &#39;E&#39;<br>&quot;   → LEAVE TO SCREEN 200 (same screen, now editable)<br>&quot;<br>&quot; User edits data and presses Save<br>&quot;   → PAI runs, validation passes<br>&quot;   → LEAVE TO SCREEN 300<br>&quot;<br>&quot; Confirmation popup appears<br>&quot; User presses Yes<br>&quot;   → Data saved to DB<br>&quot;   → COMMIT WORK<br>&quot;   → LEAVE TO SCREEN 100<br>&quot;<br>&quot; User is back at search screen with success message</pre><p>Now let me address the question every fresher asks at this point.</p><p>“This seems much more complicated than a Report Program. Why would anyone use it?”</p><p>Because some problems require a conversation.</p><p>A Report Program is perfect for: give me the data, show it to me, I look at it, done.</p><p>A Module Pool is necessary for: I want to create something, step by step, across multiple screens, with the system validating and guiding me at each step, with the ability to go back and change earlier inputs before I commit.</p><p>Every standard SAP transaction you have ever used — VA01, ME21N, FB50, MM01 — every single one of them is a Module Pool program. The entire SAP user interface for business transactions is built on this framework.</p><p>When you build custom transactions for clients — custom goods issue screens, custom approval workflows, custom data entry interfaces — Module Pool is the tool.</p><p>Let’s also talk about the GUI Status — because it controls what buttons appear and what happens when you press them.</p><p>You create a GUI Status in SE41 (Menu Painter). You define function codes — short codes like ‘SAVE’, ‘BACK’, ‘EDIT’. You assign them to toolbar buttons, menu items, or keyboard shortcuts. When the user presses that button, SAP puts the function code into ok_code. Your PAI module reads ok_code and decides what to do.</p><p>This is why you always see CLEAR ok_code at the end of every PAI module. If you don&#39;t clear it, the old function code stays there and gets processed again in the next PAI cycle. That causes ghost clicks — bugs that are extremely difficult to trace.</p><pre>&quot; This is the first thing you declare in a Module Pool<br>DATA ok_code TYPE sy-ucomm.<br>&quot; This is what gets it from the screen into your variable<br>&quot; (set in Screen Painter - the OK_CODE field on the screen)<br>&quot; And this is the last thing you do in every PAI module<br>CLEAR ok_code.   &quot; Always. Without exception.</pre><p>One more concept that separates beginners from experienced developers — the difference between LEAVE TO SCREEN and CALL SCREEN.</p><pre>&quot; LEAVE TO SCREEN 200<br>&quot; Replaces the current screen with Screen 200<br>&quot; Pressing Back from Screen 200 exits the transaction<br>&quot; The call stack is replaced — no return point<br>&quot; CALL SCREEN 300<br>&quot; Opens Screen 300 ON TOP of the current screen (like a layer)<br>&quot; Pressing Back from Screen 300 returns to where you called it from<br>&quot; The call stack is preserved - there is a return point<br>&quot; For popups and modal dialogs - use CALL SCREEN<br>&quot; For main navigation between full screens - use LEAVE TO SCREEN</pre><p>This distinction matters enormously. Use the wrong one and your Back button either does nothing, exits the transaction completely, or skips screens the user expected to return to. Users notice these things immediately.</p><p>Here is the summary of everything, told simply.</p><p>A Module Pool program is a transaction. It holds a conversation with the user across multiple screens. Each screen has a PBO — which runs before showing the screen — and a PAI — which runs after the user acts. Your ABAP modules sit inside these events and control navigation, validation, field behaviour, and data processing. Screens are numbered. You navigate between them using LEAVE TO SCREEN or CALL SCREEN. Every button press puts a function code into ok_code, which you read in PAI and act on. Data lives in global variables shared across all screens. Changes are committed or rolled back in a single transaction unit.</p><p>That is the whole framework.</p><p>Once you understand that loop — PBO → show screen → user acts → PAI → navigate — you understand Module Pool. Everything else is just detail built on top of that loop.</p><p>The honest truth about Module Pool in modern SAP?</p><p>It is still running. Millions of lines of it, in systems all over the world, processing real business transactions every day.</p><p>But new development is moving to SAP Fiori and the ABAP RESTful Application Programming Model — RAP. These are web-based, built on OOP classes and methods, running in a browser.</p><p>Should you learn Module Pool as a fresher in 2024?</p><p>Yes. Because you will maintain it. Because standard SAP is full of it. Because understanding how a screen talks to a program is foundational knowledge — even if the technology changes.</p><p>And because the day your senior points at a transaction, says “something is broken in the PAI of screen 200,” and everyone else looks confused — you want to be the one who already knows what that means.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b7d00f6aad9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>