<?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 Merve Altug on Medium]]></title>
        <description><![CDATA[Stories by Merve Altug on Medium]]></description>
        <link>https://medium.com/@mervealtug?source=rss-97a22bb692a5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5qVM10XT4lUSsh3r</url>
            <title>Stories by Merve Altug on Medium</title>
            <link>https://medium.com/@mervealtug?source=rss-97a22bb692a5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 11:30:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mervealtug/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[Part 2: Step-by-Step Guide: Configuring DBCO and Writing ABAP ADBC Code]]></title>
            <link>https://mervealtug.medium.com/part-2-step-by-step-guide-configuring-dbco-and-writing-abap-adbc-code-f6b2777537d7?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6b2777537d7</guid>
            <category><![CDATA[sap-dbco]]></category>
            <category><![CDATA[dbco]]></category>
            <category><![CDATA[sap]]></category>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Thu, 03 Sep 2026 18:50:31 GMT</pubDate>
            <atom:updated>2026-09-03T18:50:31.660Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Subtitle:</strong> <em>A practical guide to configuring secondary database connections in SAP and executing Native SQL via ABAP ADBC.</em></p><p>In <a href="https://mervealtug.medium.com/part-1-strategic-guide-connecting-sap-to-external-databases-via-dbco-7a15a8a946f7?postPublishedType=initial"><strong>Part 1: Understanding SAP DBCO Architecture</strong>,</a> we covered the fundamental concepts, architecture, and use cases for using DBCO to connect SAP systems directly to external secondary databases (like MS SQL, Oracle, or PostgreSQL).</p><p>Now, let’s put theory into practice. In this guide, we will configure a new database connection in transaction DBCO, verify it using standard SAP test tools, and write a modern ABAP program using <strong>ADBC (ABAP Database Connectivity)</strong> to read dynamic data.</p><h3>Step 1: Setting Up the Connection in DBCO</h3><ol><li>Open transaction <strong>DBCO</strong> in your SAP GUI.</li><li>Click <strong>Display -&gt; Change</strong> and hit <strong>New Entries</strong>.</li><li>Fill in the connection configuration fields:</li></ol><ul><li><strong>Db Connection:</strong> Unique identifier for your connection. <em>(Example: </em><em>EXT_SQL_DB)</em></li><li><strong>DBMS:</strong> Target Database Management System type. <em>(Example: </em><em>MSS for MS SQL Server)</em></li><li><strong>User Name:</strong> DB user with permissions on the target database. <em>(Example: </em><em>sap_read_user)</em></li><li><strong>Password:</strong> Password for the DB user. <em>(Example: </em><em>********)</em></li><li><strong>Connection Info:</strong> DB-specific driver connection string with Host, Port, and DB Name. <em>(Example: </em><em>MSSQL_SERVER=192.168.1.100 MSSQL_DBNAME=Logistics)</em></li><li><strong>Permanent:</strong> Keep connection open across work processes. <em>(Example: Check </em><em>[X] for high-frequency connections)</em></li></ul><p>Click <strong>Save</strong>.</p><h3>Step 2: Testing the Connection with ADBC_TEST_CONNECTION</h3><p>Before writing ABAP code, verify that the SAP Application Server can successfully reach the target database:</p><ol><li>Open <strong>SE38</strong> or <strong>SA38</strong>.</li><li>Run program <strong>ADBC_TEST_CONNECTION</strong>.</li><li>Enter your connection name (EXT_SQL_DB) and execute (F8).</li></ol><p>If network connectivity, credentials, and DBSL drivers are correctly configured, you will receive a green success log confirming the connection was successfully established and disconnected.</p><h3>Step 3: Writing Modern ABAP Code Using ADBC (CL_SQL_STATEMENT)</h3><p>While classic EXEC SQL ... ENDEXEC blocks work, the <strong>ADBC (ABAP Database Connectivity)</strong> object-oriented framework is the recommended standard. It provides proper exception handling, dynamic parameter binding, and cleaner code structure.</p><p>Here is a complete template for reading data from an external table using ADBC:</p><p>REPORT z_read_external_db.</p><p>DATA: lo_conn TYPE REF TO cl_sql_connection,<br> lo_stmt TYPE REF TO cl_sql_statement,<br> lo_result TYPE REF TO cl_sql_result_set,<br> lv_sql_stmt TYPE string,<br> lx_sql_err TYPE REF TO cx_sql_exception.</p><p>“ Structure matching target external table select fields<br>TYPES: BEGIN OF ty_external_customer,<br> customer_id TYPE char10,<br> comp_name TYPE char50,<br> city TYPE char30,<br> END OF ty_external_customer.</p><p>DATA: ls_customer TYPE ty_external_customer,<br> lt_customers TYPE TABLE OF ty_external_customer,<br> dref TYPE REF TO data.</p><p>TRY.<br> “ 1. Establish connection configured in DBCO<br> lo_conn = cl_sql_connection=&gt;get_connection( ‘EXT_SQL_DB’ ).<br> lo_stmt = lo_conn-&gt;create_statement( ).</p><p>“ 2. Construct Native SQL Query<br> lv_sql_stmt = ‘SELECT CUSTOMER_ID, COMP_NAME, CITY FROM CUSTOMERS WHERE STATUS = ‘’A’’’.</p><p>“ 3. Execute Query<br> lo_result = lo_stmt-&gt;execute_query( lv_sql_stmt ).</p><p>“ 4. Bind output internal table reference to result set<br> GET REFERENCE OF lt_customers INTO dref.<br> lo_result-&gt;set_param_table( dref ).</p><p>“ 5. Fetch data rows<br> lo_result-&gt;next_package( ).<br> lo_result-&gt;close( ).</p><p>“ 6. Close Connection<br> lo_conn-&gt;close( ).</p><p>“ Display results<br> cl_demo_output=&gt;display( lt_customers ).</p><p>CATCH cx_sql_exception INTO lx_sql_err.<br> “ Always handle SQL exceptions gracefully<br> MESSAGE lx_sql_err-&gt;get_text( ) TYPE ‘E’.<br>ENDTRY.</p><h3>Best Practices &amp; Troubleshooting Checklist</h3><ul><li><strong>Close Resources Explicitly:</strong> Always ensure .close() is called on result sets and connection objects inside TRY...CATCH blocks to prevent resource leaks on the external database server.</li><li><strong>Monitor with ST04 / SM21:</strong> If connections fail, check transaction ST04 (Database Performance Monitor) or SM21 (System Log) to inspect kernel DBSL error logs.</li><li><strong>Principle of Least Privilege:</strong> Ensure the database user defined in DBCO only has permissions strictly necessary for the operation (SELECT only if reading data).</li></ul><h3>Wrap Up</h3><p>Using DBCO alongside ADBC provides ABAP developers with a fast, efficient, and robust mechanism to query non-SAP databases directly.</p><p>If you missed the theoretical overview and architecture breakdown, make sure to read <a href="https://mervealtug.medium.com/part-1-strategic-guide-connecting-sap-to-external-databases-via-dbco-7a15a8a946f7?postPublishedType=initial"><strong>Part 1: Strategic Guide: Connecting SAP to External Databases via DBCO</strong>.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6b2777537d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1: Strategic Guide: Connecting SAP to External Databases via DBCO]]></title>
            <link>https://mervealtug.medium.com/part-1-strategic-guide-connecting-sap-to-external-databases-via-dbco-7a15a8a946f7?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a15a8a946f7</guid>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[sap-training]]></category>
            <category><![CDATA[dbco]]></category>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 17:31:36 GMT</pubDate>
            <atom:updated>2026-09-02T17:41:13.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVjz9L51ySrqgaf8fmIu0A.png" /></figure><p><strong>Subtitle:</strong> <em>Understand how SAP ABAP communicates directly with secondary databases without intermediate middleware.</em></p><p>In modern enterprise architectures, SAP is rarely an isolated island. While most transactional processes live inside SAP S/4HANA or ERP systems, core business data often resides across external databases — such as legacy MS SQL servers, enterprise PostgreSQL instances, or Oracle data warehouses.</p><p>When integrating SAP with these external systems, developers often resort to REST APIs, RFCs, or integration platforms (like SAP Integration Suite / PO). However, when high-speed, direct read/write operations are required, <strong>DBCO (Database Connection Maintenance)</strong> is the native, lightweight SAP solution.</p><p>In this first part of our two-part series, we will explore the concept of secondary database connections in SAP, how DBCO works under the hood, and when you should choose it over standard APIs.</p><h3>What is T-Code DBCO?</h3><p>DBCO is a standard SAP NetWeaver transaction used to configure and manage <strong>Secondary Database Connections</strong>.</p><p>Normally, the ABAP Work Process communicates exclusively with the <strong>Primary Database</strong> (e.g., SAP HANA) using Open SQL / ABAP SQL. DBCO acts as a gateway configuration that allows the SAP kernel to open a secondary channel to an external non-SAP database directly from the Application Server layer.</p><h3>How DBCO Works Under the Hood</h3><p>When you execute an ABAP program that calls an external database, the interaction follows this internal architecture:</p><ol><li><strong>DBSL (Database Shared Library):</strong> SAP uses specific database client drivers (DBSL) installed on the SAP application server kernel to speak the target database’s native language.</li><li><strong>Connection Parameters:</strong> DBCO stores the encrypted credentials, connection string, host IP, and port inside SAP control tables (such as DBCON).</li><li><strong>Native SQL / ADBC Engine:</strong> The ABAP runtime bypasses the Open SQL database interface and passes raw <strong>Native SQL</strong> commands directly to the secondary database using the defined DBCO connection handle.</li></ol><h3>When Should You Use DBCO?</h3><p>DBCO is ideal for specific integration scenarios:</p><ul><li><strong>Direct Legacy Data Migration:</strong> Extraction of bulk historical data directly from non-SAP database tables without building export scripts.</li><li><strong>Side-by-Side Operational Integration:</strong> Reading real-time data from external Manufacturing Execution Systems (MES), Warehouse Systems (WMS), or IoT database stores.</li><li><strong>Cross-Database Reporting:</strong> Fetching targeted datasets from secondary analytical DBs directly into standard ABAP reports or ALVs.</li></ul><h3>Advantages vs. Limitations</h3><p>ADVANTAGES<br>• High Performance: No API protocol overhead (HTTP/REST serialization).<br>• No Additional Middleware: Direct connection from SAP App Server to target DB.<br>• Native ABAP Integration: Native OO classes (CL_SQL_STATEMENT) support dynamic SQL execution.</p><p>LIMITATIONS<br>• Database Dependent: Queries must be written in Native SQL, which varies per DB type.<br>• Security Management: Requires strict database user privilege control on the target system.<br>• Kernel Dependency: Target database client drivers (DBSL) must be present in the SAP kernel.</p><h3>What’s Next?</h3><p>Now that we understand the architecture and use cases behind secondary database connections in SAP, it’s time to build one.</p><p>👉 <strong>In </strong><a href="https://www.google.com/search?q=%23"><strong>Part 2: Step-by-Step Guide: Configuring DBCO and Writing ABAP ADBC Code</strong></a><strong> (Link to Part 2),</strong> we walk through configuring a DBCO connection step-by-step, running diagnostic tests with standard SAP tools, and writing modern, object-oriented ABAP code using ADBC.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a15a8a946f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Excel Automation in ABAP using OLE2: A Step-by-Step Guide]]></title>
            <link>https://mervealtug.medium.com/mastering-excel-automation-in-abap-using-ole2-a-step-by-step-guide-6988b67bccb9?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6988b67bccb9</guid>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 17:07:29 GMT</pubDate>
            <atom:updated>2026-09-02T17:39:06.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*T--2UKzGN_mNE1n6tqtW-Q.jpeg" /></figure><p>Exporting data to Excel is a core requirement for almost every SAP ABAP developer. While basic tools like GUI_DOWNLOAD or ALV exports handle simple tabular data, they often fall short when business logic demands custom formatting, cell merging, styled headers, or precise sheet layouts.</p><p>This is where <strong>OLE2 Automation</strong> comes in. By utilizing OLE (Object Linking and Embedding), your ABAP program can directly interface with Microsoft Excel, giving you granular control over formatting and logic.</p><p>In this post, we will break down an ABAP implementation of Excel automation via OLE2 and cover formatting techniques like cell merging, custom borders, column resizing, and background colors.</p><h3>1. Initializing OLE Objects and Creating the Excel Application</h3><p>To interact with Excel via OLE, you first need to declare variables of type OLE2_OBJECT using the standard ole2 type-pool.</p><p>TYPE-POOLS: ole2.</p><p>DATA: gh_excel TYPE ole2_object,<br> gh_mapl TYPE ole2_object,<br> gh_map TYPE ole2_object,<br> sheet TYPE ole2_object.</p><p>“ Start Excel Application<br>CREATE OBJECT gh_excel ‘EXCEL.APPLICATION’.</p><p>“ Keep Excel hidden in the background during processing<br>SET PROPERTY OF gh_excel ‘Visible’ = 0.</p><p>“ Open Workbooks collection and add a new workbook<br>CALL METHOD OF gh_excel ‘Workbooks’ = gh_mapl.<br>CALL METHOD OF gh_mapl ‘Add’ = gh_map.</p><p>“ Activate the first Worksheet and set its name<br>CALL METHOD OF gh_excel ‘Worksheets’ = sheet EXPORTING #1 = 1.<br>CALL METHOD OF sheet ‘Activate’.<br>SET PROPERTY OF sheet ‘Name’ = ‘Monthly_Bill’.</p><p><strong><em>Tip:</em></strong><em> Setting </em><em>Visible = 0 keeps the Excel instance processing in the background, significantly improving performance and preventing UI flicker for the user.</em></p><h3>2. Populate Data with Custom Styling</h3><p>Instead of repeatedly writing boilerplate code to write values and format individual cells, encapsulate that logic into a reusable FORM routine:</p><p>PERFORM fill_cell USING 1 7 1 ‘MONTHLY_BILL’.<br>PERFORM fill_cell USING 2 1 1 ‘ABC’.</p><p>FORM fill_cell USING i j bold val.<br> DATA: gh_zl TYPE ole2_object,<br> gh_f TYPE ole2_object.</p><p>CALL METHOD OF gh_excel ‘Cells’ = gh_zl NO FLUSH EXPORTING #1 = i #2 = j.<br> SET PROPERTY OF gh_zl ‘Value’ = val NO FLUSH.<br> <br> “ Format font to bold if requested<br> GET PROPERTY OF gh_zl ‘Font’ = gh_f NO FLUSH.<br> SET PROPERTY OF gh_f ‘Bold’ = bold NO FLUSH.<br>ENDFORM.</p><p>Using the NO FLUSH parameter minimizes communication trips between SAP and the frontend client, dramatically boosting execution speed for large datasets.</p><h3>3. Formatting Techniques: Merging, Borders, and Custom Colors</h3><h3>Merging Cells</h3><p>Merging cells is useful for document titles or wide header descriptions:</p><p>ABAP</p><p>DATA: gh_range TYPE ole2_object.</p><p>CALL METHOD OF gh_excel ‘Range’ = gh_range NO FLUSH<br> EXPORTING #1 = ‘A1’<br> #2 = ‘E1’.</p><p>CALL METHOD OF gh_range ‘Select’ NO FLUSH.<br>SET PROPERTY OF gh_range ‘Merge’ = 1 NO FLUSH.</p><h3>Setting Column Widths &amp; AutoFit</h3><p>Ensure your contents fit cleanly without text clipping:</p><p>DATA: column TYPE ole2_object.</p><p>“ AutoFit all columns across the worksheet<br>CALL METHOD OF gh_excel ‘Columns’ = column.<br>CALL METHOD OF column ‘AutoFit’.</p><p>“ Or set a specific column width manually<br>DATA: e_cell TYPE ole2_object.<br>CALL METHOD OF gh_excel ‘Cells’ = e_cell EXPORTING #1 = 1 #2 = 3.<br>SET PROPERTY OF e_cell ‘ColumnWidth’ = 20.</p><h3>Drawing Custom Borders</h3><p>Borders can be set per edge by using Excel border position indices:</p><p>DATA: gh_borders TYPE ole2_object.</p><p>CALL METHOD OF gh_excel ‘Range’ = gh_range NO FLUSH<br> EXPORTING #1 = ‘A1’<br> #2 = ‘M20’.</p><p>“ Position 7 = Left, 8 = Top, 9 = Bottom, 10 = Right, 11 = Inside Vertical, 12 = Inside Horizontal<br>CALL METHOD OF gh_range ‘Borders’ = gh_borders NO FLUSH EXPORTING #1 = 7.<br>SET PROPERTY OF gh_borders ‘LineStyle’ = 1.</p><h3>Setting Cell Background Color</h3><p>Highlight header rows or summary fields using Excel color indices:</p><p>DATA: e_color TYPE ole2_object.</p><p>CALL METHOD OF gh_excel ‘Cells’ = e_cell EXPORTING #1 = 1 #2 = 3.<br>GET PROPERTY OF e_cell ‘Interior’ = e_color.<br>SET PROPERTY OF e_color ‘ColorIndex’ = 35. “ Soft Green</p><h3>4. Saving the File and Cleaning Up Memory</h3><p>Always release OLE objects from memory to prevent orphan processes (excel.exe) from accumulating on the user&#39;s local machine:</p><p>“ Save workbook to destination<br>CALL METHOD OF sheet ‘SaveAs’ EXPORTING #1 = ‘C:\temp\monthly_bill.xlsx’ #2 = 1.</p><p>“ Close Excel &amp; Cleanup Handles<br>CALL METHOD OF gh_excel ‘Quit’.<br>FREE OBJECT: column, gh_range, gh_excel, sheet.</p><h3>Key Takeaways</h3><ul><li><strong>Use </strong><strong>NO FLUSH</strong>: Crucial for performance when building large dynamic spreadsheets.</li><li><strong>Clean Up Memory</strong>: Always call FREE OBJECT on all OLE2_OBJECT handle variables when done.</li><li><strong>Background Execution</strong>: Set Excel to invisible (Visible = 0) until generation is finished.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6988b67bccb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create Cost Center via SAP BAPI]]></title>
            <link>https://mervealtug.medium.com/how-to-create-cost-center-via-sap-bapi-f73d09b7237e?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f73d09b7237e</guid>
            <category><![CDATA[sap-abap]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[abap]]></category>
            <category><![CDATA[bapi]]></category>
            <category><![CDATA[cost-center]]></category>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 06:24:22 GMT</pubDate>
            <atom:updated>2025-11-10T06:24:22.861Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we’ll look at how to create a <strong>Cost Center automatically</strong> using the <strong>SAP BAPI</strong>.</p><p>A cost center is a department or unit, such as Sales, IT, or Finance, used to assign the costs of business activities to a budget. These centers are often arranged in a hierarchy, allowing one manager or department to oversee several cost centers.</p><p>Cost centers help analyze spending in sourcing documents. You can create reports to track what happens in each cost center, and SAP Sourcing supports hierarchical structures.</p><p>Usually, cost centers come from the company’s ERP or financial systems, but you can also add or edit them manually. They are optional and can be customized as needed.</p><h3>1️⃣ Manual Creation</h3><p>To create a cost center manually, use transaction code <strong>KS01</strong>.</p><h3>2️⃣ Automatic Creation via BAPI</h3><p>You can use the function module BAPI_COSTCENTER_CREATEMULTIPLE to create cost centers automatically.</p><p>“BAPI_COSTCENTER_CREATEMULTIPLE” is used for create cost center,but how should BAPI parameters be filled.</p><p>BAPI Filled example;</p><p>data: lt_my TYPE TABLE OF bapi0012_ccinputlist,<br> ls_my TYPE bapi0012_ccinputlist,<br> lt_return TYPE TABLE OF bapiret2 WITH HEADER LINE,<br> lv_controlarea TYPE bapi0012_gen-co_area,<br> ls_lang TYPE bapi0015_10.</p><p>CALL FUNCTION ‘BAPI_COSTCENTER_CREATEMULTIPLE’<br> EXPORTING<br> controllingarea = lv_controlarea<br> language = ls_lang<br> TABLES<br> costcenterlist = lt_my<br> return = lt_return.</p><h3>3️⃣ Mapping BAPI Parameters</h3><p>You can refer to <strong>transaction KS01</strong> to identify which fields correspond to the BAPI parameters.</p><p>Enter KS01 transaction code;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*-hZoeT4Ge1kQjQDUQ3Qxww.png" /></figure><p>the variable that you enter above as Controlling area, should be filled “controllingarea” variable at BAPI (lv_controlarea).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*Gi0O5x4RsVKezsZ3L0ZJLg.png" /></figure><p>Cost center field should be filled in; lt_my-costcenter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*xPmB_JOCnlrsVSKkk84oYQ.png" /></figure><p>Valid From field should be filles in; lt_my-valid_from</p><p>When enter on KS01 screen, you can see obligatory field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*9QD7bj-U3_KDK5mvIdcEtg.png" /></figure><p>Name refers to; lt_my-name</p><p>Description refers to; lt_my-descript</p><p>User Responsible refers to; lt_my-PERSON_IN_CHARGE_USER</p><p>Person Responsible field refers to;lt_my-PERSON_IN_CHARGE</p><p>Department field refers to; lt_my-DEPARTMENT</p><p>Cost center Category refers to; lt_my-COSTCENTER_TYPE</p><p>Hierarchy Ares refers to; lt_my-COSTCTR_HIER_GRP</p><p>Company Code refers to; lt_my-COMP_CODE</p><p>Business Area refers to; lt_my-BUS_AREA</p><p>Functional Area refers to; lt_my-FUNC_AREA</p><p>Currency refers to; lt_my-CURRENCY</p><p>On control Tab;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Jm__2sRv6EOutbNOJdmRcg.png" /></figure><p>Actual Primary Costs tick refers to: lt_my-LOCK_IND_ACTUAL_PRIMARY_COSTS</p><p>PLAN PRIMARY COSTS tick refers to: lt_my-LOCK_IND_PLAN_PRIMARY_COSTS</p><p>Act. Secondary costs tick refers to: lt_my-LOCK_IND_ACT_SECONDARY_COSTS</p><p>Plan secondary costs tick refers to: lt_my-LOCK_IND_PLAN_SECONDARY_COSTS</p><p>Actual revenues tick refers to: lt_my-LOCK_IND_ACTUAL_REVENUES</p><p>Plan revenues tick refers to:lt_my-LOCK_IND_PLAN_REVENUES</p><p>After filling all the required fields and appending your entry to the table</p><p>lt_my, call the BAPI “BAPI_COSTCENTER_CREATEMULTIPLE.” <br> If sy-subrc eq 0, you must <strong>commit</strong> the transaction:</p><p>“CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT’.</p><p>This will save the new Cost Center in the system.</p><p>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f73d09b7237e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the difference between ArrayLists and Vectors]]></title>
            <link>https://mervealtug.medium.com/what-is-the-difference-between-arraylists-and-vectors-27c250fd30d4?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/27c250fd30d4</guid>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Tue, 22 Oct 2024 15:04:49 GMT</pubDate>
            <atom:updated>2024-10-22T15:04:49.004Z</atom:updated>
            <content:encoded><![CDATA[<p>In this topic, we will be focused on the key differences between “ArrayLists” and “Vectors”. But to do so, understanding these two terms individually is very important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*DhCZWuZtM8n5jdGNGcvn7A.png" /></figure><p>To analyze each term seperately, lets begin with arraylists.</p><p>Arraylists are simply resizable array implementations of the “list” interface. So, the list is the abstract part and the arraylist is the concrete part, could have be said. As mentioned above, the biggest advantage of arraylists compared to arrays is that arraylists are resizable.Which means the developers can fill them up anytime they want or need while the arrays are in need of defining the size at first implementation. Being able to put elements as many as the developers need provides flexibility for code. And the final point of arraylists is that they maintain the insertion order which can be explained as the order of the object in which they are inserted.</p><p>So, What are vectors in Java? The vector class is like an array, which developer can access the elements with an integer index. But the vectors have a big difference than arrays, they are growable and shrinkable whenever it is needed. Vectors try to optimize the storage management and thus, they use “capacity” and “capacityIncrement” keywords. Capacity is usually the same size with the vector or a little larger. When a new element is added to a vector, its storage increases as the size of capacityIncrement and that is how a vector optimizes the storage. In such big projects, storage management is a very decent point. Here is two syntax-related examples of arraylists and vectors down below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*ECuSxi_hBj6bAVBIUSc3Pg.png" /></figure><p>while defining the arraylist, the developer did not have to declare a static size of elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*mfj6oNzxxwG9lzoyw68HdQ.png" /></figure><p>As seen in the second example, while defining a vector, there is no need to declare a size as declaring an array either just like the arraylists.</p><p>So, what are their differences? The main difference is that vectors are synchronized and arraylists are not. Meaning of this is only one thread can call methods on a vector at the same time.</p><p>The second difference is that vectors increment their sizes by doubling the array size if the elements exceeds its capacity while arraylists only increment by 50% of its current size. Arraylists are faster than vectors thanks to their non-synced basis.</p><p>And the final difference is that to traverse elements stored in them, arraylists use “Iterator” interface while the vectors use the same or “Enumeration” interface.</p><p>The final topic of this article is that where should we use arraylists? Arraylists provides constant time for search operations and that means they are better to be used if searching is more frequent and common operation compared to add and remove operations.</p><p>As a conclusion;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*LjJc2mSRF-UQbEp8x2kIRQ.png" /><figcaption><a href="https://www.javatpoint.com/difference-between-arraylist-and-vector">https://www.javatpoint.com/difference-between-arraylist-and-vector</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27c250fd30d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CALLING LINUX SHELL SCRIPTS FROM SAP ABAP]]></title>
            <link>https://mervealtug.medium.com/calling-linux-shell-scripts-from-sap-abap-f1e844a18f8c?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1e844a18f8c</guid>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Tue, 22 Oct 2024 08:17:48 GMT</pubDate>
            <atom:updated>2024-10-22T08:17:48.354Z</atom:updated>
            <content:encoded><![CDATA[<p>In this topic, we will learn what is Shell scripts, why do we use Shell script and how to call shell script from SAP ABAP, lets begin.</p><p><strong>WHAT IS LINUX SHELL SCRIPTING? WHY DO WE USE IT?</strong></p><p>Shell is a program that is used for Unix systems which include LINUX, to manage and interpret commands for system.</p><p>Linux shell scripting is used for automate repetitive processes, simplify system administration processes, and help users perform complex operations more quickly and efficiently.</p><p>And now the question is, how can we trigger Linux shell script from SAP ABAP?</p><p>Shell scripts can be created by using a notepad with “.sh” extension. After write your needed code in notepad and save it, you should upload “.sh” file to SAP Directories, AL11. You can do this by using CG3Z tcode.</p><p>However, if you call External OS directly by again using Shell script, you should get help from your BASIS team that has to create external OS to SAP system connection. For this scenario, BASIS team helps for connection.</p><p>After connection established, We can easily create SM69 node to run linux script on external system directly.</p><p>SM69, Push create button and give command name begin with “Z*” name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LuuGtKYgWp5faP-r4DhacA.png" /></figure><p>For this scenario, We have connection directly to external OS, so here we have triggered shell script directly on External OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*akQkyN4iToXP3GXgHHMQqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FieO3Dxw6k5jAr7n7CKnA.png" /></figure><p>Second step is, trigger SM69 command from SAP ABAP. For this purpose, we can use FM ‘SXPG_COMMAND_EXECUTE” .</p><p>DATA: lv_command TYPE sxpglogcmd, <strong>“SM69 NODE NAME”</strong><br> lv_status TYPE btcxpgstat,<br> lt_log TYPE STANDARD TABLE OF btcxpm, <br> lv_param type SXPGCOLIST-PARAMETERS.<strong>”parameters that you want to call on OS”</strong><br> <br> <br>CALL FUNCTION ‘SXPG_COMMAND_EXECUTE’<br> EXPORTING<br> commandname = lv_command<br> additional_parameters = lv_param<br> IMPORTING<br> status = lv_status<br> TABLES<br> exec_protocol = lt_log<br> EXCEPTIONS<br> no_permission = 1<br> command_not_found = 2<br> parameters_too_long = 3<br> security_risk = 4<br> wrong_check_call_interface = 5<br> program_start_error = 6<br> program_termination_error = 7<br> x_error = 8<br> parameter_expected = 9<br> too_many_parameters = 10<br> illegal_command = 11<br> wrong_asynchronous_parameters = 12<br> cant_enq_tbtco_entry = 13<br> jobcount_generation_error = 14<br> OTHERS = 15.</p><p>You can see log from table lt_log.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXx8jmwCRKsGy85mSw4aLQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1e844a18f8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How can use REST Service URL parameters in SCOT?]]></title>
            <link>https://mervealtug.medium.com/how-can-use-rest-service-url-parameters-in-scot-4ea9baced1db?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ea9baced1db</guid>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 08:14:10 GMT</pubDate>
            <atom:updated>2024-10-18T08:14:10.321Z</atom:updated>
            <content:encoded><![CDATA[<p>In this topic, We will discuss about using URL Parameters while sending sms via SBWP tcode. (Another SMS Protocol trigggered in REST Service Class)</p><p>We have learned how to create REST Service with input parameter at SAP before, at section <a href="https://medium.com/@mervealtug/sap-rest-service-wi%CC%87th-input-parameter-2d227c82541f">REST Service with input parameter</a>.</p><p>Today, we will learn to use created Rest service on SAP standard Tcode SBWP.</p><p>First of all, We have to do SCOT configurations according to use REST service.</p><p>To use service URL for SCOT Configuration, I have created SM59 RFC destination and assign its name in SCOT configuration.</p><p>SM59:Create HTTP CONNECTIONS TO EXTERNAL SERVER.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*yuscSsU33U3cU-sAMefwZQ.png" /></figure><p>Then, add host and prefix of your REST service provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*HngXCaSI3n3K3MZ69yJSzw.png" /></figure><p>Now At tcode SCOT, I have created node <strong>ZSMS</strong> under http_connection-&gt;outbound messages and assign service input parameter in URL and use Sm59 destination</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*dPptxfZuHFPva_HgDg6Viw.png" /></figure><p>But do not forget, I have trigger another Protocol for sending SMS to mobile phone in my REST service Class. Here, we will learn how to use input parameters of REST service in SCOT nodes.</p><p>Here, We can call service with input parameter in URL/Query part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*_oFCNbOySprI5L0iWiq1sQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*Z79GG2gNnqueB0cBd9X5JQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ggssj5CaF7iM1-iTdx0tUQ.png" /></figure><p>From tcode SA14, you have to assign Service Node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*Rc0qNQt6cbbzcVRwl9etFA.png" /></figure><p>Then test ZSMS service from tcode SBWP, Message has been sent from SCOT succesfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*uiGUUfOhoMyli5x_NcylOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*mJEwy5fGSAfp9ngbDGwtjg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ea9baced1db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SAP REST SERVICE WITH INPUT PARAMETER]]></title>
            <link>https://mervealtug.medium.com/sap-rest-service-wi%CC%87th-input-parameter-2d227c82541f?source=rss-97a22bb692a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d227c82541f</guid>
            <dc:creator><![CDATA[Merve Altug]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 09:53:25 GMT</pubDate>
            <atom:updated>2024-10-18T08:29:54.334Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I will discuss How to create REST service with input parameter in URL by using SAP ABAP. First of lets look at what is Rest service and whats is the difference between REST and SOAP service.</p><p>REST service (Representational State Transfer) is a service structure that provides communication between client and server very easily and fast. REST service sends and receives data with minimum content, and also it is faster and has a simpler structure than other services.</p><p>And now the question is, what is the difference with SOAP and REST Service?</p><p>The main difference is undoubtedly; SOAP only supports XML data exchange however REST supports XML, JSON, plain text and HTML formats.</p><p>If we look at their performance; SOAP messages are larger, which slows down communication on the other hand REST has smaller messages and caching support so these features increases its performance in positive way.</p><p>Assume that, you need to take input parameters with REST service and use these parameters for further developments.</p><p>First of all, create service from SICF and activate it. Then provide Proxy settings for our Service URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tqtytsYNsM8x1Kdtt1q9QA.png" /></figure><p>Proxy Configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*R4kFE41z9Gf-AXl1kkHFkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*GE4XZw5LY2HFa12zsjTQJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*8_6vOJB5_i-phdaL4HMBHw.png" /></figure><p>After this step, We have to create new class from SE24 tcode to use in handler List. While creating Class, be attention using superclass ‘CL_REST_HTTP_HANDLER’ to inherit handler class methods to your new class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*9WlETmnYoF9NF1_zS-6E7w.png" /></figure><p>SE24, We redefine ‘GET_ROOT_HANDLER’ method to trigger other class to provide ‘GET’ or ‘POST’ method of REST service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*FSeLsprzJc2Rz3PyQKFmWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*E7_Tw-WcZXaQYuhOQHf6uw.png" /></figure><p>again at SE24 tcode, ZCL_DRIVER_REQ_PROVIDER class should be created by superclass ‘CL_REST_RESOURCE’.</p><p>For our scenario, We will get telephone number and Message that want to send, in URL with parameter. So we need GET method to redefine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*QU6w2SH25ifXX6fqminadg.png" /></figure><p>You can user ‘GET_URI_QUERY_PARAMETER’ method to get input parameter.</p><p>For instance, we will get telephone number via input parameter ‘RECADDR’ and message text with parameter MESSAGE’ in URL for further developments.</p><p>mo_request-&gt;get_uri_query_parameter( iv_name = ‘recaddr’</p><p>IV_ENCODED = ‘ ‘).</p><p>lv_message =</p><p>mo_request-&gt;get_uri_query_parameter( iv_name = ‘message’</p><p>IV_ENCODED = ‘ ‘ ).</p><p>after take these parameters in SAP class, I have sent SMS by using an external api by another protocol. I will explain how to do it via anaother section but here, You can do anything you want cause you have the parameter that you need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d227c82541f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>