https://raw.githubusercontent.com/ajmaradiaga/feeds/main/scmt/topics/SAP-S4HANA-Cloud-ABAP-Environment-blog-posts.xml SAP Community - SAP S/4HANA Cloud ABAP Environment 2024-05-20T17:01:38.512536+00:00 python-feedgen SAP S/4HANA Cloud ABAP Environment blog posts in SAP Community https://community.sap.com/t5/technology-blogs-by-members/how-to-attach-documents-to-a-journal-entry-within-sap-s-4hana-public-cloud/ba-p/13628451 How to attach documents to a Journal Entry within SAP S/4HANA Public Cloud from ABAP. 2024-03-08T15:57:24.484000+01:00 Sergio-Gracia https://community.sap.com/t5/user/viewprofilepage/user-id/751957 <H4 id="toc-hId-1246252180"><STRONG>Introduction</STRONG></H4><P><SPAN>In this blog, we describe a method to attach document files to a Journal Entry (BKPF) instance within the same <a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA+Cloud+Public+Edition/pd-p/08e2a51b-1ce5-4367-8b33-4ae7e8b702e0" class="lia-product-mention" data-product="1199-1">SAP S/4HANA Cloud Public Edition</a>&nbsp;using ABAP.</SPAN></P><DIV class="">&nbsp;</DIV><DIV class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_0-1709726333750.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76523i2519566920E045F5/image-size/large?v=v2&amp;px=999" role="button" title="zeio_0-1709726333750.png" alt="zeio_0-1709726333750.png" /></span></DIV><DIV class="">&nbsp;</DIV><DIV class=""><SPAN>This requires us to expose and consume the Attachment API as described in the</SPAN><SPAN>&nbsp;<A href="https://api.sap.com/api/API_CV_ATTACHMENT_SRV/overview" target="_blank" rel="noopener noreferrer">SAP Business Accelerator HUB - Attachments.</A></SPAN></DIV><DIV class="">&nbsp;</DIV><DIV class=""><SPAN>I belive this blog can be very useful since&nbsp;existing documentation primarily focuses on exposing the services, but we encounter conceptual problems when consuming them locally.</SPAN></DIV><DIV class="">&nbsp;</DIV><DIV class=""><SPAN>This method is also valid for a S/4HANA Private Cloud but has been implemented and tested only in S/4HANA Public Cloud.</SPAN></DIV><H4 id="toc-hId-1049738675">Steps</H4><DIV class=""><OL><LI><P><STRONG>Create the Outbound Service.&nbsp;</STRONG><SPAN>In Eclipse, and within your development package, follow these steps to create a new Outbound Service:</SPAN><SPAN><BR /><BR /></SPAN></P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_0-1709737643035.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76589i29DC6AB765B7F866/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_0-1709737643035.png" alt="zeio_0-1709737643035.png" /></span><UL><LI>Add name and description.</LI><LI>Select the type HTTP.</LI><LI>Set the Default Path Prefix for the Attachment method <A href="https://api.sap.com/api/API_CV_ATTACHMENT_SRV/path/post_AttachmentContentSet" target="_self" rel="noopener noreferrer">AttachmentContentSet</A>, as follows: "/sap/opu/odata/sap/API_CV_ATTACHMENT_SRV/AttachmentContentSet".<BR /><BR /></LI></UL><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_1-1709737678982.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76590i5DBD129F650B7769/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_1-1709737678982.png" alt="zeio_1-1709737678982.png" /></span></LI><LI><P><STRONG>Create the Communication Scenario.</STRONG> Still in Eclipse and under your development package, create a new Communication Scenario as follows:<BR /><BR /></P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_2-1709737713134.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76591iA064B2C917BF3342/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_2-1709737713134.png" alt="zeio_2-1709737713134.png" /></span><UL><LI>Add name and description.</LI><LI>In the Outbound tab, add the previously created service.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_3-1709737805888.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76593i2DA1D8EBE02B7C6D/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_3-1709737805888.png" alt="zeio_3-1709737805888.png" /></span></LI><LI><SPAN>Use the top-right 'Publish Locally' button to publish the communication scenario.</SPAN><BR /><BR /></LI></UL></LI><LI><P><STRONG>Create the Communication User.</STRONG> Navigate to the Maintain Communication User app and create a new user. Remember to copy the username and password, as we will need them to configure the communication systems.<BR /><BR /></P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_4-1709738003846.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76594i38B19725E212C90D/image-size/large?v=v2&amp;px=999" role="button" title="zeio_4-1709738003846.png" alt="zeio_4-1709738003846.png" /></span><BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_5-1709738076778.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76596iA64C93E18FC3C9E6/image-size/large?v=v2&amp;px=999" role="button" title="zeio_5-1709738076778.png" alt="zeio_5-1709738076778.png" /></span></LI><LI><P><STRONG>Assign the new communication user to our local Communication System.</STRONG> In the Communication System app, select our local system using the top button labeled "Own SAP Cloud System."<BR /><BR /></P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_6-1709738120971.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76599iF5218A05F10FB68C/image-size/large?v=v2&amp;px=999" role="button" title="zeio_6-1709738120971.png" alt="zeio_6-1709738120971.png" /></span><BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_7-1709738150828.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76600i10493A0B9B2B593D/image-size/large?v=v2&amp;px=999" role="button" title="zeio_7-1709738150828.png" alt="zeio_7-1709738150828.png" /></span><UL><LI>Copy the hostname, as it will be needed in the next step.</LI><LI>In edit mode, assign the previously created user as the User for Inbound Communication and save.<BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_8-1709738210163.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76601i1D44AD2D363FB64B/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_8-1709738210163.png" alt="zeio_8-1709738210163.png" /></span></LI></UL></LI><LI><STRONG>Create a Communication System to consume the service.</STRONG> Go to the Communication Systems App, create a new system, fill the ID and description.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_9-1709738280494.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76602iC12DF1176C22C2C6/image-size/large?v=v2&amp;px=999" role="button" title="zeio_9-1709738280494.png" alt="zeio_9-1709738280494.png" /></span><BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_10-1709738305034.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76603i0342E9CCE3CD7A06/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_10-1709738305034.png" alt="zeio_10-1709738305034.png" /></span><UL><LI>Complete hostname field with the value obtained in the previous step (local hostname).<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_12-1709738469078.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76605i3B3F5998E680970F/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_12-1709738469078.png" alt="zeio_12-1709738469078.png" /></span></LI><LI>Assign the previously created user as Outbound User, and save.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_13-1709738517919.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76606i31E1202AF72434FF/image-size/large?v=v2&amp;px=999" role="button" title="zeio_13-1709738517919.png" alt="zeio_13-1709738517919.png" /></span><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_14-1709738531108.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76607iC4858924514C8004/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_14-1709738531108.png" alt="zeio_14-1709738531108.png" /></span></LI></UL></LI><LI><P><STRONG>Create the Communication Arrangement to expose the service.</STRONG> Navigate to the Communication Arrangement App, create a new one, or check if one exists, based on the Scenario SAP_COM_0002: Finance - Posting Integration. This scenario has sufficient permissions to attach document files to a Journal Entry instance.<BR /><BR /></P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_2-1709739349096.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76615i5A19E1C08E117806/image-size/large?v=v2&amp;px=999" role="button" title="zeio_2-1709739349096.png" alt="zeio_2-1709739349096.png" /></span><P>&nbsp;</P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_3-1709739393983.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76616i70EB3BF313C0CFDE/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_3-1709739393983.png" alt="zeio_3-1709739393983.png" /></span><UL><LI>After selecting or creating the communication arrangement, ensure that the communication system is assigned to your local system. Also, add the created communication user as Inbound Communication User.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SergioGracia_1-1709742372912.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76666i01D44ED185D5C18C/image-size/large?v=v2&amp;px=999" role="button" title="SergioGracia_1-1709742372912.png" alt="SergioGracia_1-1709742372912.png" /></span><P>&nbsp;</P><BR /><BR /></LI><LI>We don't need the Outbound Services of the Arrangement for this requirement, so unless necessary for other reasons, deactivate these services by unchecking the Active flag.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SergioGracia_0-1709741795715.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76657i09F1CDD2E436E07A/image-size/large?v=v2&amp;px=999" role="button" title="SergioGracia_0-1709741795715.png" alt="SergioGracia_0-1709741795715.png" /></span></LI></UL></LI><LI><P><STRONG>Create the Communication Arrangement to consume the service.</STRONG> Create a new Communication Arrangement based on our scenario created in step 2, assign the communication system created and assign the outbound communication user.<BR /><BR /></P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="zeio_7-1709739718535.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76625iD633E173330E7A88/image-size/medium?v=v2&amp;px=400" role="button" title="zeio_7-1709739718535.png" alt="zeio_7-1709739718535.png" /></span><P>&nbsp;</P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SergioGracia_2-1709742477463.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76670iEF5780894DFB7075/image-size/large?v=v2&amp;px=999" role="button" title="SergioGracia_2-1709742477463.png" alt="SergioGracia_2-1709742477463.png" /></span><BR /><P><SPAN>After saving, you can verify if the user/system relationship has been correctly configured using the Check Connection button.<BR /><BR /></SPAN></P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zeio_8-1709739781520.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/76627i3A63B2E5979A6054/image-size/large?v=v2&amp;px=999" role="button" title="zeio_8-1709739781520.png" alt="zeio_8-1709739781520.png" /></span><P>If you get an error, please check the Outbound User has the right password in Communication System.</P></LI><LI><P><STRONG>Consume the Attachment API from an ABAP Class.</STRONG></P></LI></OL><UL><LI>You can consume the API using ABAP with the following code.</LI></UL></DIV><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code> TRY. DATA(lo_destination) = cl_http_destination_provider=&gt;create_by_comm_arrangement( comm_scenario = 'ZCS_ATTACHMENT' "Communication Arrangement service_id = 'ZOS_API_ATTACHMENT_REST' "Outbound Service). DATA(lo_http_client) = cl_web_http_client_manager=&gt;create_by_http_destination( i_destination = lo_destination ). "Set CSRF Token lo_http_client-&gt;set_csrf_token( ). DATA(lo_request) = lo_http_client-&gt;get_http_request( ). lo_request-&gt;set_header_field( i_name = 'Slug' i_value = iv_filename )."Filename (with extension) lo_request-&gt;set_header_field( i_name = 'BusinessObjectTypeName' i_value = iv_bo_type ). "BKPF lo_request-&gt;set_header_field( i_name = 'LinkedSAPObjectKey' i_value = iv_bo_key ). "Journal Entry concatenate key fields. lo_request-&gt;set_content_type( content_type = iv_mimetype ). "Mimetype lo_request-&gt;set_binary( i_data = iv_attachment ). "File content in binary DATA(lo_response) = lo_http_client-&gt;execute( i_method = if_web_http_client=&gt;post ). DATA(ls_status) = lo_response-&gt;get_status( ). IF ls_status-code NE 201. "Catch error (the attachment hasn't be created) ENDIF. CATCH cx_web_message_error INTO DATA(lx_web). "Catch error (the service is misconfigured) ENDTRY.</code></pre><P>&nbsp;</P><P>Please take a look to "iv_" variables and replace them with valid information. or include the code into a class method with these variables, all of them are strings.</P> 2024-03-08T15:57:24.484000+01:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-cloud-abap%E5%BC%80%E5%8F%91%E6%A1%88%E4%BE%8B%E4%B9%8B%E5%85%AD-bom%E6%89%B9%E9%87%8F%E8%AF%BB%E5%8F%96/ba-p/13633338 SAP S/4HANA Cloud ABAP开发案例之六:BOM批量读取 2024-03-11T07:05:14.803000+01:00 Vincent_Zhu https://community.sap.com/t5/user/viewprofilepage/user-id/131883 <P><SPAN>紧随这篇</SPAN><A href="https://blogs.sap.com/2023/12/01/s-4hana-cloud%e4%b8%89%e7%b3%bb%e7%bb%9fcloud-abap%e5%bc%80%e5%8f%91%e6%a1%88%e4%be%8b%e4%bb%8b%e7%bb%8d/" target="_blank" rel="noopener noreferrer">博客</A><SPAN>,今天我们将再次逐步详细地介绍一个利用SAP S/4HANA Cloud三系统来做开发扩展的案例。</SPAN></P><P>&nbsp;</P><H2 id="toc-hId-988860292"><SPAN>1. 案例背景</SPAN></H2><P><SPAN>我们有些客户希望查看BOM所有层级的数据,也希望能够批量下载BOM所有层级的数据。我们有标准应用程序“Display BOM level by level”可以查看或下载单个物料的BOM所有层级信息,但是没有应用程序可以查看或下载多个物料的BOM所有层级数据。我们这个案例的开发应用就是来完成这样一个需求。</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="standard App Display BOM level by level can only view the data for single Material" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78072iD9E51F73A7C2EB53/image-size/large?v=v2&amp;px=999" role="button" title="BOM2.png" alt="standard App Display BOM level by level can only view the data for single Material" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">standard App Display BOM level by level can only view the data for single Material</span></span></SPAN></P><P>&nbsp;</P><P>&nbsp;</P><P>通过开发人员可扩展性,我们创建了一个自定义的应用程序,允许用户选择多个物料,可以查看或下载所选物料的所有节点数据。</P><P>&nbsp;</P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78073i8DDB2F9014134411/image-size/large?v=v2&amp;px=999" role="button" title="BOM1.png" alt="BOM1.png" /></span></SPAN></P><P>&nbsp;</P><H2 id="toc-hId-792346787"><SPAN>2. 后台服务开发</SPAN></H2><H3 id="toc-hId-724916001"><SPAN>2.1 创建数据定义</SPAN></H3><P><SPAN>创建一个新的数据定义(data definition)</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM3.png" style="width: 557px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78074i7244454491D663EE/image-size/large?v=v2&amp;px=999" role="button" title="BOM3.png" alt="BOM3.png" /></span></SPAN></P><P>&nbsp;</P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM4.png" style="width: 499px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78075i859533C4DAB466DB/image-size/large?v=v2&amp;px=999" role="button" title="BOM4.png" alt="BOM4.png" /></span></SPAN></P><P>&nbsp;</P><H3 id="toc-hId-528402496"><SPAN>2.2 创建查询实现类</SPAN></H3><P>创建类<SPAN>ZCL_BOM_DISPLAY,在这个类里包含了详细的数据查询逻辑。</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM5.png" style="width: 557px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78076iBD14CD9A41EF6336/image-size/large?v=v2&amp;px=999" role="button" title="BOM5.png" alt="BOM5.png" /></span></SPAN></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>METHOD get_bom_hierarchy. *get BOM Link and BOM hierarchy based on condition SELECT * FROM I_BOMComponentWithKeyDate( p_keydate = _keydate ) AS Bom JOIN I_MaterialBOMLink AS Bomlink ON Bom~BillOfMaterialCategory = Bomlink~BillOfMaterialCategory AND Bom~BillOfMaterialVariant = Bomlink~BillOfMaterialVariant AND Bom~BillOfMaterial = Bomlink~BillOfMaterial WHERE Bomlink~BillOfMaterialCategory = 'M' AND Bomlink~BillOfMaterialVariant = '01' AND Bomlink~Material IN _material AND Bomlink~Plant IN _plant INTO TABLE (lt_BOMlist). IF sy-subrc = 0. rv_resp = abap_true. CLEAR pt_materialhierarchy. ENDIF. LOOP AT lt_BOMlist ASSIGNING FIELD-SYMBOL(&lt;lfs_bomlist&gt;). MOVE-CORRESPONDING &lt;lfs_bomlist&gt;-bomlink TO ps_response. MOVE-CORRESPONDING &lt;lfs_bomlist&gt;-bom TO ps_response. "Get product descrption saperatelly since CDS view does not have it. SELECT SINGLE ProductName FROM I_producttext WHERE Product = _response-material AND Language = -langu INTO _response-materialDesc. APPEND ps_response TO pt_response. CLEAR ps_response. ps_material-sign = 'I'. ps_material-option = 'EQ'. ps_material-low = &lt;lfs_bomlist&gt;-bom-BillOfMaterialComponent. APPEND ps_material TO pt_materialhierarchy. CLEAR ps_material. ENDLOOP. ENDMETHOD.</code></pre><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@EndUserText.label: 'Multiple BOM Display' @ObjectModel.query.implementedBy: 'ABAP:ZCL_BOM_DISPLAY' @UI.headerInfo: {typeName: 'Billofmaterial',typeNamePlural: ' BOM Mass Download'} define custom entity Z_BOM_DISPLAY with parameters // @Environment.systemField: #SYSTEM_DATE // <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'Material',position:10,importance: #HIGH }] P_KeyDate : vdm_v_key_date { <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'Material',position:10,importance: #HIGH }] <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.selectionField: [{ position: 20 }] // @Consumption.valueHelpDefinition: [{ entity: {name:'I_ProductStdVH' ,element: 'Product' } }] @Consumption.valueHelpDefinition: [{ entity: {name:'I_ProductPlantStdVH' ,element: 'Product' } }] @Consumption.valueHelpDefinition: [{additionalBinding: [{ element: 'Plant', localElement: 'Plant' }]}] @Consumption.filter:{mandatory: true} key Material : matnr; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'Plant', position:90, importance: #HIGH }] <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.selectionField: [{ position: 10 }] @Consumption.valueHelpDefinition: [{ entity: {name:'I_PlantStdVH' ,element: 'Plant' } }] @Consumption.filter:{mandatory: true} // @Consumption.defaultValue: '1310' key Plant : werks_d; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.hidden: true key BillOfMaterialCategory : abap.char(1); // <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.selectionField: [{ position: 50 }] <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.hidden: true key Billofmaterial : abap.char(8); // <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.selectionField: [{ position: 60 }] <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.hidden: true key Billofmaterialvariant : abap.char(2); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.hidden: true key Billofmaterialitemnodenumber : abap.numc(8); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'MaterialDesc',position:20,importance: #HIGH }] MaterialDesc : abap.char(40); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ValidityStartdate',position:100,importance: #HIGH }] Validitystartdate : abap.dats; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ValidityEnddate',position:110,importance: #HIGH }] Validityenddate : abap.dats; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'Component',position:50,importance: #HIGH }] Billofmaterialcomponent : matnr; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ComponentDesc',position:60,importance: #HIGH }] // BillofmaterialcomponentDesc : abap.char(40); ComponentDescription : abap.char(40); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ItemCategory',position:30,importance: #HIGH }] Billofmaterialitemcategory : abap.char(1); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ItemNumber ',position:40,importance: #HIGH }] Billofmaterialitemnumber : abap.char(4); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ItemUnit',position:80,importance: #HIGH }] // @Semantics.unitOfMeasure Billofmaterialitemunit : meins; // Billofmaterialitemunit : abap.unit(3); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'ItemQuantity',position:70,importance: #HIGH }] // @Semantics.quantity.unitOfMeasure : 'billofmaterialitemunit' Billofmaterialitemquantity : abap.numc(13); // Billofmaterialitemquantity : abap.quan(13,3); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.hidden: true Identifierbomitem : abap.char(8); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'Level',position:220,importance: #LOW }] LevelCount : abap.numc(8); <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.lineItem :[{label:'Path(Predecessor)',position:230,importance: #LOW }] Path : abap.numc(8); }</code></pre><P>&nbsp;</P><H3 id="toc-hId-331888991">2.3 创建服务定义和服务绑定</H3><P>创建服务定义(Service Definition)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM6.png" style="width: 557px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78077iCC61F12D35236E6F/image-size/large?v=v2&amp;px=999" role="button" title="BOM6.png" alt="BOM6.png" /></span></P><P>&nbsp;</P><P>创建服务绑定(Service Binding)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM7.png" style="width: 557px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78078iE31DFFBD21C6EFAD/image-size/large?v=v2&amp;px=999" role="button" title="BOM7.png" alt="BOM7.png" /></span></P><P>&nbsp;</P><P>然后,我们可以预览服务如下:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM8.png" style="width: 557px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78080iAA4D259A1727837A/image-size/large?v=v2&amp;px=999" role="button" title="BOM8.png" alt="BOM8.png" /></span></P><P>&nbsp;</P><H2 id="toc-hId-6292767"><SPAN>3. 前端应用开发</SPAN></H2><P>首先,配置BTP上的destination。</P><P>然后,打开SAP Business Application Studio服务</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM9.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78082i86D9DAF3D042EC46/image-size/large?v=v2&amp;px=999" role="button" title="BOM9.png" alt="BOM9.png" /></span></P><P>&nbsp;</P><P>从Application Generator里选取List Report Page模板</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM10.png" style="width: 698px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78084iA8079C87BA2AE524/image-size/large?v=v2&amp;px=999" role="button" title="BOM10.png" alt="BOM10.png" /></span></P><P>&nbsp;</P><P>把App部署到SAP S/4hana Public Cloud系统</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM11.png" style="width: 573px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78085iA43CC29715E521D4/image-size/large?v=v2&amp;px=999" role="button" title="BOM11.png" alt="BOM11.png" /></span></P><P>&nbsp;</P><P>复制Launchpad App Description Item名字到IAM App:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM12.png" style="width: 698px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78086iD260B8BB18F6F04B/image-size/large?v=v2&amp;px=999" role="button" title="BOM12.png" alt="BOM12.png" /></span></P><P>&nbsp;</P><P>通过该新应用,我们不仅可以选择多个物料来查看BOM的节点信息,也可以把所有数据下载到Excel表格,以方便用户线下操作。</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78087i420ED9ADE5461EB5/image-size/large?v=v2&amp;px=999" role="button" title="BOM1.png" alt="BOM1.png" /></span></P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BOM13.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78088i98E09168FD5D6267/image-size/large?v=v2&amp;px=999" role="button" title="BOM13.png" alt="BOM13.png" /></span></P><P>&nbsp;</P><P><SPAN>以上是该案例——BOM批量读取自开发应用的步骤介绍。希望通过此案例的介绍能让您了解到三系统开发能实现的常见功能。</SPAN>&nbsp;</P><P>&nbsp;</P> 2024-03-11T07:05:14.803000+01:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-cloud-abap%E5%BC%80%E5%8F%91%E6%A1%88%E4%BE%8B%E4%B9%8B%E4%B8%83-%E5%BA%93%E9%BE%84%E6%8A%A5%E8%A1%A8/ba-p/13633424 SAP S/4HANA Cloud ABAP开发案例之七:库龄报表 2024-03-11T08:40:07.661000+01:00 Vincent_Zhu https://community.sap.com/t5/user/viewprofilepage/user-id/131883 <P><SPAN>紧随这篇</SPAN><A href="https://blogs.sap.com/2023/12/01/s-4hana-cloud%e4%b8%89%e7%b3%bb%e7%bb%9fcloud-abap%e5%bc%80%e5%8f%91%e6%a1%88%e4%be%8b%e4%bb%8b%e7%bb%8d/" target="_blank" rel="noopener noreferrer">博客</A><SPAN>,今天我们将再次逐步详细地介绍一个利用SAP S/4HANA Cloud三系统来做开发扩展的案例。</SPAN></P><P>&nbsp;</P><H2 id="toc-hId-988861218"><SPAN>1. 案例背景</SPAN></H2><P><SPAN>库龄报表是大多数客户都会询问和想要的一张报表。它以逆时间顺序概述了一段时间内从选定的关键日期开始的可用物料库存的分布情况。但是,具体的需求可能因客户而异。例如,一些客户可能希望在计算物料库龄信息时只考虑某些移动类型。通过利用开发人员可扩展性,我们开发了一个定制的库龄报表,并嵌入到SAP S/4hana Cloud系统中。此外,客户可以完全灵活地定义哪些移动类型将包括在库龄报告的计算中。</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging8.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78113iDD287BCFBFB97ED4/image-size/large?v=v2&amp;px=999" role="button" title="aging8.png" alt="aging8.png" /></span></SPAN></P><P>&nbsp;</P><P>同时,我们配置了一个Custom Business Configuration项目,我们可以把希望被统计在库龄报表里的移动类型维护在这个表格内,如下图。</P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging9.png" style="width: 862px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78114iF98DE0F85856AEE8/image-size/large?v=v2&amp;px=999" role="button" title="aging9.png" alt="aging9.png" /></span></SPAN></P><P>&nbsp;</P><H2 id="toc-hId-792347713"><SPAN>2. 后台服务开发</SPAN></H2><H3 id="toc-hId-724916927">2.1 创建数据定义</H3><P>创建一个新的数据定义(Data Definition):<SPAN>Z_MATERIAL_STOCK_AGE</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging1.png" style="width: 510px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78115iEB52CDADB95B7B99/image-size/large?v=v2&amp;px=999" role="button" title="aging1.png" alt="aging1.png" /></span></SPAN></P><P>&nbsp;</P><H3 id="toc-hId-528403422">2.2 创建查询实现类</H3><P>创建类<SPAN>ZCL_MATERIAL_STOCK_AGE,在这个类里包含了基于CDS视图的数据查询逻辑。</SPAN></P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>CLASS zcl_material_stock_age DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES if_rap_query_provider . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS ZCL_MATERIAL_STOCK_AGE IMPLEMENTATION. METHOD if_rap_query_provider~select. IF io_request-&gt;is_data_requested( ). TYPES BEGIN OF ty_value. TYPES: quantity TYPE i_stockquantitycurrentvalue_2-matlwrhsstkqtyinmatlbaseunit, value TYPE i_stockquantitycurrentvalue_2-stockvalueindisplaycurrency. TYPES END OF ty_value. TYPES: BEGIN OF ty_range_option, sign TYPE c LENGTH 1, option TYPE c LENGTH 2, low TYPE string, high TYPE string, END OF ty_range_option. DATA: lt_response TYPE TABLE OF z_material_stock_age, ls_response LIKE LINE OF lt_response, lt_responseout LIKE lt_response, ls_responseout LIKE LINE OF lt_responseout, lt_response_period TYPE TABLE OF z_material_stock_age, ls_response_period LIKE LINE OF lt_response_period, lt_value TYPE TABLE OF ty_value, ls_value TYPE ty_value, lv_price TYPE p DECIMALS 2, lt_configr TYPE TABLE OF ty_range_option, ls_configr LIKE LINE OF lt_configr. DATA(lv_top) = io_request-&gt;get_paging( )-&gt;get_page_size( ). DATA(lv_skip) = io_request-&gt;get_paging( )-&gt;get_offset( ). DATA(lv_max_rows) = COND #( WHEN lv_top = if_rap_query_paging=&gt;page_size_unlimited THEN 0 ELSE lv_top ). DATA(lt_clause) = io_request-&gt;get_filter( )-&gt;get_as_ranges( ). DATA(lt_parameter) = io_request-&gt;get_parameters( ). DATA(lt_fields) = io_request-&gt;get_requested_elements( ). DATA(lt_sort) = io_request-&gt;get_sort_elements( ). TRY. DATA(lt_filter_cond) = io_request-&gt;get_filter( )-&gt;get_as_ranges( ). CATCH cx_rap_query_filter_no_range INTO DATA(lx_no_sel_option). ENDTRY. ****************************Data selection and business logics goes here********************************* LOOP AT lt_parameter ASSIGNING FIELD-SYMBOL(&lt;fs_p&gt;). CASE &lt;fs_p&gt;-parameter_name. WHEN 'P_KEYDATE'. DATA(p_keydate) = &lt;fs_p&gt;-value. ENDCASE. ENDLOOP. LOOP AT lt_filter_cond INTO DATA(ls_filter_cond). IF ls_filter_cond-name = 'STROAGELOCATION'. DATA(lt_storagelocation) = ls_filter_cond-range[]. ELSEIF ls_filter_cond-name = 'MATERIAL'. DATA(lt_material) = ls_filter_cond-range[]. ELSEIF ls_filter_cond-name = 'PLANT'. DATA(lt_plant) = ls_filter_cond-range[]. ELSEIF ls_filter_cond-name = 'COMPANYCODE'. DATA(lt_bukrs) = ls_filter_cond-range[]. ENDIF. ENDLOOP. *get configuration data SELECT * FROM zmovementtype WHERE bukrs IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_bukrs AND inuse = <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/2449">@abap_true</a> INTO TABLE <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1407137">@DATA</a>(lt_config). LOOP AT lt_config INTO DATA(ls_config). ls_configr-sign = 'I'. ls_configr-option = 'EQ'. ls_configr-low = ls_config-movementtype. APPEND ls_configr TO lt_configr. CLEAR ls_configr. ENDLOOP. *get inventory information based on date SELECT * FROM i_materialstock_2 WHERE storagelocation IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_storagelocation AND material IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_material AND matldoclatestpostgdate &lt;= @p_keydate AND plant IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_plant AND companycode IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_bukrs INTO TABLE <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1407137">@DATA</a>(lt_stock). LOOP AT lt_stock INTO DATA(ls_stock). ls_response-companycode = ls_stock-companycode. ls_response-plant = ls_stock-plant. ls_response-material = ls_stock-material. ls_response-stroagelocation = ls_stock-storagelocation. ls_response-currentstock = ls_stock-matlwrhsstkqtyinmatlbaseunit. COLLECT ls_response INTO lt_response. ENDLOOP. *period start date calculation DATA lv_30 TYPE d. DATA lv_60 TYPE d. DATA cd TYPE d. cd = p_keydate. lv_30 = cd - 30. lv_60 = cd - 60. *get material movement history SELECT * FROM i_materialdocumentitem_2 FOR ALL ENTRIES IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_response WHERE storagelocation = <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_response-stroagelocation AND postingdate &lt;= @p_keydate AND plant IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_plant AND companycode IN <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_bukrs AND material = <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_response-material AND goodsmovementtype in <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_configr AND goodsmovementiscancelled IS INITIAL INTO TABLE <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1407137">@DATA</a>(lt_movement). DATA(lt_movement_reverse) = lt_movement[]. LOOP AT lt_movement INTO DATA(ls_movement). READ TABLE lt_movement_reverse WITH KEY reversedmaterialdocumentyear = ls_movement-materialdocumentyear reversedmaterialdocument = ls_movement-materialdocument TRANSPORTING NO FIELDS. IF sy-subrc = 0. DELETE lt_movement FROM ls_movement. ENDIF. ENDLOOP. LOOP AT lt_movement INTO ls_movement WHERE reversedmaterialdocument IS INITIAL. ls_response_period-companycode = ls_movement-companycode. ls_response_period-plant = ls_movement-plant. ls_response_period-material = ls_movement-material. ls_response_period-stroagelocation = ls_movement-storagelocation. ls_response_period-meins = ls_movement-materialbaseunit. ls_response_period-waers = ls_movement-companycodecurrency. IF ls_movement-postingdate &gt; lv_30 AND ls_movement-postingdate &lt;= cd. ls_response_period-period1 = ls_movement-quantityinbaseunit. ELSEIF ls_movement-postingdate &gt; lv_60 AND ls_movement-postingdate &lt;= lv_30. ls_response_period-period2 = ls_movement-quantityinbaseunit. ELSEIF ls_movement-postingdate &lt;= lv_60. ls_response_period-period3 = ls_movement-quantityinbaseunit. ENDIF. COLLECT ls_response_period INTO lt_response_period. CLEAR ls_response_period. ENDLOOP. LOOP AT lt_response INTO ls_response. READ TABLE lt_response_period WITH KEY companycode = ls_response-companycode plant = ls_response-plant material = ls_response-material stroagelocation = ls_response-stroagelocation INTO ls_response_period. * ls_response-meins = ls_response_period-meins. * ls_response-waers = ls_response_period-waers. IF sy-subrc = 0. * period 1 calculation with 30 days. IF ls_response-currentstock &lt; ls_response_period-period1 AND ls_response_period-period1 &gt; 0. ls_response-period1 = ls_response-currentstock. ELSE. ls_response-period1 = ls_response_period-period1. ENDIF. * period 2 calculation between 30 days to 60 days. IF ( ls_response-currentstock - ls_response_period-period1 ) &lt; 0. ls_response-period2 = 0. ELSEIF ( ls_response-currentstock - ls_response_period-period1 ) &lt; ls_response_period-period2 AND ls_response_period-period2 &gt; 0. ls_response-period2 = ls_response-currentstock - ls_response_period-period1. ELSEIF ( ls_response-currentstock - ls_response_period-period1 ) &gt;= ls_response_period-period2. ls_response-period2 = ls_response_period-period2. ENDIF. * period 3 calculation more than 60 days IF ( ls_response-currentstock - ls_response_period-period1 - ls_response_period-period2 ) &lt; 0. ls_response-period3 = 0. ELSEIF ( ls_response-currentstock - ls_response_period-period1 - ls_response_period-period2 ) &lt; ls_response_period-period3 AND ls_response_period-period3 &gt; 0. ls_response-period3 = ls_response-currentstock - ls_response_period-period1 - ls_response_period-period2. ELSEIF ( ls_response-currentstock - ls_response_period-period1 - ls_response_period-period2 ) &gt;= ls_response_period-period3. ls_response-period3 = ls_response_period-period3. ENDIF. ELSEIF sy-subrc &gt; 0 AND ls_response-currentstock &gt; 0. ls_response-period3 = ls_response-currentstock. ENDIF. * getting price information SELECT SUM( matlwrhsstkqtyinmatlbaseunit ) AS quantity, SUM( stockvalueincccrcy ) AS value FROM i_stockquantitycurrentvalue_2( p_displaycurrency = 'CNY' ) WHERE product = <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398583">@LieneS</a>_response-material AND plant = <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398583">@LieneS</a>_response-plant AND storagelocation = <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398583">@LieneS</a>_response-stroagelocation AND valuationareatype = 1 GROUP BY product,plant,storagelocation INTO TABLE <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1398638">@LT</a>_value. IF sy-subrc = 0. CLEAR: ls_value, lv_price. READ TABLE lt_value INTO ls_value INDEX 1. IF ls_value-quantity NE 0. lv_price = ls_value-value / ls_value-quantity. ENDIF. ENDIF. * calculate value information ls_response-currentvalue = ls_response-currentstock * lv_price. ls_response-period1_v = ls_response-period1 * lv_price. ls_response-period2_v = ls_response-period2 * lv_price. ls_response-period3_v = ls_response-period3 * lv_price. MODIFY lt_response FROM ls_response. CLEAR ls_response. ENDLOOP. *paging way to return huge amount of data SORT lt_response BY stroagelocation material. lv_max_rows = lv_skip + lv_top. IF lv_skip &gt; 0. lv_skip = lv_skip + 1. ENDIF. CLEAR lt_responseout. LOOP AT lt_response ASSIGNING FIELD-SYMBOL(&lt;lfs_out_line_item&gt;) FROM lv_skip TO lv_max_rows. ls_responseout = &lt;lfs_out_line_item&gt;. APPEND ls_responseout TO lt_responseout. ENDLOOP. io_response-&gt;set_total_number_of_records( lines( lt_response ) ). io_response-&gt;set_data( lt_responseout ). ENDIF. ENDMETHOD. ENDCLASS.</code></pre><P>&nbsp;</P><P>&nbsp;</P><H3 id="toc-hId-331889917">2.3 创建服务定义和服务绑定</H3><P>创建服务定义(Service Definition)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging2.png" style="width: 586px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78118i45EBDE37890DE1AC/image-size/large?v=v2&amp;px=999" role="button" title="aging2.png" alt="aging2.png" /></span></P><P>&nbsp;</P><P>创建服务绑定(Service Binding)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging3.png" style="width: 535px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78119iFDF446273B2911CC/image-size/large?v=v2&amp;px=999" role="button" title="aging3.png" alt="aging3.png" /></span></P><P>我们可以看到服务预览如下:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging4.png" style="width: 593px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78120i6CEAC70DFEF8BF66/image-size/large?v=v2&amp;px=999" role="button" title="aging4.png" alt="aging4.png" /></span></P><P>&nbsp;</P><H2 id="toc-hId-6293693">3. 前台应用开发</H2><P>首先,在BTP上配置destination。</P><P>然后,打开SAP Business Application Studio服务。</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging5.png" style="width: 774px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78121i0EA05F7F6BD2DB8E/image-size/large?v=v2&amp;px=999" role="button" title="aging5.png" alt="aging5.png" /></span></P><P>&nbsp;</P><P>从Application Generator里选取SAP Fiori Worklist Application模板。</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging6.png" style="width: 715px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78122iCC12BFD076AE7867/image-size/large?v=v2&amp;px=999" role="button" title="aging6.png" alt="aging6.png" /></span></P><P>&nbsp;</P><P>把应用部署到SAP S/4HANA Public Cloud系统。</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="aging7.png" style="width: 331px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/78124iC752223B01F6C3B8/image-size/large?v=v2&amp;px=999" role="button" title="aging7.png" alt="aging7.png" /></span></P><P>&nbsp;</P><P><SPAN>以上是该案例——库龄报表自开发应用的步骤介绍。希望通过此案例的介绍能让您了解到三系统开发能实现的常见功能。</SPAN></P> 2024-03-11T08:40:07.661000+01:00 https://community.sap.com/t5/technology-blogs-by-members/platform-agnostic-abap-add-on-development-and-use-of-standard-objects-in/ba-p/13637199 Platform agnostic ABAP Add-On Development and use of standard objects in Cloud Development 2024-03-14T11:31:39.570000+01:00 tamitdassharma https://community.sap.com/t5/user/viewprofilepage/user-id/153763 <P>Last year we celebrated ABAP as SAP's programming language as it turned 40 and from the vision and roadmap from SAP it is evident that it is going to stay here for some more decades. SAP has been leading in the Gartner's quadrant for ERP for decades now and this has been possible because of SAP's vibrant partner eco-system.</P><P>Having said this, let's turn our focus to one of its advancement, i.e., the ABAP environment in the Business Transformation Platform (commonly know as SAP BTP). With the introduction of SAP BTP in the last couple of years there has been a huge shift of mindset in the development fraternity of SAP. At least in the partner ecosystem now solutions are being developed keeping SAP BTP in mind, i.e., solutions being developed in the partner eco-system are being made more platform agnostic.&nbsp;</P><P>To achieve a clean and controlled design paradigm in the cloud environment of ABAP, SAP came up with the ABAP Language Version for cloud which is known as ABAP for Cloud Development. The value for the ABAP Language Version determines which language elements can be used in the development. For example, the language version of ABAP for Cloud Development has a more restricted use and has an extensive list of elements that can be used but not as the language version Standard ABAP where there are no restrictions. [The list can be viewed in&nbsp;<A href="https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrestricted_abap_elements.htm" target="_blank" rel="noopener noreferrer">Language Elements in ABAP Versions</A>] As mentioned already the language version ABAP for Cloud Development has a more restricted use and therefore not all objects from Standard SAP language version can be used in objects with language version ABAP for Cloud Development. Only APIs having language version as Standard ABAP and with a C1 contract which are released for Use in Cloud Development can be used in the development objects with language version ABAP for Cloud Development. [<A href="https://github.com/SAP-samples/abap-cheat-sheets/blob/main/19_ABAP_for_Cloud_Development.md" target="_blank" rel="noopener nofollow noreferrer">ABAP for Cloud Development</A>&nbsp;is a good read to understand the concepts of Restricted Language use and API contracts.]</P><P>As mentioned before, SAP's partner eco-system has to always go hand in hand with SAP. This means that with the introduction of <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-1">SAP BTP, ABAP environment</a>, partners needs to build solutions that are more platform agnostic, i.e., solutions which can run independently on the on-premise solution<a href="https://community.sap.com/t5/c-khhcw49343/SAP+ERP/pd-p/01200615320800000659" class="lia-product-mention" data-product="581-1">SAP ERP</a>,<a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA/pd-p/73554900100800000266" class="lia-product-mention" data-product="799-1">SAP S/4HANA</a>and as well on the <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-2">SAP BTP, ABAP environment</a>. This is a most widely accepted paradigm in the solution design, otherwise maintenance cost of the code-base would increase exponentially. And anyone from the partner eco-system's development fraternity will agree with the fact that refusing APIs from SAP standard solution makes our life easy and reduces the cost and time of the development life-cycle of the add-on solutions.&nbsp;</P><P>To be able to build solutions which are platform agnostic, i.e., would run independently on <a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA/pd-p/73554900100800000266" class="lia-product-mention" data-product="799-2">SAP S/4HANA</a>&nbsp;as well as <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-3">SAP BTP, ABAP environment</a>&nbsp;the minimum on-premise version that can be used is the SAP S/4 HANA 1909 version. However, for objects to be deployed to <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-4">SAP BTP, ABAP environment</a>&nbsp;it is mandatory that the objects have the ABAP Language Version is set to ABAP for Cloud Development. But then if one tries to make use of any objects from the Standard ABAP, i.e., ABAP Language Version set to as Standard ABAP the following compilation error occurs.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tamitdassharma_0-1710410304020.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/80621iB1B2FC0F3757F906/image-size/large?v=v2&amp;px=999" role="button" title="tamitdassharma_0-1710410304020.png" alt="tamitdassharma_0-1710410304020.png" /></span></P><P>Now since this class belongs to the Standard ABAP Language Version and is not released for use in Cloud the compilation error is displayed. This can be resolved by Adding a Release Contract, i.e., C1 contract in this scenario and marking the object for Use in Cloud Development.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-14 at 11.05.55 AM.png" style="width: 918px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/80626i219CC3B3C7FE79C5/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-14 at 11.05.55 AM.png" alt="Screenshot 2024-03-14 at 11.05.55 AM.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tamitdassharma_2-1710410700759.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/80625iE582F3D848B09B1F/image-size/large?v=v2&amp;px=999" role="button" title="tamitdassharma_2-1710410700759.png" alt="tamitdassharma_2-1710410700759.png" /></span></P><P>This way you can make sure that the standard object can be used in cloud environment, but it is not a recommendable approach as there will be issues in deploying to the cloud environment.</P><P>Another scenario is where the development fraternity of the partner eco-system tries to reuse objects from standard SAP solution. And to identify objects with a released API state is cumbersome. But with ADT it can be achieved with using keyword in the properties field of the search. The search can be triggered using Search option from the menu bar and selecting ABAP Object Search, or using the keyboard shortcut of Control + H or using the Open ABAP Development Option or the using the keyboard shortcut Control + Shift + A. [Refer the screenshots below]</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-14 at 11.16.23 AM.png" style="width: 969px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/80628i36FC7F046A0FBB0F/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-14 at 11.16.23 AM.png" alt="Screenshot 2024-03-14 at 11.16.23 AM.png" /></span>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-03-14 at 11.19.49 AM.png" style="width: 382px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/80630iECAC7632F376F8C1/image-size/large?v=v2&amp;px=999" role="button" title="Screenshot 2024-03-14 at 11.19.49 AM.png" alt="Screenshot 2024-03-14 at 11.19.49 AM.png" /></span></P><P>This way one can list out the released API or artefacts for use in <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-5">SAP BTP, ABAP environment</a>, i.e., the objects that would always be available for use in <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-6">SAP BTP, ABAP environment</a>. [Refer to the blog <A href="https://community.sap.com/t5/application-development-blog-posts/searching-development-objects-with-the-abap-object-search/ba-p/13548451" target="_blank">Searching Development Objects with the ABAP Object Search&nbsp;</A>for better understanding of search options in ADT.]</P> 2024-03-14T11:31:39.570000+01:00 https://community.sap.com/t5/supply-chain-management-blogs-by-members/s4-fscm-custom-credit-check-rule-and-custom-credit-check-step/ba-p/13645138 S4-FSCM-Custom Credit Check Rule and Custom Credit Check Step 2024-03-21T15:00:51.335000+01:00 Satish_Kesavalu https://community.sap.com/t5/user/viewprofilepage/user-id/1391095 <P>To perform the credit check, Credit Profile needs to be set up for the business partner under the UKM000 role.&nbsp; Credit Profile of the Business partner drives the credit behavior of the Business partner.&nbsp; Under the credit profile Credit Check rule plays vital role in performing the Credit Check in the credit engine.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_0-1711004201667.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84165i08F0431EB104E651/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_0-1711004201667.png" alt="Satish_Kesavalu_0-1711004201667.png" /></span></P><P>&nbsp;</P><P>Every Credit Check rule can have one or multiple Check Steps that can be defined to execute.&nbsp; SAP had provided several Check Steps as shown below.</P><P>For Ex: SAP standard Check rule ‘01’ has several SAP check standard Check steps</P><P><STRONG><U>Navigate to the IMG Path : </U></STRONG></P><P>SPRO-&gt; Financial Supply Chain Management -&gt; Credit Management -&gt; Credit Risk Monitoring -&gt; Credit Limit Check -&gt; Define Check Rules</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_1-1711004246244.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84166i28EDDD4E4AD5BDD9/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_1-1711004246244.png" alt="Satish_Kesavalu_1-1711004246244.png" /></span></P><P>Select the Check rule and select Checks in the left side tree structure, to see the list of Credit check steps assigned and will be performed during credit check.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_2-1711004266254.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84167iAAFCACC486FE7C1D/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_2-1711004266254.png" alt="Satish_Kesavalu_2-1711004266254.png" /></span></P><P>Let us see the detailed steps on how to create Custom Credit check step and assign the Created credit check step to Custom Credit Check Rule and then assign the newly created Credit check Rule to the Business partner in the credit profile under the UKM000 BP role.</P><P><STRONG><U>Create Custom Credit Check Step ( Z10 ):-&nbsp; </U></STRONG></P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In this step lets us define to fail the credit check always.</P><P><STRONG><U>Navigate to the IMG Path : </U></STRONG></P><P>SPRO-&gt; Financial Supply Chain Management -&gt; Credit Management -&gt; Credit Risk Monitoring -&gt; Enhancements -&gt; BAdi: Individual step of Credit Check</P><P>Execute the step BAdi: Individual step of Credit Check</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_3-1711004315355.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84168iB72FD7DB8BDF01E4/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_3-1711004315355.png" alt="Satish_Kesavalu_3-1711004315355.png" /></span></P><P>Choose Create and Define the step Number Z10&nbsp; and the description as “Fail Credit Check always”</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_4-1711004332136.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84169i5D1477DE8167D8C1/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_4-1711004332136.png" alt="Satish_Kesavalu_4-1711004332136.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_5-1711004346714.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84170i85579DA442327649/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_5-1711004346714.png" alt="Satish_Kesavalu_5-1711004346714.png" /></span></P><P>In the Method CHECK_STEP, define the custom logic to decide the credit check should be successful or failed.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_6-1711004367183.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84171iC080BC201D5300A3/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_6-1711004367183.png" alt="Satish_Kesavalu_6-1711004367183.png" /></span></P><P>In this example we will define the Check Step to fail always.&nbsp;</P><P>Variable C_PASSED is cleared.</P><P>The below Custom error message can be populated into the return table parameter ct_results.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_7-1711004384790.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84172iFD4E400B9CA81C8B/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_7-1711004384790.png" alt="Satish_Kesavalu_7-1711004384790.png" /></span></P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>METHOD if_ex_ukm_check_step~check_step. DATA : lv_dummy TYPE string. CLEAR c_passed. MESSAGE e000(zcust_msg) INTO lv_dummy. CALL METHOD cl_ukm_credit_checker=&gt;add_reason EXPORTING i_check_step = flt_val io_account = io_account CHANGING ct_results = ct_results. ENDMETHOD.</code></pre><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_8-1711004424018.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84173iBE81FDA1B74797F7/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_8-1711004424018.png" alt="Satish_Kesavalu_8-1711004424018.png" /></span></P><P>Now we have created a New Custom Credit Check step.&nbsp; We need to assign this credit check step to Custom Check rule.</P><P>Now lets us create New Check Rule,</P><P><STRONG><U>Navigate to the IMG Path : </U></STRONG></P><P>SPRO-&gt; Financial Supply Chain Management -&gt; Credit Management -&gt; Credit Risk Monitoring -&gt; Credit Limit Check -&gt; Define Checking Rules</P><P>Create New entry with the Check Rule “Z2” and Name of Check Rule as “Fail Credit Check always”</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_9-1711004445328.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84174iCE8962BBC8AA9D52/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_9-1711004445328.png" alt="Satish_Kesavalu_9-1711004445328.png" /></span></P><P>Select the Check Rule and select Checks and assign the Newly created check step “Z10”</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_10-1711004470583.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84175i40A5DA29AB1F0430/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_10-1711004470583.png" alt="Satish_Kesavalu_10-1711004470583.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_11-1711004486245.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84176i2AB610A07F598E0A/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_11-1711004486245.png" alt="Satish_Kesavalu_11-1711004486245.png" /></span></P><P>Now we have completed the Creation of Custom Credit check Rule “Z2” and Check Step “Z10”.&nbsp; We can assign this Credit check rule Z2 to Business partner if the credit check needs to fail always for the Business partner whenever the credit check is performed for this BP.</P><P>Assign the Custom Credit Check Rule “Z2” to the Business Partner</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_12-1711004502038.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84177i3342AA4058BC26E8/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_12-1711004502038.png" alt="Satish_Kesavalu_12-1711004502038.png" /></span></P><P>We can perform the simulation of credit check to validate the credit check results of the custom Check Rule “Z2”</P><P>Navigate to the Credit Segment data of the Business Partner</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_13-1711004527452.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84178iD20AD531A791A853/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_13-1711004527452.png" alt="Satish_Kesavalu_13-1711004527452.png" /></span></P><P>and choose the “Simulate Credit check” option highlighted below</P><P>Note : Credit Segment master data should be created and the Credit limit of the Business Partner needs to be setup.&nbsp; *** creation of Credit segment master data will be explained in the upcoming blogs.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_14-1711004544089.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84179i7447807F4D153F3B/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_14-1711004544089.png" alt="Satish_Kesavalu_14-1711004544089.png" /></span></P><P>Provide the input value amount and Currency and choose Credit Check, the results is shown in the output.</P><P>Have you noticed the error message raised in the custom Check Step “Z10” is executed by the credit engine and the error message is displayed.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_15-1711004559552.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84180i829EA883B7031105/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_15-1711004559552.png" alt="Satish_Kesavalu_15-1711004559552.png" /></span></P><P>Now lets us see how we can perform the credit check of the given Business partner using the SAP standard Methods which in-turn provides the credit check results based on the newly created Check rule / Check Step.</P><P>Lets us create a custom Function Module which can in-turn call the SAP Standard Methods to perform the credit check.</P><P><STRONG>Import Parameters</STRONG></P><P>IM_BP&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp; BU_PARTNER&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Business Partner Number</P><P>IM_VKORG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp; VKORG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sales Organization / Credit segment</P><P>IM_NETWR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp; NETWR &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Net Value in Document Currency</P><P>IM_WAERS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp; WAERS &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Currency Key</P><P><STRONG>Export Parameters</STRONG></P><P>ET_QUERY_RESULTS&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp; UKM_T_QUERY_RESULTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Results of Internal Credit Query</P><P>Class CL_UKM_XI_FACADE<BR />Method IF_UKM_CREDIT_QUERY~CHECK_CREDIT</P><P>will perform the credit check and provide the results.&nbsp;</P><P>Explanation of the Import and export parameters for the Method IF_UKM_CREDIT_QUERY~CHECK_CREDIT</P><P>pass the BP / Credit Segment / Order Amount and Currency to the export parameter it_items which will return the Credit check results in the importing parameter et_query_results.</P><P>In this example, Credit segment is created for each Sales org with the same name as Sales org, hence Sales Org value is passed to the credit segment in the variable lv_creditsegment.</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>FUNCTION zbp_credit_check. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IM_BP) TYPE BU_PARTNER *" VALUE(IM_VKORG) TYPE VKORG *" VALUE(IM_NETWR) TYPE NETWR *" VALUE(IM_WAERS) TYPE WAERS *" EXPORTING *" REFERENCE(ET_QUERY_RESULTS) TYPE UKM_T_QUERY_RESULTS *" REFERENCE(EV_DENIAL_REASON) TYPE CHAR250 *"---------------------------------------------------------------------- DATA: lt_items TYPE ukm_t_check_item, lt_denial_reasons TYPE ukm_t_denial_reason. DATA : lv_creditsegment TYPE ukm_credit_sgmnt, lv_net_amount TYPE ukm_comm_actual_item. CLEAR : lv_creditsegment, lv_net_amount. lv_creditsegment = im_vkorg. lv_net_amount = im_netwr. lt_items = VALUE #( ( partner = im_bp credit_sgmnt = lv_creditsegment amount = lv_net_amount currency = im_waers schedule_data = VALUE #( ( effective_date = sy-datum amount = lv_net_amount currency = im_waers credit_sgmnt = lv_creditsegment partner = im_bp ) ) ) ). **** Method IF_UKM_CREDIT_QUERY~CHECK_CREDIT of Class CL_UKM_XI_FACADE **** will perform the credit check and provide the results TRY. cl_ukm_xi_facade=&gt;if_ukm_credit_query~check_credit( EXPORTING it_items = lt_items IMPORTING et_query_results = et_query_results ). ENDTRY. IF et_query_results[ 1 ]-passed IS INITIAL. *** Credit Check is failed lt_denial_reasons = et_query_results[ 1 ]-denial_reasons. LOOP AT lt_denial_reasons INTO DATA(ls_denial_reason) WHERE msgty = 'E'. CALL FUNCTION 'FORMAT_MESSAGE' EXPORTING id = ls_denial_reason-msgid lang = sy-langu no = ls_denial_reason-msgno v1 = ls_denial_reason-msgv1 v2 = ls_denial_reason-msgv2 v3 = ls_denial_reason-msgv3 v4 = ls_denial_reason-msgv4 IMPORTING msg = ev_denial_reason EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc &lt;&gt; 0. * Implement suitable error handling here ENDIF. ENDLOOP. ELSE. *** Credit check is successful ENDIF. ENDFUNCTION.</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>In the credit check result internal table parameter et_query_results if the parameter PASSED = ‘X’, then credit check is successful and if the parameter PASSED = space then credit check is failed.</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code> IF et_query_results[ 1 ]-passed IS INITIAL. *** Credit Check is failed ELSE. *** Credit check is successful ENDIF.</code></pre><P>&nbsp;</P><P>If the Credit check is failed, the denial reason is captured and sent by the method in the field denial_reasons in the internal table et_query_results</P><P>Take the necessary action based on the Credit check results</P><P>Create variable lt_denial_reason of type UKM_T_DENIAL_REASON and populate the denial reason.</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>lt_denial_reasons = et_query_results[ 1 ]-denial_reasons. LOOP AT lt_denial_reasons INTO DATA(ls_denial_reason) WHERE msgty = 'E'. ENDLOOP.</code></pre><P>&nbsp;</P><P>In the above screenshot, the Business partner has bee assigned with the Credit check rule “Z2”.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_16-1711004724310.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84182i5C837C6913E94031/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_16-1711004724310.png" alt="Satish_Kesavalu_16-1711004724310.png" /></span></P><P>Function Module will return the Denial reason similar to Simulation that was performed in the previous step.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Satish_Kesavalu_17-1711004738192.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/84183iEFD3DBB66C50E655/image-size/large?v=v2&amp;px=999" role="button" title="Satish_Kesavalu_17-1711004738192.png" alt="Satish_Kesavalu_17-1711004738192.png" /></span></P><P>Note :-&nbsp; The Error Message “Custom - Credit Check Blocked for all Scenarios”&nbsp; is raised from the Custom Credit check step configured and enabled in the above steps.</P><P>BADI UKM_CHECK_STEP and BADI Implementation ZIM_CUSTOM_CHECK is called when the credit check is performed using the SAP standard Method IF_UKM_CREDIT_QUERY~CHECK_CREDIT &nbsp;of Class CL_UKM_XI_FACADE.<BR /><BR /></P><P>Hope this blogs helps to understand the implementation of custom credit check.&nbsp;</P><P>Thanks all for your visit and support, please give Kudos if you like this page and provide comments.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P> 2024-03-21T15:00:51.335000+01:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-table-creation-maintenance-and-authorization/ba-p/13655060 SAP Table Creation, Maintenance, and Authorization 2024-04-02T01:06:55.258000+02:00 maheshsinghmony https://community.sap.com/t5/user/viewprofilepage/user-id/357842 <H2 id="toc-hId-990764118"><STRONG>Creating Custom Tables for Table Maintenance</STRONG></H2><P>Go to SE11 and give the table name that you want to create.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="maheshsinghmony_2-1712008821453.png" style="width: 538px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89352i24F01B4C8CB5D09F/image-dimensions/538x452?v=v2" width="538" height="452" role="button" title="maheshsinghmony_2-1712008821453.png" alt="maheshsinghmony_2-1712008821453.png" /></span></P><P>&nbsp;</P><H2 id="toc-hId-794250613">&nbsp;</H2><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId-597737108">&nbsp;</H2><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>Give the Description of the table and enter the following details.</P><H3 id="toc-hId-530306322"><STRONG>1. Delivery Class</STRONG></H3><H4 id="toc-hId-462875536">Delivery Class Used For</H4><UL><LI>A - Application table (master and transaction data).</LI><LI>C -Customer table: data is maintained by the customer only</LI><LI>L &nbsp;- Table for storing temporary data</LI><LI>G &nbsp;- Customer table, SAP may insert new data records, but may not overwrite or delete existing data records. The customer namespace must be defined in table TRESC. (Use Report RDDKOR54 here).</LI><LI>E - System table with its own namespaces for customer entries. The customer namespace must be defined in table TRESC. (Use Report RDDKOR54 here.)</LI><LI>S - System table, data changes have the same status as program changes.</LI><LI>W - System table (e.g. table of the development environment) whose data is transported with its own transport objects (e.g. R3TR PROG, R3TR TABL, etc.).</LI></UL><H3 id="toc-hId-137279312">2. Data Browser/Table View Maint.</H3><H4 id="toc-hId-69848526"><STRONG>Options Available</STRONG></H4><OL><LI><STRONG>Display/maintenance not allowed:&nbsp;</STRONG>The usage of standard table maintenance tools is not allowed.<UL><LI>Maintenance and display of this Dictionary object is not possible in transaction SE16.</LI><LI>Transaction SE54 does not allow the generation of a maintenance dialog, which means&nbsp;automatically calling transactions SM30/SM34 for this Dictionary object is no longer possible.</LI></UL></LI><LI><STRONG>Display/maintenance allowed to limited extent:&nbsp;</STRONG>Usage of standard table maintenance tools is allowed to a limited extent.<UL><LI>&nbsp;Transaction SE16 allows the display function for this Dictionary object, but no maintenance.</LI><LI>Generation of a maintenance dialog for this Dictionary object is possible using transaction SE54.</LI><LI>Transaction SM30 does not allow maintenance and display functions for this Dictionary object</LI></UL></LI><LI><STRONG>Display/maintenance allowed:&nbsp;</STRONG>The usage of standard table maintenance tools is allowed:<UL><LI>Transaction SE16 allows the maintenance and display functions for this Dictionary object.&nbsp;Note: If an SM30 maintenance dialog exists for this Dictionary object, it is called.</LI><LI>Transaction SE54 allows the generation of a maintenance dialog for this Dictionary object.</LI><LI>Transaction SM30 allows the display and maintenance functions for this Dictionary object.</LI></UL></LI></OL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_3-1712008893071.png" style="width: 706px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89354i84479E91CB70EA6C/image-dimensions/706x273?v=v2" width="706" height="273" role="button" title="maheshsinghmony_3-1712008893071.png" alt="maheshsinghmony_3-1712008893071.png" /></span></P><P><SPAN>Enter the Fields of the table.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_4-1712008905071.png" style="width: 706px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89355i9442EF62BAC32349/image-dimensions/706x334?v=v2" width="706" height="334" role="button" title="maheshsinghmony_4-1712008905071.png" alt="maheshsinghmony_4-1712008905071.png" /></span></P><P><STRONG>Significance of the Above fields:</STRONG></P><UL><LI><STRONG>LASTCHANGED:&nbsp;</STRONG>Username of the person who created or changed the data.</LI><LI><STRONG>CHANGEDATE:&nbsp;</STRONG>The date on which the records was created or changed.</LI><LI><STRONG>CHANGE_TIME:&nbsp;</STRONG>The time on which the records was created or changed.</LI><LI><STRONG>COMMENTS:&nbsp;</STRONG>The reason for the changes made to be specified by the user.</LI></UL><P>Once all the fields have been entered then, click on Technical Settings and enter the following details on the next screen:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_5-1712008947481.png" style="width: 709px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89356i77ADA00D3A749B0D/image-dimensions/709x622?v=v2" width="709" height="622" role="button" title="maheshsinghmony_5-1712008947481.png" alt="maheshsinghmony_5-1712008947481.png" /></span></P><H4 id="toc-hId--126664979"><STRONG>Data Class</STRONG></H4><P>The data class defines the physical area of the database (for ORACLE, the TABLESPACE) in which&nbsp;your table is logically stored. If you choose a data class correctly, your table will automatically be assigned to the&nbsp;correct area when it is created on the database.</P><P>The most important data classes are (other than the system data):</P><UL><LI><STRONG>APPL0:</STRONG><SPAN>&nbsp;</SPAN>Master data</LI><LI><STRONG>APPL1:</STRONG><SPAN>&nbsp;</SPAN>Transaction data</LI><LI><STRONG>APPL2:</STRONG><SPAN>&nbsp;</SPAN>Organizational and customizing data</LI></UL><P>Master data is data that is frequently read but rarely updated. Transaction data is data that is frequently updated. Organizational and customizing data is data that is defined when the system is initialized and then&nbsp;rarely changed.</P><P>Two more data classes are available, USR and USR1. These are reserved for user developments, and the tables assigned to these data classes are stored in a table space for user developments.</P><P><STRONG>Note:</STRONG><SPAN>&nbsp;</SPAN>The data class only has an effect on table storage for the database systems ORACLE and INFORMIX.</P><H4 id="toc-hId--323178484"><STRONG>Size Category</STRONG></H4><P>The size category determines the probable space requirement for a table in the database.</P><P>You can select categories 0 to 4 for your table. Each category is assigned a specific fixed storage area value in the database. When you create a table, initial space is saved for it in the database. If more space is required later due to data that has been entered, the storage space is increased in accordance with the category selected.</P><P>Press F4 on the field size category to see the number of data records that can be maintained for the individual categories of your table without complications ensuing. These complications could be for example a reorganization becoming necessary because the maximum space to be reserved for the table was exceeded due to the maintained size category.</P><H4 id="toc-hId--519691989"><STRONG>Buffering Status</STRONG></H4><P>The buffering status specifies whether or not a table may be buffered.</P><P>This depends on how the table is used, for example, on the expected volume of data in the table or on the type of access to a table (mainly read or mainly write access to the table). In the latter case, for example, one would not select buffering.</P><P>You should, therefore, select:</P><UL><LI>Buffering is not allowed if a table is not buffered.</LI><LI>Buffering allowed but not activated if buffering is principally allowed for a table, but at the moment no buffering should be active. The buffering type specified in this case is only a suggestion.</LI><LI>Buffering is allowed if the table should be buffered. In this case, a buffering type must be specified.</LI></UL><H4 id="toc-hId--1213922589"><STRONG>Buffering Type</STRONG></H4><P>The buffering type defines whether and how the table should be buffered.</P><P>There are the following types of buffering:</P><UL><LI>single-record buffering --&gt; Press F1 for more details</LI><LI>generic area buffering --&gt; Press F1 for more details</LI><LI>full buffering --&gt; Press F1 for more details</LI></UL><P>In generic area buffering, a number of key fields between 1 and no. of key fields-1 must be specified.</P><H4 id="toc-hId--1410436094">No. Of Key Fields for Generic Buffers</H4><P>If you read a record from a generically buffered table, all records whose left-justified part of the key corresponds to that of this record (generic key fields) are loaded into the buffer.</P><P>This left-justified part of the key is determined in this field by entering a number n of key fields. The first n key fields of the table are thus the generic key fields.</P><H3 id="toc-hId--1313546592">Create Authorization Object</H3><P>To create an Authorization Object, go to transaction SE54.</P><P>Enter the Table/View name for which the Authorization object has to be created.</P><P>Select the Radio Button ‘Authorization groups’.</P><P>Then click on Create/Change.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_6-1712009165816.png" style="width: 711px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89358i5657A38B2F53E744/image-dimensions/711x362?v=v2" width="711" height="362" role="button" title="maheshsinghmony_6-1712009165816.png" alt="maheshsinghmony_6-1712009165816.png" /></span></P><P><SPAN>Then, the next screen will give a list of Authorization Objects that are already present in the system. You can&nbsp;Select one of them from the available list as per the requirement.&nbsp;But if the table demands a new authorization object then click on New Entries pushbutton given on the&nbsp;screen.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_7-1712009187479.png" style="width: 700px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89359iA56AAF33076626E9/image-dimensions/700x660?v=v2" width="700" height="660" role="button" title="maheshsinghmony_7-1712009187479.png" alt="maheshsinghmony_7-1712009187479.png" /></span></P><P><SPAN>Enter the new authorization object name and description as shown in the screen below. The authorization object must follow a certain naming convention. (It should always start with 'Z'.) Click on Save</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_8-1712009306752.png" style="width: 702px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89361i7C194FED8BEE148B/image-dimensions/702x793?v=v2" width="702" height="793" role="button" title="maheshsinghmony_8-1712009306752.png" alt="maheshsinghmony_8-1712009306752.png" /></span></P><H2 id="toc-hId--1216657090">Table Maintenance Generator</H2><OL><LI>Go to SE12 transaction. Open the table for which the table maintenance is to be implemented.</LI><LI>Change it to the Editable mode and then click on Utilities -&gt; Table maintenance generator.</LI></OL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_9-1712009347030.png" style="width: 700px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89362i5D572F67AA9B752D/image-dimensions/700x402?v=v2" width="700" height="402" role="button" title="maheshsinghmony_9-1712009347030.png" alt="maheshsinghmony_9-1712009347030.png" /></span></P><P>Enter the following details on the next screen:</P><UL><LI><STRONG>Authorization group:&nbsp;</STRONG>Assigned/created for the table by following the procedure given in Section I.</LI><LI><STRONG>Function group:&nbsp;</STRONG>Name of the function group to which the generated maintenance modules will belong.</LI><LI><STRONG>Maintenance type:&nbsp;</STRONG>According to the table requirement, anyone should be selected.<UL><LI><STRONG>One step:&nbsp;</STRONG>Only one maintenance screen is processed during extended table maintenance. The entries are displayed in list form on this screen.</LI><LI><STRONG>T</STRONG><STRONG>wo step:&nbsp;</STRONG>Two maintenance screens are processed during the extended table maintenance:</LI></UL></LI></UL><P>On the Overview screen, the entries are displayed in list form.</P><P>One entry is displayed on the single screen. For every entry, the single screen can be called from the overview screen by pressing the function key.</P><H4 id="toc-hId--1999976609"><STRONG>Maintenance Screen No</STRONG></H4><P>According to the maintenance type selected, an overview screen and a single screen should be entered. Recording routine—This is an indicator of the recording routine that should be used for the table contents.</P><UL><LI>Standard recording routine</LI><LI>No, or user, recording routine</LI></UL><H4 id="toc-hId-2098477182"><STRONG>Compare Flag</STRONG></H4><P>This flag indicates whether the maintenance transaction allows the (checked) activation of Business Configuration Sets (BC Sets) and the adjustment. This is the case if the maintenance transaction can run in the background. There are four options present for the compare flag:</P><UL><LI>No Information</LI><LI>Not Adjustable</LI><LI>Adjustable in Dialog</LI><LI>Automatically Adjustable</LI></UL><P>Once done. Click on<SPAN>&nbsp;</SPAN><STRONG>Create</STRONG>.</P><H3 id="toc-hId--2099600612"><STRONG>Exceptions</STRONG></H3><P>If changes are made to the table after the generation of table maintenance, table maintenance should&nbsp;be re-generated for the table.</P><P>1. Click on Utilities -&gt; Table Maintenance Generator.</P><P>&nbsp;2. Click on the Edit button. A pop-up would ask for Reason for change. Select the appropriate reasons.</P><P>3. Then, Save the data.</P><P>4. Go to System -&gt; Status and copy the Program Name.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_10-1712009381104.png" style="width: 701px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89363i9D0A3FBD36DEC858/image-dimensions/701x505?v=v2" width="701" height="505" role="button" title="maheshsinghmony_10-1712009381104.png" alt="maheshsinghmony_10-1712009381104.png" /></span></P><H3 id="toc-hId-1998853179"><STRONG>Changing the Source Code of Table Maintenance</STRONG></H3><P>If fields like last changed on, last changed by, etc., are present in the table, logic should be included to save them by the system.</P><P>1. Go to transaction SE80 and open the program that was received from the above logic.</P><P>2. Go to the Screens drop-down list and click on 0001. In the PAI event of that screen, add a module to include the logic.</P><P>3. Double-click on the module. It will ask for the ‘Include’ in which this module should be included.</P><P>4. Select the Include where we need to include the logic.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_11-1712009417714.png" style="width: 700px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89364i40E6E8FC71B8834A/image-dimensions/700x578?v=v2" width="700" height="578" role="button" title="maheshsinghmony_11-1712009417714.png" alt="maheshsinghmony_11-1712009417714.png" /></span></P><P><SPAN>&nbsp;5. Enter the logic to update the table with the parameters --&gt; person responsible for making change, timestamp, etc. It is as shown below:</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_12-1712009453449.png" style="width: 701px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89365i89C5FF0B48490C4E/image-dimensions/701x240?v=v2" width="701" height="240" role="button" title="maheshsinghmony_12-1712009453449.png" alt="maheshsinghmony_12-1712009453449.png" /></span></P><P><SPAN>6. Go to the layout of the screen</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_13-1712009500128.png" style="width: 700px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89368i1A289E8F0CC4130C/image-dimensions/700x476?v=v2" width="700" height="476" role="button" title="maheshsinghmony_13-1712009500128.png" alt="maheshsinghmony_13-1712009500128.png" /></span></P><P><SPAN>7. Once you click on the Layout button, the screen below will appear.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_14-1712009535683.png" style="width: 717px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89369iAA4CF0AD1D493123/image-dimensions/717x243?v=v2" width="717" height="243" role="button" title="maheshsinghmony_14-1712009535683.png" alt="maheshsinghmony_14-1712009535683.png" /></span></P><P>8.&nbsp;<SPAN>Enter the text to be displayed as the column heading in the output screen.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_15-1712009573968.png" style="width: 706px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89370i9BC3CDF46AFFA94A/image-dimensions/706x343?v=v2" width="706" height="343" role="button" title="maheshsinghmony_15-1712009573968.png" alt="maheshsinghmony_15-1712009573968.png" /></span></P><P>9.&nbsp;<SPAN>Change the attributes of the fields of the table that are required to be non-editable as 'OUTPUT ONLY', i.e., the fields LASTCHANGED, CHANGEDATE, and CHANGE_TIME. The Columns will automatically be grayed out and uneditable on the output screen.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_16-1712009611255.png" style="width: 703px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89371i70C7D7DC899D6CE9/image-dimensions/703x482?v=v2" width="703" height="482" role="button" title="maheshsinghmony_16-1712009611255.png" alt="maheshsinghmony_16-1712009611255.png" /></span></P><P>10. Save and Activate the changes.</P><P>&nbsp;</P><H3 id="toc-hId-1802339674">Create Transaction</H3><P>1. To create a transaction, go to transaction SE93. Enter the transaction name which is to be created.</P><P>2. Click on Create.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_24-1712009988936.png" style="width: 701px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89374i66F8C47A96BC0410/image-dimensions/701x280?v=v2" width="701" height="280" role="button" title="maheshsinghmony_24-1712009988936.png" alt="maheshsinghmony_24-1712009988936.png" /></span></P><P>3. Enter the Short text and the Start Object and select Ok.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_25-1712010071812.png" style="width: 700px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89375i8C67C6D1801D8EE2/image-dimensions/700x417?v=v2" width="700" height="417" role="button" title="maheshsinghmony_25-1712010071812.png" alt="maheshsinghmony_25-1712010071812.png" /></span></P><P>4. Enter the below details and the Click on SAVE</P><P>&nbsp; &nbsp; &nbsp;<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1708721572863.png" style="width: 498px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89376i547086409AEFC432/image-dimensions/498x923?v=v2" width="498" height="923" role="button" title="1708721572863.png" alt="1708721572863.png" /></span></P><P>5. Enter the created T-code and the below screen would appear as output.</P><DIV class="">&nbsp;</DIV><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_26-1712010242009.png" style="width: 710px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89379i22EBFB7E69FA7A0E/image-dimensions/710x220?v=v2" width="710" height="220" role="button" title="maheshsinghmony_26-1712010242009.png" alt="maheshsinghmony_26-1712010242009.png" /></span></P><P>6. Click on the New Entries button to create an entry in the table. Enter the details and then click on SAVE.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_27-1712010259540.png" style="width: 699px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89381i9B6988789D01A410/image-dimensions/699x250?v=v2" width="699" height="250" role="button" title="maheshsinghmony_27-1712010259540.png" alt="maheshsinghmony_27-1712010259540.png" /></span></P><P>7. As soon as you click on the save button the username, Date and Time appears automatically.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_28-1712010314165.png" style="width: 701px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89384iAF36348D56FF1FA3/image-dimensions/701x234?v=v2" width="701" height="234" role="button" title="maheshsinghmony_28-1712010314165.png" alt="maheshsinghmony_28-1712010314165.png" /></span></P><P>8. You can check the same data in the Se16 transaction for the table.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maheshsinghmony_29-1712010330238.png" style="width: 703px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/89385i60C1D1CBDCA71278/image-dimensions/703x207?v=v2" width="703" height="207" role="button" title="maheshsinghmony_29-1712010330238.png" alt="maheshsinghmony_29-1712010330238.png" /></span></P><H2 id="toc-hId-1899229176"><STRONG>&nbsp;Conclusion:</STRONG></H2><P>I hope I was able to give you a little insight into how the you can create, maintain and add security on a custom SAP table.</P><P><SPAN>I would love to hear back suggestions, feedback and questions that you might have. Please do share the article with your Team members, Colleagues and Friends working in SAP and who use or plan to use SAP custom table to maintain critical data in SAP. Also, don’t forget to like and share the blog and follow me on SAP blogs to not miss more content:&nbsp;<A class="" href="https://community.sap.com/t5/user/viewprofilepage/user-id/357842" target="_self"><SPAN class="">maheshsinghmony</SPAN></A></SPAN></P><P><SPAN>Reference:&nbsp;<A href="https://dzone.com/articles/sap-table-creation-maintenance-and-authorization" target="_blank" rel="noopener nofollow noreferrer">https://dzone.com/articles/sap-table-creation-maintenance-and-authorization</A></SPAN></P> 2024-04-02T01:06:55.258000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/exploring-sap-extensibility-types-of-extensibilities/ba-p/13656258 Exploring SAP Extensibility - Types of Extensibilities 2024-04-02T22:28:55.301000+02:00 filipebst https://community.sap.com/t5/user/viewprofilepage/user-id/6881 <P><SPAN>In this blog post, I will give a brief explanation of the types of extensibilities offered by SAP: Key User (In-App) Extensibility, Developer (On-Stack) Extensibility, and Side-by-Side Extensibility on SAP Business Technology Platform (BTP). The intention is to provide just a brief summary for each type of extensibility available.</SPAN></P><DIV class=""><DIV class=""><DIV class=""><DIV><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><P><STRONG>Firstly, why is extensibility necessary?</STRONG> Despite SAP offering numerous standard solutions, there are instances where these solutions fail to align with the unique requirements of a client's business logic. Consequently, there is the necessity to customize the standard solutions provided by SAP to fulfill these specific requirements.</P></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV><P><STRONG>Key User (In-App) Extensibility:</STRONG></P><UL><LI><STRONG>Functionality:</STRONG> This extensibility type allows the customization of SAP Fiori apps, add application logic, create custom fields, expose data, develop custom forms, email templates, analytics, and business objects mostly without a single line of code.</LI><LI><STRONG>Targets:</STRONG> It is aimed at business users responsible for configuring and customizing SAP systems.</LI><LI><STRONG>Development Tools:</STRONG> SAP Fiori apps, Business Add-Ins (BAdIs), Core Data Services (CDS), SAP BAS, and SAP BTP.</LI><LI><STRONG>Technical Implementation:</STRONG>&nbsp;Key users can modify existing Fiori apps, integrate custom logic through BAdIs, extend standard business objects, generate custom CDS views and APIs, customize forms and email templates and develop custom analytics using CDS views.</LI></UL><P>Here's a video showing some examples of In-App Extensions: <A href="https://www.youtube.com/watch?v=pOOORn7fIR0" target="_blank" rel="noopener nofollow noreferrer">https://www.youtube.com/watch?v=pOOORn7fIR0</A></P><P>Here’s a scenario example of a Key User Extensibility:&nbsp;<A href="https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/#/ExtScenario/351" target="_blank" rel="noopener nofollow noreferrer">https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/#/ExtScenario/351</A></P><P>If you would like to implement this scenario you can follow this setup guide:&nbsp;<A href="https://help.sap.com/docs/SAP_EXTENSIBILITY_EXPLORER/397bf26514884cc8a5ece65970e8e3e6/3f898d6f59254ef497f00c78423cec7a.html" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/SAP_EXTENSIBILITY_EXPLORER/397bf26514884cc8a5ece65970e8e3e6/3f898d6f59254ef497f00c78423cec7a.html</A></P><P><STRONG>Developer (On-Stack) Extensibility:</STRONG></P><UL><LI><STRONG>Functionality:</STRONG> This extensibility provides flexibility to extend standard processes, develop custom OData services, and build custom APIs while isolating custom code from the digital core.</LI><LI><STRONG>Targets:</STRONG> It is aimed at ABAP developers.</LI><LI><STRONG>Development Tools:</STRONG> ABAP Development Tools in Eclipse and SAP Business Application Studio (BAS).</LI><LI><STRONG>Technical Implementation:</STRONG> Developers can utilize ABAP RESTful application programming model, CDS views, released DDIC objects, and local APIs to extend standard processes and develop custom services.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipebst_0-1712141932196.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/90396i0268A1204F0D74BA/image-size/medium?v=v2&amp;px=400" role="button" title="filipebst_0-1712141932196.png" alt="filipebst_0-1712141932196.png" /></span><BR /><FONT size="1 2 3 4 5 6 7">Image Source:&nbsp;<A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-extensibility-simplified-guide-for-beginners/ba-p/13548988" target="_blank">https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-extensibility-simplified-guide-for-beginners/ba-p/13548988</A></FONT></P><P>Here’s a scenario example of a Developer Extensibility: <A href="https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/#/ExtScenario/2851" target="_blank" rel="noopener nofollow noreferrer">https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/#/ExtScenario/2851</A></P><P>If you would like to implement this scenario you can follow this setup guide: <A href="https://help.sap.com/docs/SAP_EXTENSIBILITY_EXPLORER/c87ef8f108e147d6b7143fd3c0fb1459/5d131ae128ed4b4fae521dc3bf798c88.html" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/SAP_EXTENSIBILITY_EXPLORER/c87ef8f108e147d6b7143fd3c0fb1459/5d131ae128ed4b4fae521dc3bf798c88.html</A></P><P>Here’s a quick explanation and examples of RAP Extensibility: <A href="https://www.youtube.com/watch?v=YNOa1c0BxR0" target="_blank" rel="noopener nofollow noreferrer">https://www.youtube.com/watch?v=YNOa1c0BxR0</A></P><P><STRONG>Side-by-Side Extensibility on SAP BTP:</STRONG></P><UL><LI><STRONG>Functionality:</STRONG> SAP BTP serves as a unified platform for extending both cloud-based and on-premises SAP solutions, offering integration capabilities at various levels.</LI><LI><STRONG>Targets:</STRONG> It is suitable for JavaScript, Java developers with cloud-native expertise, and ABAP developers.</LI><LI><STRONG>Development Tools:</STRONG> Cloud-native tools and services provided by SAP BTP, such as SAP CAP, SAP Fiori tools, and SAP BAS.</LI><LI><STRONG>Technical Implementation:</STRONG> Implemented using cloud-native technologies and services within SAP BTP.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipebst_1-1712142022109.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/90398i498587CB4EF107A4/image-size/medium?v=v2&amp;px=400" role="button" title="filipebst_1-1712142022109.png" alt="filipebst_1-1712142022109.png" /></span><BR /><FONT size="1 2 3 4 5 6 7">Image Source:&nbsp;<A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-extensibility-simplified-guide-for-beginners/ba-p/13548988" target="_blank">https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-extensibility-simplified-guide-for-beginners/ba-p/13548988</A></FONT></P><P>Here’s a scenario example of a side-by-side extensibility: <A href="https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/#/ExtScenario/310" target="_blank" rel="noopener nofollow noreferrer">https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/#/ExtScenario/310</A></P><P>If you would like to implement this scenario you can follow this setup guide: <A href="https://help.sap.com/docs/SAP_EXTENSIBILITY_EXPLORER/b0e8d558ba2f47f5b02a3fc0ac9edc34/c9520e9b67dc4d04bdae124f46c23bff.html" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/SAP_EXTENSIBILITY_EXPLORER/b0e8d558ba2f47f5b02a3fc0ac9edc34/c9520e9b67dc4d04bdae124f46c23bff.html</A></P><P><STRONG>Developer (On-Stack) Extensibility VS Side-by-Side Extensibility on SAP BTP:</STRONG></P><P>In summary the <STRONG>Developer (On-Stack) Extensibility</STRONG> is ideal for extending standard SAP processes and functionalities within SAP S/4HANA, maintaining tight integration with the digital core while the <STRONG>Side-by-Side Extensibility on SAP BTP</STRONG> is suited for developing independent applications or extensions that enhance and extend the capabilities of SAP solutions, enabling agility and innovation in addressing specific business needs.</P><P><STRONG>Conclusion:</STRONG><SPAN> SAP's extensibility options provide organizations with the flexibility and scalability needed to adapt their ERP solutions to evolving business requirements. Whether it's extending standard SAP processes within SAP S/4HANA or developing standalone applications on SAP BTP, businesses can leverage these extensibility capabilities to drive agility, innovation, and growth in today's dynamic business landscape. I hope that with this blog you now have a more clear understanding of the different type of extensibilities there are and which ones your work assigns to.</SPAN></P><P><SPAN>If you want to have a more detailed vision of SAP Extensibility read this blog from&nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/10685">@Raja</a>&nbsp;-&nbsp;<A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-extensibility-simplified-guide-for-beginners/ba-p/13548988" target="_blank">https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-extensibility-simplified-guide-for-beginners/ba-p/13548988&nbsp;</A></SPAN><SPAN>(Thank you&nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/60019">@PedroLopes</a>&nbsp;for the share).</SPAN></P> 2024-04-02T22:28:55.301000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/workload-analysis-for-hana-platform-series-3-identify-the-memory/ba-p/13659746 Workload Analysis for HANA Platform Series - 3. Identify the Memory Consumption 2024-04-08T18:25:56.713000+02:00 tao_shen https://community.sap.com/t5/user/viewprofilepage/user-id/276170 <DIV class=""><SPAN>In our previous blog, we explored the essentials of CPU analysis. Today, we shift our focus to memory-related workload patterns in SAP HANA, aiming to derive actionable insights for optimizing memory resource utilization in the HANA system.</SPAN></DIV><DIV class=""><P><STRONG>Grasping the SAP HANA Memory Components</STRONG></P><P>Effective memory consumption analysis in SAP HANA begins with a thorough understanding of its memory components. SAP HANA's memory architecture comprises various elements, each with distinct functions or usage patterns, as detailed in SAP Note <A href="https://me.sap.com/notes/1999997" target="_blank" rel="noopener noreferrer">1999997 - FAQ: SAP HANA Memory</A>. In this article, we concentrate specifically on memory utilized by HANA services.</P></DIV><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tao_shen_0-1712369743174.png" style="width: 544px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92260i25F76DD943D2DEAD/image-dimensions/544x200?v=v2" width="544" height="200" role="button" title="tao_shen_0-1712369743174.png" alt="tao_shen_0-1712369743174.png" /></span></P><P>SAP HANA's used memory is primarily categorized into <STRONG>shared memory and heap memory.</STRONG> <STRONG>Shared memory</STRONG> stores system information and row store tables. Typically, shared memory poses minimal performance risks. However, exceptions occur, such as in BW on HANA systems with extensive row store tables, where excessive shared memory usage might trigger frequent out-of-memory dumps.</P><P><STRONG>Heap memory</STRONG>, on the other hand, is an exclusive domain accessible only by a process's threads. This segment is our primary focus, as significant fluctuations in heap memory often correlate with performance issues and system instability. Identifying workload patterns here is crucial, particularly when a single costly statement or an impractical parameter (e.g., inefficient memory garbage collection) exists without appropriate workload management strategies (like workload classes). Understanding heap memory intricacies is thus imperative.</P><P>Within heap memory, our primary concerns include, but are not limited to:</P><UL><LI>Column Store</LI><LI>Page Cache</LI><LI>Other Heap Allocators</LI><LI>Intermediate Results</LI><LI>Fragmentation</LI></UL><P><STRONG>Initiating Memory Consumption Analysis in SAP HANA</STRONG></P><P>Having familiarized ourselves with SAP HANA's memory components, the next step is to pinpoint potential causes of high memory usage across these components, aligning this investigation with workload patterns, particularly in heap memory. Let's delve deeper into each sub-component:</P><UL><LI>In optimally configured systems, the <STRONG>column store</STRONG> often occupies about half of the heap memory. Implementing a sensible data retention policy helps maintain stability in this area. However, challenges like uncontrolled table logs, redundant data, and inadequate partitions leading to excessive memory loads often inflate the column store's size.</LI><LI>A disproportionately large <STRONG>page allocator</STRONG> typically signals an overextended child allocator, such as page caches. Identifying and optimizing the underlying child allocator is crucial. For instance, size of page allocator "Pool/PersistenceManager/PersistentSpace/DefaultLPA" significantly impacted by page caches, including data, LOB, or shadow pages. Proper table sizing and specific settings (like file or hybrid LOBs) are key to managing this memory consumption.</LI><LI>Analyzing other <STRONG>heap allocators and intermediate results</STRONG> is complex, as these areas are closely tied to costly statements and execution engines. SAP&nbsp;Note&nbsp;<A href="https://me.sap.com/notes/1999997" target="_blank" rel="noopener noreferrer">1999997 - FAQ: SAP HANA Memory</A>&nbsp;details frequent allocators, each providing unique insights. Some allocators point to potential performance issues, which are vital in workload analysis. However, linking high-memory allocators to specific expensive statements can be challenging, as their behavior often results from multiple combined statements.</LI><LI><STRONG>Memory fragmentation</STRONG> is a common occurrence in HANA systems, but its extent requires careful monitoring. Long-running jobs or increased MVCC versions can hinder garbage collection, leading to continuous memory increase without proper reclamation.</LI><LI><STRONG>Row stores</STRONG> play a pivotal role in BW on HANA systems. While converting some BW tables from column store to row store might be advantageous, this needs to be judiciously executed. Excessive or oversized row store tables can severely impact heap memory, potentially triggering out-of-memory dumps during job execution. This is because row store tables require full memory loading, unlike column store tables, which load selectively based on pages, columns, or partitions.</LI></UL><P><STRONG>Tools for Identifying SAP HANA Memory Patterns</STRONG></P><P>To effectively diagnose memory-related issues in SAP HANA, a variety of tools are at our disposal. While not every situation may be straightforwardly deciphered through these tools, their usage is a critical first step in understanding and addressing potential problems.</P><P>Begin with memory-related system views for an initial assessment. These views provide a snapshot of the current memory status:</P><OL><LI><STRONG>HANA_Memory_Caches_Overview</STRONG>: Offers an overview of memory caches.</LI><LI><STRONG>HANA_Memory_ContextMemory</STRONG>: Details memory within specific contexts.</LI><LI><STRONG>HANA_Memory_Components</STRONG>: Breaks down memory by individual components.</LI><LI><STRONG>HANA_Memory_MemoryObjects</STRONG>: Lists various memory objects.</LI><LI><STRONG>HANA_Memory_Overview</STRONG>: Gives a comprehensive view of memory usage.</LI></OL><P>For analyzing workload over a specific period, the following system monitoring views are invaluable for capturing historical data:</P><OL><LI><STRONG>HANA_Memory_Heap_Allocations</STRONG>: Tracks heap memory allocations.</LI><LI><STRONG>HANA_Memory_Reclaims</STRONG>: Details memory reclamation events.</LI><LI><STRONG>HANA_Memory_TopConsumers</STRONG>: Identifies the top memory consumers.</LI><LI><STRONG>HANA_Memory_OutOfMemoryEvents</STRONG>: Records out-of-memory events.</LI><LI><STRONG>HANA_SQL_SQLCache</STRONG>: Monitors SQL cache usage.</LI><LI><STRONG>HANA_SQL_ExpensiveStatements</STRONG>: Lists costly SQL statements.</LI></OL><P>Some monitoring views may not provide direct insights into memory components but are crucial for uncovering underlying memory consumption and related issues:</P><OL><LI><STRONG>HOST_SERVICE_THREAD_SAMPLES</STRONG>: Analyzes thread samples on the host.</LI><LI><STRONG>HOST_LONG_RUNNING_STATEMENTS</STRONG>: Identifies long-running SQL statements.</LI><LI><STRONG>TABLE_PARTITIONS</STRONG>: Reviews table partition details.</LI><LI><STRONG>HOST_SERVICE_THREAD_CALLSTACKS</STRONG>: Examines call stacks of service threads.</LI></OL><P>In the following section, I will present two case studies demonstrating how these tools can be used to identify memory patterns, along with root causes and solutions for common scenarios in SAP HANA.</P><P><STRONG>Analyzing Memory Consumption Issues: Two Practical Examples</STRONG></P><P><STRONG>Example 1:&nbsp;</STRONG><STRONG>Analyzing Memory Component Patterns</STRONG></P><P>In SAP HANA memory analysis, the initial step often involves examining the top memory consumers. This is crucial when addressing memory issues or analyzing memory patterns. Let's explore this process with an example, focusing on high-level and detailed components.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tao_shen_0-1712415033076.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92295iF4E4D1E0C78FDC0D/image-size/large?v=v2&amp;px=999" role="button" title="tao_shen_0-1712415033076.png" alt="tao_shen_0-1712415033076.png" /></span></P><UL><LI><P><STRONG>Level 1 Memory Usage Analysis</STRONG></P><P>First, we assess the highest level of memory usage. In our demo system, we observed that the column store is a primary memory consumer, reaching approximately 1,500 GB with a continuous growth over a month. The next significant component is heap memory, fluctuating between 500 GB and 1,600 GB. Although heap memory is smaller than the column store in the above example, it demands close attention due to its potential for large consumption variations and complex underlying causes. In this system, row store also holds a significant size (around 200 GB), which, while not critical, should be monitored for growth.</P></LI><LI><P><STRONG>Diving into Level 2 Components</STRONG></P><P>Upon delving into heap memory, we identify sub-components that contribute notably to memory consumption or exhibit significant fluctuations. In this instance, the sub-components 'Heap (Statement Execution &amp; Intermediate Results)', 'Heap (System - Page Cache)', and 'Heap (Monitoring &amp; Statistical data)' are of particular interest. They showed substantial growth or wide-ranging memory consumption over the observed month, signalling potential areas for deeper analysis.</P></LI><LI><P><STRONG>Zooming in on Specific Sub-Components</STRONG></P><P>Further dissecting these level 2 components, we find that 'Heap (System - Page Cache)', for example, is composed of various page caches like:</P><UL class="lia-list-style-type-circle"><LI>Pool/PersistenceManager/PersistentSpace/DefaultLPA/LOBPage</LI><LI>Pool/PersistenceManager/PersistentSpace/DefaultLPA/DataPage</LI><LI>Pool/PersistenceManager/PersistentSpace/DefaultLPA/LOBPageControlblock</LI><LI>Pool/PersistenceManager/PersistentSpace/DefaultLPA/DataPageControlblock</LI></UL></LI></UL><P>Understanding these detailed components is vital for pinpointing specific issues and guiding thorough analysis. In this case, a potential reason for high memory consumption might be tables with a large number of LOBs. Considering alternatives like hybrid LOBs or converting single file LOBs to packed LOBs could be effective strategies.</P><P>Compared to CPU utilization analysis, memory consumption analysis can be more challenging due to its complexity and the need to correlate memory components with specific queries. In our next example, we will explore techniques for capturing statement information and integrating it with memory consumption patterns.</P><P><STRONG>Example 2: Identifying Memory Contributors in SAP HANA</STRONG></P><P><SPAN>Understanding the root causes of memory consumption is critical in SAP HANA. Often, expensive SQL statements are major contributors, influenced by factors like workload management methods, HANA engine usage, or logical design leading to substantial intermediate results. This analysis aims to pinpoint these contributors and their impact on memory.</SPAN></P><P><SPAN>When a statement is executed in HANA, it can be processed by different engines, such as the Join, OLAP, or HEX engines. This selection is based on various factors, including table size, partitions, and replicas. Each engine choice affects the behavior of the statement, including execution time, thread involvement, and heap memory consumption. While we won't delve deeply into engine selection, this information is key in tracing the source of high heap memory usage.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tao_shen_1-1712421221446.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/92299i6D0312CB74EC50D2/image-size/large?v=v2&amp;px=999" role="button" title="tao_shen_1-1712421221446.png" alt="tao_shen_1-1712421221446.png" /></span></P><P><SPAN>Data captured from HANA Service Thread Samples&nbsp;</SPAN>(Please refer to <A href="https://community.sap.com/t5/technology-blogs-by-sap/workload-analysis-for-hana-platform-series-1-define-and-understand-the/ba-p/13608296" target="_self">Define and Understand the Workload Pattern</A>), filtered to include thread details with keywords like "JE(", reveals the HANA JOIN engine involved in specific statement executions. By cross-referencing this with top memory consumer data, we can sometimes identify if an expensive statement significantly contributes to heap memory allocation. Typical memory allocators to monitor include:</P><UL><LI>Pool/JoinEvaluator/JERequestedAttributes/Results</LI><LI>Pool/JoinEvaluator/JECreateNTuple</LI><LI>Pool/JoinEvaluator/JEStep1</LI><LI>Pool/JoinEvaluator/NTuple</LI><LI>etc.</LI></UL><P><SPAN>If these allocators show increased activity alongside expensive statement execution, they become potential candidates as major memory contributors.&nbsp;To confirm our findings, we should cross-check with other data sources as well, such as:</SPAN></P><UL><LI>HANA SQL CACHE</LI><LI>HANA Expensive Statement Trace</LI><LI>HANA Executed Statement Trace</LI></UL><P><SPAN>It's important to note that a high number of running threads does not necessarily equate to significant memory usage. The focus should be on the statement itself and its actual memory impact.</SPAN></P><P><SPAN>While thread sample analysis is insightful, it’s just one method among many for memory pattern analysis in SAP HANA. We must remember that memory analysis within workload analysis is a vast and complex field.</SPAN></P><DIV class="">&nbsp;</DIV><DIV class=""><SPAN>There are other important aspects, like analyzing Out-of-memory dumps and understanding the objects within the SQL cache. The topic of memory in HANA is extensive and cannot be fully covered in a single article. Moreover, there's no one-size-fits-all approach to memory issue analysis. Future discussions will delve into these and other complex areas of memory management in SAP HANA.</SPAN></DIV><DIV class="">&nbsp;</DIV><DIV class="">&nbsp;</DIV><DIV class=""><SPAN class="lia-unicode-emoji"><span class="lia-unicode-emoji" title=":hear_no_evil_monkey:">🙉</span></SPAN><SPAN class="lia-unicode-emoji"><span class="lia-unicode-emoji" title=":see_no_evil_monkey:">🙈</span></SPAN><SPAN class="lia-unicode-emoji"><span class="lia-unicode-emoji" title=":speak_no_evil_monkey:">🙊</span></SPAN></DIV><P><STRONG>Workload Analysis for HANA Platform Series</STRONG></P><P>This blog post is part of the 'Workload Analysis for HANA Platform Series'. In upcoming posts, we will demonstrate how to analyze the issue related to CPU, threads and NUMA Node . Here's what you can look forward to in this series:</P><UL class="lia-list-style-type-disc"><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/workload-analysis-for-hana-platform-series-0-hana-workload-analysis/ba-p/13605267" target="_self">0. HANA Workload Analysis Overview</A></LI><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/workload-analysis-for-hana-platform-series-1-define-and-understand-the/ba-p/13608296" target="_self">1. Define and Understand the Workload Pattern</A></LI><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/workload-analysis-for-hana-platform-series-2-analyze-the-cpu-threads-and/ba-p/13608317" target="_self">2. Analyze the CPU, Threads and Numa Utilizations</A></LI><LI><STRONG>3. Identify the Memory Consumption&nbsp;(This blog)</STRONG></LI><LI>4. How the Network, I/O and locks influent the workload</LI><LI>5. Performance Impact by HANA Internal Functions</LI><LI>6. HANA Workload Management Methodology</LI></UL><P><SPAN>Stay tuned as we explore these aspects in detail, providing insights and strategies to optimize your HANA environment.</SPAN></P> 2024-04-08T18:25:56.713000+02:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/how-to-find-the-specific-abap-code-that-is-updating-any-logic-in-a-smart/ba-p/13670775 How to find the specific ABAP Code that is updating any Logic in a Smart Way in enhancements also? 2024-04-15T11:45:52.565000+02:00 arghadipkar3013 https://community.sap.com/t5/user/viewprofilepage/user-id/686417 <P>&nbsp;</P><P>&nbsp;</P><P><STRONG>Procedure 1</STRONG><BR /><BR /><STRONG>For SAP ECC and SAP S/4HANA</STRONG><BR /><BR /><SPAN>Go to Transaction Code SE38 and Execute Program RS_ABAP_SOURCE_SCAN</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_0-1713173890920.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96515i05B27D8AB1E8E488/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_0-1713173890920.png" alt="arghadipkar3013_0-1713173890920.png" /></span></P><P>&nbsp;</P><P><BR /><SPAN>Provide the below Parameter and Execute</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_1-1713173890952.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96516i737D04F7148FB117/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_1-1713173890952.png" alt="arghadipkar3013_1-1713173890952.png" /></span></P><P>&nbsp;</P><P><BR /><SPAN>Wala below is the result</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_2-1713173890997.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96517i0458B09CEB7AD5A5/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_2-1713173890997.png" alt="arghadipkar3013_2-1713173890997.png" /></span></P><P>&nbsp;</P><P><BR /><STRONG>Procedure 2</STRONG><BR /><BR /><STRONG>Login to SAP S/4HANA and Go to Transaction Code CODE_SCANNER</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_3-1713173890935.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96518i41AAA26486A360B9/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_3-1713173890935.png" alt="arghadipkar3013_3-1713173890935.png" /></span></P><P>&nbsp;</P><P><BR /><SPAN>Suppose I want to find all the Program/Enhancement that has mentioned the Check " = 'SAP_WFRT' "</SPAN><BR /><BR /><SPAN>In the below screenshot we are only restricting to Z Packages. Now Execute</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_4-1713173890981.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96519i3CDB2D037412EAE3/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_4-1713173890981.png" alt="arghadipkar3013_4-1713173890981.png" /></span></P><P>&nbsp;</P><P><BR /><SPAN>Wala below is my result.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_5-1713173890996.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96520i744855698A9F6B8B/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_5-1713173890996.png" alt="arghadipkar3013_5-1713173890996.png" /></span></P><P>Procedure 3:&nbsp;</P><P>Go to Tcode EWK1</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_6-1713173932984.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96521i0D25F27BF9036A7F/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_6-1713173932984.png" alt="arghadipkar3013_6-1713173932984.png" /></span></P><P>Wala we found this</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_7-1713174077940.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/96522i629AD6719B87C76A/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_7-1713174077940.png" alt="arghadipkar3013_7-1713174077940.png" /></span></P><P><a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-1">SAP BTP, ABAP environment</a>, <a href="https://community.sap.com/t5/c-khhcw49343/ABAP+Connectivity/pd-p/266264953119842772207986043063520" class="lia-product-mention" data-product="313-1">ABAP Connectivity</a>&nbsp;</P> 2024-04-15T11:45:52.565000+02:00 https://community.sap.com/t5/application-development-blog-posts/debug-application-job-on-s-4hana-public-cloud/ba-p/13666050 Debug Application Job on S/4HANA Public Cloud 2024-04-16T13:01:48.420000+02:00 Juwin https://community.sap.com/t5/user/viewprofilepage/user-id/169790 <P>As of today (Apr 10, 2024), SAP has not provided a method to debug application job on S/4HANA Public Cloud (related <A href="https://community.sap.com/t5/enterprise-resource-planning-q-a/how-to-debug-an-application-job-in-s-4hana-public-cloud-similar-to/qaq-p/13582870" target="_blank">Question</A>&nbsp;by <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/837548">@rammel</a>&nbsp;) or provided a method to pass parameters to the class via IF_OO_ADT_CLASSRUN (related <A href="https://community.sap.com/t5/application-development-discussions/get-parameters-with-if-oo-adt-classrun/m-p/12740178" target="_blank">Question</A>&nbsp;by <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/139499">@fabianlupa</a>&nbsp;answered by <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/181866">@horst_keller</a>&nbsp;). Below is a workaround method until SAP provides a way to do either of these options.</P><P>Every Class used in a Custom Job catalog uses interfaces IF_APJ_DT_EXEC_OBJECT and IF_APJ_RT_EXEC_OBJECT. IF_APJ_DT_EXEC_OBJECT~GET_PARAMETERS provides the parameter definition and IF_APJ_RT_EXEC_OBJECT~EXECUTE is responsible to receive the job parameters from the caller and execute the business logic.</P><P>The idea implemented here, is to create a wrapper to reuse this functionality to call the Execute method. The wrapper is created as a HTTP service so that it can be called from external parties to pass the required parameters.</P><P>So, first lets create a HTTP service. If you plan to use the plugin attached here, then please make sure to use the same name for HTTP service as&nbsp;<SPAN>ZSRV_ADT_PLUGIN_EXEC_JOBCLASS, since that name is used in the plugin.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-04-11 03_48_08-Doc1 - Word.png" style="width: 868px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94948iE29CEF5BBFF15359/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-11 03_48_08-Doc1 - Word.png" alt="2024-04-11 03_48_08-Doc1 - Word.png" /></span></P><P>Below is the code I used in the handler class. Please feel free to improvise this class, to have better authorization checks or validations according to your needs.</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>class zcl_adt_plugin_exec_jobclass definition public create public . public section. interfaces if_http_service_extension . protected section. private section. endclass. class zcl_adt_plugin_exec_jobclass implementation. method if_http_service_extension~handle_request. types: lty_char type c length 100, ltyt_range type range of lty_char. data: lo_definition type ref to if_apj_dt_exec_object, lo_runtime type ref to if_apj_rt_exec_object, lt_values type if_apj_rt_exec_object=&gt;tt_templ_val, begin of ls_value, param type string, range type ltyt_range, end of ls_value, lv_params type string. data(lt_form) = request-&gt;get_form_fields( ). loop at lt_form reference into data(lo_form). translate lo_form-&gt;name to upper case. endloop. read table lt_form into data(ls_form) with key name = 'CLASSNAME'. if sy-subrc eq 0. try. translate ls_form-value to upper case. create object lo_definition type (ls_form-value). create object lo_runtime type (ls_form-value). lo_definition-&gt;get_parameters( importing et_parameter_def = data(lt_params) ). catch cx_root into data(lo_root). response-&gt;set_text( |Class { ls_form-value } is invalid| ). response-&gt;set_status( 400 ). return. endtry. case request-&gt;get_method( ). when 'GET'. loop at lt_params into data(ls_param). lv_params = lv_params &amp;&amp; cond #( when lv_params is not initial then ',' &amp;&amp; cl_abap_char_utilities=&gt;newline ) &amp;&amp; |"{ ls_param-selname }":| &amp;&amp; cond #( when ls_param-kind = 'S' then |[\{"SIGN":"I","OPTION":"EQ","LOW":"","HIGH":""\}]| else |""| ). endloop. lv_params = |\{{ cl_abap_char_utilities=&gt;newline }{ lv_params }{ cl_abap_char_utilities=&gt;newline }\}|. response-&gt;set_text( lv_params ). when 'POST'. try. data(lv_body) = request-&gt;get_text( ). loop at lt_params into ls_param. /ui2/cl_json=&gt;deserialize( exporting json = lv_body name_mappings = value #( ( abap = cond #( when ls_param-kind = 'S' then 'RANGE' else 'PARAM' ) json = ls_param-selname ) ) changing data = ls_value ). if ls_param-kind = 'S'. loop at ls_value-range into data(ls_rng). append value #( selname = ls_param-selname sign = ls_rng-sign option = ls_rng-option low = ls_rng-low high = ls_rng-high ) to lt_values. endloop. elseif ls_value-param is not initial. append value #( selname = ls_param-selname low = ls_value-param ) to lt_values. endif. clear ls_value. endloop. lo_runtime-&gt;execute( lt_values ). catch cx_root. response-&gt;set_status( 400 ). return. endtry. endcase. response-&gt;set_content_type( 'application/json' ). response-&gt;set_status( 200 ). endif. endmethod. endclass.</code></pre><P>&nbsp;</P><P>If you plan to use the custom plugin, then copy the plugin to the plugins folder of your Eclipse installation.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_1-1712762671534.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94758i1951C0CA5E5E369C/image-size/large?v=v2&amp;px=999" role="button" title="Juwin_1-1712762671534.png" alt="Juwin_1-1712762671534.png" /></span></P><P>Close the eclipse application and re-open it from command line using command&nbsp;<STRONG>eclipse.exe -clean</STRONG>, so that it re-reads the plugin folder.</P><P>Now, logon to SAP system via eclipse. In order to activate debugging request from plugin, please activate the following checkbox, for the ABAP Cloud Project.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_2-1712762812471.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94759i2DB6E1BADE66F659/image-size/large?v=v2&amp;px=999" role="button" title="Juwin_2-1712762812471.png" alt="Juwin_2-1712762812471.png" /></span></P><P>Open the custom Job Catalog related to the class that you would like to debug. Once you are the Job Catalog editor, open Run menu. If Eclipse found and installed the plugin correctly, then you should be able to see a new option saying "Run Job Class" as highlighted below. <EM>(This option will only be visible while on Job Catalog editor view)</EM></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_4-1712763000566.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94762i455CF4893F32FEA6/image-size/large?v=v2&amp;px=999" role="button" title="Juwin_4-1712763000566.png" alt="Juwin_4-1712763000566.png" /></span></P><P>Now, open the related class and add a breakpoint in the Execute method of the Class.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_3-1712762921101.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94760i39AE6DB3CC0A0938/image-size/large?v=v2&amp;px=999" role="button" title="Juwin_3-1712762921101.png" alt="Juwin_3-1712762921101.png" /></span></P><P>You can now go back to the Job Catalog Editor and select the option&nbsp;"Run Job Class". This will call the custom HTTP service that was created and which will internally create a JSON payload of the parameter list. It will then popup a dialog for you to edit the JSON.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_5-1712763138414.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94763i3CA542BC91434C0D/image-size/medium?v=v2&amp;px=400" role="button" title="Juwin_5-1712763138414.png" alt="Juwin_5-1712763138414.png" /></span></P><P>Modify the payload to pass values to each of the provided parameters in the JSON and hit OK.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_6-1712763184673.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94764i4DE315286624943E/image-size/medium?v=v2&amp;px=400" role="button" title="Juwin_6-1712763184673.png" alt="Juwin_6-1712763184673.png" /></span></P><P>If you have setup everything right, then a new Debugger session will start and break at the breakpoint that you have set earlier.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juwin_7-1712763240136.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/94765i844FD2FA0A93778C/image-size/large?v=v2&amp;px=999" role="button" title="Juwin_7-1712763240136.png" alt="Juwin_7-1712763240136.png" /></span></P><P>If you do not plan to use the plugin, other options may be to use tools like Postman or Restman to GET or POST, JSON payloads to the custom HTTP service.</P><P>Plugin can be downloaded from <A href="https://github.com/tjuwin1/PublicFiles/raw/main/executeJobClass_1.0.0.202404100358.jar" target="_self" rel="nofollow noopener noreferrer">here</A>.</P><P>&nbsp;</P><P>&nbsp;</P> 2024-04-16T13:01:48.420000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/capture-your-own-workload-statistics-in-the-abap-environment-in-the-cloud/ba-p/13667180 Capture Your Own Workload Statistics in the ABAP Environment in the Cloud 2024-04-18T13:02:05.620000+02:00 christiancop https://community.sap.com/t5/user/viewprofilepage/user-id/625488 <P>As an administrator in <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-1">SAP BTP, ABAP environment</a> or in <a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA+Cloud+ABAP+Environment/pd-p/60907aa9-99e9-4d5d-9103-8b970e9bc0a4" class="lia-product-mention" data-product="39-1">SAP S/4HANA Cloud ABAP Environment</a>, it’s important to keep track of performance issues and identify bottlenecks. Now SAP offers a few Fiori apps to help you with monitoring the system workload. However, relying on what data the system automatically collects for you sometimes isn’t enough.</P><P>Instead, you want to define yourself what kind of workload information is captured, such as in the following use cases:</P><UL><LI>Standard apps and tools show you that there’s a high workload, but when you drill down to details, you don’t get the information you’re interested in.</LI><LI>You want to monitor the workload of a clearly defined special case, such as the workload generated by a user or by one of your custom apps (which you might want to watch using its request entry point).</LI><LI>You have specific requests where you want to get alerted when the workload, for example, exceeds a defined threshold.</LI></UL><P>In this blog post, I’ll show you how to use the <EM>Capture Request Statistics</EM> app to cover these use cases.</P><H3 id="toc-hId-1120830963"><SPAN class=""><SPAN class="">Background: the System </SPAN></SPAN><SPAN class=""><SPAN class="">Workload</SPAN></SPAN><SPAN class=""><SPAN class=""> App</SPAN></SPAN></H3><P><SPAN>Before I introduce you to the <EM>Capture Request Statistics</EM> app, let me start with a brief recap of what the <EM>System Workload</EM> app can do for you out of the box (for more details, see the blog post </SPAN><SPAN><A href="https://blogs.sap.com/2023/04/24/analyzing-performance-degradations-in-the-abap-environment-in-the-cloud/" target="_blank" rel="noopener noreferrer">Analyzing performance degradations in the ABAP environment in the Cloud</A></SPAN><SPAN>).</SPAN></P><P>Let’s say you want to analyze the performance of your ABAP system in the <EM>System Workload</EM> app:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="System Workload app" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95592iD385E7CF005F9EA9/image-size/large?v=v2&amp;px=999" role="button" title="TM_System_Workload.png" alt="System Workload app" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">System Workload app</span></span></P><P><SPAN>You find the top resource-consuming application in the system and want to analyze it further. You can analyze this application in more detail by choosing the </SPAN><EM>Details</EM><SPAN> arrow at the end of the row. In the following screen, you typically find samples of single ABAP statistics records for this workload. Now, how are these ABAP statistics records collected by default and how can you influence what is captured? Let's take a look behind the scenes.</SPAN></P><H3 id="toc-hId-924317458"><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Default Configuration: Capture Workload Statistics with Static Thresholds</SPAN></SPAN></SPAN></SPAN></SPAN></H3><P>An ABAP Environment in the Cloud comes with pre-delivered SAP profiles that capture ABAP statistics records in your system. You can find these pre-delivered SAP profiles in the <EM>Capture Request Statistics</EM> app:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Pre-delivered SAP profiles" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95589i0FB1B72F365706C2/image-size/large?v=v2&amp;px=999" role="button" title="CRS_default_profiles.png" alt="Pre-delivered SAP profiles" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Pre-delivered SAP profiles</span></span></P><P><SPAN>These profiles ensure that the statistics about “bad” requests - meaning a high consumption of compute resources – are captured in the system. If you look, for example, at the details of the static profile for expensive requests regarding server response time, you find a static threshold of 1 second:</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Pre-delivered SAP profile - capture requests with high server response time" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95590iC8508BAE822CC1ED/image-size/large?v=v2&amp;px=999" role="button" title="CRS_default_static_profile.png" alt="Pre-delivered SAP profile - capture requests with high server response time" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Pre-delivered SAP profile - capture requests with high server response time</span></span></SPAN></P><P><SPAN>With this profile always active, ABAP statistics records with an ABAP server response time larger than 1 second are captured and stored. Similarly, the other pre-delivered static profiles capture requests that exceed 1 second regarding HANA CPU time, ABAP CPU time, etc.</SPAN></P><P>In the profile header, you can find that for the SAP-delivered profiles, a sampling rate of 1% has been set. It means that only 1% of the records that fulfill the filter condition will be captured. In addition, the record limit per minute is set to 50. The periodic data collector that runs every minute and processes the ABAP statistics records (together with the profiles in the <EM>Capture Request Statistics</EM> app) will only store the ABAP statistics records up to this limit in the database. So, if many ABAP statistics records fulfill the filter condition at a time, not all of these records will be stored.</P><P>For SAP-delivered profiles, this low record limit per minute together with the low sampling rate ensures that the workload and data footprint for processing and storing monitoring data in your system stay low, even if the overall business workload on the system gets exceedingly high.</P><H3 id="toc-hId-727803953"><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Default Configuration: Capture Workload Statistics Dynamically</SPAN></SPAN></SPAN></SPAN></SPAN></H3><P>In addition to the pre-delivered static profiles, the dynamic SAP profile <EM>SAP_DYNAMIC_CAPTURING</EM> ensures that for the top workload of your system “good” statistic samples of requests are also captured (with respect to the server response time). As a result, you can compare statistics of samples of “bad” workload to statistics of samples of “good” workload. The top workload in your system might vary as well as the behavior in response times. The dynamic profile adapts to these changes.</P><P>In addition, for the top workload, the dynamic profile captures samples of ABAP statistics when their server response times deviate too much from the average server response time of this specific kind of workload. This ensures that for workloads with typically different server response times, samples of ABAP statistics records are also at hand, even if their server response times do not exceed the static thresholds of the static profile types.</P><P>In principle, the pre-delivered static profiles together with the dynamic profile will give you a high chance that for your top workload, you’ll find samples of ABAP statistics records in the system that you can use for detailed analysis. You get this data using the <EM>System Workload</EM> app and by drilling down to the ABAP statistics records, and in most of the cases, that’s enough. However, as these statistics are sampled, it might happen that sometimes you don't find any records that you can use for further analysis:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="System Workload app - no detailed statistics available" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95598i889C198FE81A56E3/image-size/large?v=v2&amp;px=999" role="button" title="TM_Request_Processing.png" alt="System Workload app - no detailed statistics available" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">System Workload app - no detailed statistics available</span></span></P><P><SPAN>To have these detailed statistics for your root cause analysis, you can capture your own workload statistics in your ABAP environment in the Cloud.</SPAN></P><H3 id="toc-hId-531290448"><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Capture Your Own Workload Statistics in the Capture Request Statistics App</SPAN></SPAN></SPAN></SPAN></SPAN></H3><P>You can create your own capture profiles, of course. While the SAP profiles are designed in such a way that they capture samples of ABAP statistics records for generic expensive workload in the ABAP tenant, you might want to specify the workload more concretely. For example, you might be interested specifically in the ABAP statistics records of your user or of a certain outbound communication arrangement. Or you might be interested in workload that exceeds a specific threshold (as in the pre-delivered SAP profiles). To do so, you can create your own capture profile.</P><P>If, for example, you have built a new ABAP RESTful application for travel bookings, you could define a profile that filters on its specific request entry point (consisting of request entry name and request entry type):</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Custom profile" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95585i1CFDC6C8A1EE4DC4/image-size/large?v=v2&amp;px=999" role="button" title="Custom_static_profile.png" alt="Custom profile" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Custom profile</span></span></P><P>A<SPAN>&nbsp;custom profile is in status </SPAN><EM>Inactive</EM><SPAN> when newly created. If you click on the </SPAN><EM>Activate</EM><SPAN> button, the profile status will be set to status </SPAN><EM>Processing,</EM><SPAN> and only then will the data collector process ABAP statistics records that fulfill the defined filter conditions. On activation of the profile, you also need to specify the duration of how long the profile should be active. When the duration is exceeded and all the relevant ABAP statistics records are processed, the profile will be set to status </SPAN><EM>Finished</EM><SPAN> and no further ABAP statistics records will be processed for this profile.</SPAN></P><P><SPAN>In the example profile shown here, a sampling rate of 100% and a record limit per minute of 1000 has been set. Both are the maximum possible values.&nbsp;</SPAN><SPAN>This setting guarantees that all ABAP statistics records fulfilling the filter conditions are captured. Of course, if the record limit of 1000 is exceeded, you won’t capture everything. But this happens only in rare cases. In any case, it’s ensured that also for a badly designed capture profile, your business is not impacted by the additional workload of capturing request statistics.</SPAN></P><P>The target user group in the profile header indicates that only workload is considered that is running in customer user context. You can specify this further by considering, for example, only customer communication users or customer business users.</P><P>If the profile is active and users are performing actions in your ABAP RESTful application, the according ABAP statistics records are captured and stored in the database for a period that you have defined in the retention time of your profile.</P><P>For further analysis, e.g., the performance of a new app that you have built, you can navigate to the captured ABAP statistics records by clicking on <EM>Analyze Request Statistics</EM>. There you can analyze the captured single ABAP statistics records in detail and obtain insights into the behavior of your newly created app:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Analyze ABAP statistics records in detail" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95616i3095B0D51383866A/image-size/large?v=v2&amp;px=999" role="button" title="TM_ABAP_Statistics_Records.png" alt="Analyze ABAP statistics records in detail" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Analyze ABAP statistics records in detail</span></span></P><P><SPAN class=""><SPAN class="">You can find more information, for example, about SQL statements or, in the case of communication, about HTTP calls by choosing the </SPAN></SPAN><SPAN class=""><SPAN class=""><SPAN class="">Details</SPAN></SPAN></SPAN><SPAN class=""><SPAN class=""> arrow at the end of a row, which leads you to the details of that ABAP statistics record.</SPAN></SPAN></P><P><SPAN>If your new application belongs to the more expensive workload in the system, you’ll easily find the captured ABAP statistics records also in the </SPAN><EM>System Workload</EM><SPAN> app. There, you start from the overall workload (aggregated ABAP statistics records) of your business tenants. If you drill down to the details of your application, you will get to the ABAP statistics records. Your custom profile ensures that they have been captured:</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="System Workload app - detailed statistics available" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95602i44C955DB30D4DCD8/image-size/large?v=v2&amp;px=999" role="button" title="TM_Request_Processing_Data.png" alt="System Workload app - detailed statistics available" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">System Workload app - detailed statistics available</span></span></SPAN></P><P><STRONG>Note:</STRONG><SPAN> With the </SPAN><EM>Capture Request Statistics</EM><SPAN> app, you can also define profiles with profile type </SPAN><EM>SQL Trace</EM><SPAN>. With these profiles, you can trace the execution of SQL statements. These captured SQL statements can be further analyzed in the </SPAN><EM>SQL Trace Analysis</EM><SPAN> app. This might be another story for another blog post in the future, so stay tuned.</SPAN></P><P>You can find more information about the <EM>Capture Request Statistics</EM>&nbsp;app in the following documentation:</P><UL><LI><A href="https://help.sap.com/docs/btp/sap-business-technology-platform/capturing-request-statistics" target="_self" rel="noopener noreferrer">Capturing Request Statistics</A>&nbsp;for <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-2">SAP BTP, ABAP environment</a></LI><LI><A href="https://help.sap.com/docs/SAP_S4HANA_CLOUD/0cc8af9d2f2e40f38b38b46b49325e2d/e86943aee62d48a8ac26ec22710bd63d.html" target="_self" rel="noopener noreferrer">Capturing Request Statistics</A>&nbsp;for <a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA+Cloud+ABAP+Environment/pd-p/60907aa9-99e9-4d5d-9103-8b970e9bc0a4" class="lia-product-mention" data-product="39-2">SAP S/4HANA Cloud ABAP Environment</a></LI></UL><H3 id="toc-hId-334776943"><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Getting Notified About Specific Workloads</SPAN></SPAN></SPAN></SPAN></SPAN></H3><P>You may have noticed that by defining a custom capture profile for capturing ABAP statistics records, you can set the option for <EM>Health Monitoring</EM>. If you have connected your <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-3">SAP BTP, ABAP environment</a> or&nbsp;<a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA+Cloud+ABAP+Environment/pd-p/60907aa9-99e9-4d5d-9103-8b970e9bc0a4" class="lia-product-mention" data-product="39-3">SAP S/4HANA Cloud ABAP Environment</a> tenant to <a href="https://community.sap.com/t5/c-khhcw49343/SAP+Cloud+ALM/pd-p/73554900100800002513" class="lia-product-mention" data-product="469-1">SAP Cloud ALM</a>, you’ll receive a counter per capture request statistics profile in <a href="https://community.sap.com/t5/c-khhcw49343/SAP+Cloud+ALM/pd-p/73554900100800002513" class="lia-product-mention" data-product="469-2">SAP Cloud ALM</a> <EM>for Operations</EM> in the <EM>Health Monitoring</EM> app. You can find more information on how to connect your tenant to SAP Cloud ALM here:</P><UL><LI><SPAN><A href="https://developers.sap.com/tutorials/abap-environment-monitoring-calm-health-monitoring.html" target="_blank" rel="noopener noreferrer">Monitor An SAP BTP ABAP Environment Service Using SAP Cloud ALM (CALM)</A></SPAN></LI><LI><SPAN><A href="https://support.sap.com/en/alm/sap-cloud-alm/operations/expert-portal/setup-managed-services/setup-s4hana-cloud.html" target="_blank" rel="noopener noreferrer">Setup for SAP S/4HANA Public Cloud Edition</A></SPAN></LI></UL><P>For our custom profile example <EM>Z_STATIC_PROFILE</EM>, you’ll find the tile <EM>Captured ABAP Statistics Records</EM> in the <EM>Health Monitoring</EM> app in your connected <a href="https://community.sap.com/t5/c-khhcw49343/SAP+Cloud+ALM/pd-p/73554900100800002513" class="lia-product-mention" data-product="469-3">SAP Cloud ALM</a> tenant. If you click on the tile for details, you find your custom profile together with a counter</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SAP Cloud ALM - Health Monitoring" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/95619i39178717905FCFEA/image-size/large?v=v2&amp;px=999" role="button" title="CALM_Health_Monitoring.png" alt="SAP Cloud ALM - Health Monitoring" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">SAP Cloud ALM - Health Monitoring</span></span></P><P><SPAN>This counter is normalized to 5 minutes. This means that during the last 5 minutes, 27 ABAP statistics records were captured in your ABAP tenant that fulfill the filter conditions that you have defined in your custom profile. Besides this usage scenario, you can also use the </SPAN><EM>Health Monitoring</EM><SPAN> feature on capture profiles with static thresholds (like in the case of the pre-delivered static SAP profiles) to count how often your defined thresholds are exceeded. For more information, see also the blog post </SPAN><SPAN><A href="https://community.sap.com/t5/technology-blogs-by-sap/monitoring-the-performance-of-outbound-communication-in-the-abap/ba-p/13566730" target="_blank">Monitoring the Performance of Outbound Communication in the ABAP Environment in the Cloud</A></SPAN><SPAN>.</SPAN></P><P>If you want to get alerted by email when the filter conditions of your profile are hit a certain number of times, you can configure alerts in <a href="https://community.sap.com/t5/c-khhcw49343/SAP+Cloud+ALM/pd-p/73554900100800002513" class="lia-product-mention" data-product="469-4">SAP Cloud ALM</a> in the <EM>Health Monitoring</EM> app. For more information, see the blog post <A href="https://community.sap.com/t5/technology-blogs-by-sap/monitoring-the-health-of-the-abap-system-in-the-cloud/ba-p/13570209" target="_blank">Monitoring the Health of the ABAP System in the Cloud</A>.</P><H3 id="toc-hId-138263438"><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class=""><SPAN class="">Summary</SPAN></SPAN></SPAN></SPAN></SPAN></H3><P>The default configuration of your <a href="https://community.sap.com/t5/c-khhcw49343/SAP+BTP%25252C+ABAP+environment/pd-p/73555000100800001164" class="lia-product-mention" data-product="11-4">SAP BTP, ABAP environment</a> or <a href="https://community.sap.com/t5/c-khhcw49343/SAP+S%25252F4HANA+Cloud+ABAP+Environment/pd-p/60907aa9-99e9-4d5d-9103-8b970e9bc0a4" class="lia-product-mention" data-product="39-4">SAP S/4HANA Cloud ABAP Environment</a> tenant comes with pre-delivered SAP profiles that capture ABAP statistics records for the most important workload in your system. This helps you analyze and understand your system workload in detail.</P><P><SPAN>However, if you want to enhance this default configuration, you can do so by creating your own profiles using the <EM>Capture Request Statistics</EM> app. The monitoring data collector ensures that requests that fulfill </SPAN><SPAN>your filter conditions are captured and stored in the system for further analysis. You can define profiles for capturing ABAP statistics records and for capturing SQL statements.</SPAN></P><P><SPAN>Let’s quickly recap in which use cases creating your own profiles in the <EM>Capture Request Statistics</EM> app is useful: </SPAN></P><UL><LI>In your standard system-local analysis of the system behavior, detailed statistics are missing for a certain workload that you need to have at hand.</LI><LI>You want to proactively capture extensive details for a workload of your choice to analyze it in detail.</LI><LI>In <a href="https://community.sap.com/t5/c-khhcw49343/SAP+Cloud+ALM/pd-p/73554900100800002513" class="lia-product-mention" data-product="469-5">SAP Cloud ALM</a>, you want to understand how often your workload in the landscape hits certain criteria (= your filter conditions defined in the profiles), and you want to get alerted in this case</LI></UL><P>I’d like to thank everyone who contributed to this blog post, especially my colleagues <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/852125">@anke_griesbaum</a>, <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/5052">@Karen_Kuck</a>, <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1803">@SabineReich</a>, and <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/220841">@steffen_siegmund</a>.</P><P>Let me know in the comments if and how you’ve used the <EM>Capture Request Statistics</EM> app and what you think of it.</P> 2024-04-18T13:02:05.620000+02:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-cloud-abap%E5%BC%80%E5%8F%91%E6%A1%88%E4%BE%8B%E4%B9%8B%E5%85%AB-%E7%89%A9%E6%96%99%E4%B8%B4%E6%9C%9F%E7%AE%A1%E7%90%86app/ba-p/13675540 SAP S/4HANA Cloud ABAP开发案例之八:物料临期管理App 2024-04-19T09:11:36.318000+02:00 Vincent_Zhu https://community.sap.com/t5/user/viewprofilepage/user-id/131883 <P><SPAN>紧随这篇</SPAN><A href="https://blogs.sap.com/2023/12/01/s-4hana-cloud%e4%b8%89%e7%b3%bb%e7%bb%9fcloud-abap%e5%bc%80%e5%8f%91%e6%a1%88%e4%be%8b%e4%bb%8b%e7%bb%8d/" target="_blank" rel="noopener noreferrer">博客</A><SPAN>,今天我们将再次逐步详细地介绍一个利用SAP S/4HANA Cloud三系统来做开发扩展的案例。</SPAN></P><P>&nbsp;</P><H2 id="toc-hId-992615903"><SPAN>1. 案例背景</SPAN></H2><P><SPAN>我们经常听到启用批次管理的客户在问是否有对临近效期物料的提醒、是否有对临近效期物料的批量查询报表,在标准产品中要查询相关信息需要检索多张报表,比如库存报表、批次信息等。通过利用开发人员可扩展性,我们开发了一个定制的物料临期管理App,并嵌入到SAP S/4HANA Cloud系统中。旨在帮助企业智能化地管理物料效期,提高供应链管理效率。关于业务上该自开发案例的价值,可参考此<A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/%E6%8F%90%E5%8D%87%E4%BE%9B%E5%BA%94%E9%93%BE%E7%AE%A1%E7%90%86%E6%95%88%E7%8E%87-%E7%89%A9%E6%96%99%E4%B8%B4%E6%9C%9F%E7%AE%A1%E7%90%86app%E5%8A%A9%E5%8A%9B%E4%BC%81%E4%B8%9A%E6%99%BA%E8%83%BD%E5%86%B3%E7%AD%96/ba-p/13657161" target="_self">博客</A>。</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98545iFAC23946F080DFF4/image-size/large?v=v2&amp;px=999" role="button" title="shelf1.png" alt="shelf1.png" /></span></SPAN></P><P>&nbsp;</P><P>每个企业由于不同业务管理需要,可能对临近效期的提醒范围定义不同,我们还开发了警示灯自定义阈值配置app,用户可以自定义设置效期多少范围需显示为红灯,多少范围需显示为黄灯,多少范围需显示为绿灯,自定义设置满足不同企业客制化效期管理需求。</P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf2.png" style="width: 694px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98547iACB1A1F882FF0B71/image-size/large?v=v2&amp;px=999" role="button" title="shelf2.png" alt="shelf2.png" /></span></SPAN></P><P>&nbsp;</P><H2 id="toc-hId-796102398"><SPAN>2. 后台服务开发</SPAN></H2><H3 id="toc-hId-728671612"><SPAN>2.1 创建CDS数据模型</SPAN></H3><P><SPAN>创建数据定义YCDS_DUE_MAT_LIST</SPAN></P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@AbapCatalog.sqlViewName: 'YDUEMATMANGE' @AbapCatalog.compiler.compareFilter: true //@AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'Material Due Date List' define view YCDS_DUE_MAT_LIST as select from I_Batch inner join YCDS_SUM_STOCK_01 on YCDS_SUM_STOCK_01.Material = I_Batch.Material and YCDS_SUM_STOCK_01.Plant = I_Batch.Plant and YCDS_SUM_STOCK_01.Batch = I_Batch.Batch association [1..1] to I_Product on I_Product.Product = I_Batch.Material association [1..1] to I_ProductDescription on I_ProductDescription.Product = I_Batch.Material and I_ProductDescription.Language = $session.system_language association [1..1] to I_Plant on I_Plant.Plant = I_Batch.Plant and I_Plant.Language = $session.system_language association [1..1] to I_Supplier on I_Supplier.Supplier = I_Batch.Supplier { key I_Batch.Material, key I_Batch.Batch, key I_Batch.Plant, key I_Batch.Supplier, key I_Batch.BatchBySupplier, // key YCDS_SUM_STOCK_01.InventoryStockType, // key YCDS_SUM_STOCK_01.MatlDocLatestPostgDate, YCDS_SUM_STOCK_01.StorageLocation, YCDS_SUM_STOCK_01.MatlWrhsStkQtyInMatlBaseUnit, I_Batch.MatlBatchIsInRstrcdUseStock, I_Batch.ShelfLifeExpirationDate, I_Batch.ManufactureDate, I_Product.BaseUnit, I_ProductDescription.ProductDescription, I_Plant.PlantName, I_Supplier.SupplierName, case when I_Batch.MatlBatchIsInRstrcdUseStock = 'X' then 'Restricted' else 'Unrestricted' end as BatchStatus, $session.system_date as curr_date } where I_Batch.ShelfLifeExpirationDate is not initial and YCDS_SUM_STOCK_01.MatlWrhsStkQtyInMatlBaseUnit &lt;&gt; 0</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>创建数据定义<SPAN>YCDS_DUE_MAT_LIST2</SPAN></P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@AbapCatalog.sqlViewName: 'YDUEMATMANGE2' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Material Due Date List' define view YCDS_DUE_MAT_LIST2 as select from YCDS_DUE_MAT_LIST association [1..1] to I_StorageLocation on I_StorageLocation.StorageLocation = YCDS_DUE_MAT_LIST.StorageLocation and I_StorageLocation.Plant = YCDS_DUE_MAT_LIST.Plant { key YCDS_DUE_MAT_LIST.Material, key YCDS_DUE_MAT_LIST.Plant, key YCDS_DUE_MAT_LIST.StorageLocation, key YCDS_DUE_MAT_LIST.Batch, key YCDS_DUE_MAT_LIST.Supplier, // key YCDS_DUE_MAT_LIST.InventoryStockType, // key YCDS_DUE_MAT_LIST.MatlDocLatestPostgDate, YCDS_DUE_MAT_LIST.ProductDescription, YCDS_DUE_MAT_LIST.PlantName, I_StorageLocation.StorageLocationName, YCDS_DUE_MAT_LIST.BatchBySupplier, YCDS_DUE_MAT_LIST.SupplierName, MatlWrhsStkQtyInMatlBaseUnit, YCDS_DUE_MAT_LIST.BaseUnit, YCDS_DUE_MAT_LIST.ShelfLifeExpirationDate, YCDS_DUE_MAT_LIST.ManufactureDate, YCDS_DUE_MAT_LIST.BatchStatus, dats_days_between(YCDS_DUE_MAT_LIST.curr_date,YCDS_DUE_MAT_LIST.ShelfLifeExpirationDate) as remaining_days } </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>创建数据定义<SPAN>YCDS_SUM_STOCK_01</SPAN></P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@AbapCatalog.viewEnhancementCategory: [#NONE] @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Sum of Stock 01' @Metadata.ignorePropagatedAnnotations: true @ObjectModel.usageType:{ serviceQuality: #X, sizeCategory: #S, dataClass: #MIXED } define view entity YCDS_SUM_STOCK_01 as select from I_MaterialStock_2 { key Material, key Plant, key StorageLocation, key Batch, key MaterialBaseUnit, @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit' @Aggregation.default: #SUM sum( MatlWrhsStkQtyInMatlBaseUnit ) as MatlWrhsStkQtyInMatlBaseUnit } where InventoryStockType = '01' group by Material, Plant, StorageLocation, Batch, MaterialBaseUnit</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>2.2 创建Metadata Extensions</P><P>创建新的Metadata Extension:<SPAN>YC_DUE_MAT_LIST</SPAN></P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@Metadata.layer: #CUSTOMER @UI.headerInfo.title.type: #STANDARD @UI.headerInfo.title.label: 'Material Shelf Life Management' @UI.headerInfo.description.type: #STANDARD @UI.headerInfo.typeName: 'Material Due List' @UI.headerInfo.typeNamePlural: 'Material Shelf Life Management' annotate view YC_DUE_MAT_LIST with { @UI.facet: [{ id: 'Material', purpose: #STANDARD, type: #IDENTIFICATION_REFERENCE, label: 'Material', position: 10} ] @UI:{ lineItem: [{ position: 10 }], lineItem: [{label: 'Material'}], identification: [{ position: 10 }], selectionField: [{ position: 20 }] } Material; @UI:{ lineItem: [{ position: 20 }], lineItem: [{label: 'Material Description'} ], identification: [{ position: 20 }] } @UI.lineItem: [{exclude: true}] ProductDescription; @UI:{ lineItem: [{ position: 30 }], lineItem: [{label: 'Plant'}], identification: [{ position: 30 }], selectionField: [{ position: 10 }] } Plant; @UI:{ lineItem: [{ position: 40 }], lineItem: [{label: 'Plant Name'}], identification: [{ position: 40 }] } @UI.lineItem: [{exclude: true}] PlantName; @UI.lineItem: [{ position: 50 }] @UI.lineItem: [{label: 'Storage Location'}] @UI.identification: [{ position: 50 }] @UI.selectionField: [{position: 50}] StorageLocation; @UI.lineItem: [{ position: 60 }] @UI.lineItem: [{label: 'Storage Location Name'}] @UI.identification: [{ position: 60 }] @UI.lineItem: [{exclude: true}] StorageLocationName; @UI.lineItem: [{ position: 70 }] @UI.lineItem: [{label: 'Batch'}] @UI.identification: [{ position: 70 }] @UI.selectionField: [{position: 70}] Batch; @UI.lineItem: [{ position: 80 }] @UI.lineItem: [{label: 'Supplier Batch'}] @UI.identification: [{ position: 80 }] @UI.selectionField: [{position: 80}] BatchBySupplier; @UI.lineItem: [{ position: 90 }] @UI.lineItem: [{label: 'Supplier'}] @UI.identification: [{ position: 90 }] Supplier; @UI.lineItem: [{ position: 100 }] @UI.lineItem: [{label: 'Supplier Name'}] @UI.identification: [{ position: 100 }] @UI.lineItem: [{exclude: true}] SupplierName; @UI.lineItem: [{ position: 110 }] @UI.lineItem: [{label: 'Unrestricted Inventory Qty'}] @UI.identification: [{ position: 110 }] MatlWrhsStkQtyInMatlBaseUnit; @UI.lineItem: [{ position: 120 }] @UI.lineItem: [{label: 'Unit'}] @UI.identification: [{ position: 120 }] // @UI.lineItem: [{exclude: true}] @UI.hidden: true BaseUnit; @UI.lineItem: [{ position: 130 }] @UI.lineItem: [{label: 'Expiration Date'}] @UI.identification: [{ position: 130 }] ShelfLifeExpirationDate; @UI.lineItem: [{ position: 140 }] @UI.lineItem: [{label: 'Manufacture Date'}] @UI.identification: [{ position: 140 }] @UI.lineItem: [{exclude: true}] ManufactureDate; @UI.lineItem: [{ position: 150 }] @UI.lineItem: [{label: 'Batch Status'}] @UI.identification: [{ position: 150 }] @UI.lineItem: [{exclude: true}] BatchStatus; @UI.lineItem: [{ position: 160, importance: #HIGH }] @UI.lineItem: [{label: 'Remaining Days'}] @UI.identification: [{ position: 160 }] remaining_days; @UI.lineItem: [{ position: 170, value: 'due_range', criticality: 'Criticality' }] @UI.lineItem: [{label: 'Due Date Range'}] @UI.identification: [{ position: 170 }] due_range; // @UI.hidden: true // InventoryStockType; // @UI.hidden: true // MatlDocLatestPostgDate; @UI.hidden: true Criticality; }</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><H3 id="toc-hId-532158107">2.3 创建Service Definition和Service Binding</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf3.png" style="width: 394px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98551i9701DCB711321236/image-size/large?v=v2&amp;px=999" role="button" title="shelf3.png" alt="shelf3.png" /></span></P><P>&nbsp;<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf4.png" style="width: 655px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98552i037C4944C6AF399D/image-size/large?v=v2&amp;px=999" role="button" title="shelf4.png" alt="shelf4.png" /></span></P><P>&nbsp;我们可以通过预览的方式查看发布的服务:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf5.png" style="width: 655px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98553i85222EE8D4831E85/image-size/large?v=v2&amp;px=999" role="button" title="shelf5.png" alt="shelf5.png" /></span></P><P>&nbsp;</P><H2 id="toc-hId-206561883">3. 前台应用开发</H2><P>首先在BTP创建Destination:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf6.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98560iA19B05F411314D70/image-size/large?v=v2&amp;px=999" role="button" title="shelf6.png" alt="shelf6.png" /></span></P><P>&nbsp;</P><P>然后打开BAS服务,选择SAP Fiori Worklist Application:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf7.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98561i6C41471EC722AEFA/image-size/large?v=v2&amp;px=999" role="button" title="shelf7.png" alt="shelf7.png" /></span></P><P>&nbsp;</P><P>发布完成,部署完权限之后,就可以看到App:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf8.png" style="width: 664px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98563iC59F054604F5C417/image-size/large?v=v2&amp;px=999" role="button" title="shelf8.png" alt="shelf8.png" /></span></P><P>&nbsp;</P><P><SPAN>以上是该案例——物料临期管理自开发应用的步骤介绍。希望通过此案例的介绍能让您了解到三系统开发能实现的常见功能。</SPAN></P> 2024-04-19T09:11:36.318000+02:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/sap-s-4hana-cloud-public-edition-abap-environment-case-8-material-shelf/ba-p/13675904 SAP S/4HANA Cloud, public edition, ABAP Environment Case 8: Material Shelf Life Management 2024-04-19T13:16:11.809000+02:00 Vincent_Zhu https://community.sap.com/t5/user/viewprofilepage/user-id/131883 <P><SPAN>This is a detailed step-by-step technical guide document to introduce a Developer Extensibility case followed by this&nbsp;</SPAN><A href="https://blogs.sap.com/2023/04/06/sap-s-4hana-cloud-public-edition-abap-environment-case-introduction/" target="_blank" rel="noopener noreferrer">blog</A><SPAN>.</SPAN></P><P>&nbsp;</P><H2 id="toc-hId-992619627"><STRONG>1. Case Background:</STRONG></H2><P>We frequently hear inquiries from clients who have enabled batch management, asking whether there are reminders for nearing expiry materials and batch query reports for such materials. In standard products, retrieving relevant information often requires searching through multiple reports, such as inventory reports and batch details.&nbsp;<SPAN>To meet this demand, we have developed a Material Shelf Life Management App on S/4HANA public cloud through developer extensibility (also known as cloud ABAP development), aiming to help enterprises intelligently manage material Shelf Life and enhance supply chain management efficiency. Regarding the business value of this use case, you can refer to this <A href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/boost-scm-efficiency-material-expiry-mgmt-app-empowers-intelligent-decision/ba-p/13657205" target="_self">blog</A> for details.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98725iD322711C2641F69C/image-size/large?v=v2&amp;px=999" role="button" title="shelf1.png" alt="shelf1.png" /></span></SPAN></P><P>&nbsp;</P><P><SPAN>Due to varying business management needs, each company may define different ranges for nearing expiry reminders. The Customizable Warning Threshold Configuration App allows users to set customized ranges for when to display red, yellow, or green warning lights, meeting the diverse customization needs of different enterprises for expiry management.</SPAN></P><P><SPAN><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf2.png" style="width: 694px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98726iE32116620B580139/image-size/large?v=v2&amp;px=999" role="button" title="shelf2.png" alt="shelf2.png" /></span></SPAN></SPAN></P><P>&nbsp;</P><H2 id="toc-hId-796106122"><STRONG>2. Backend Service Development:</STRONG></H2><H3 id="toc-hId-728675336"><STRONG>2.1 Create CDS Data Model</STRONG></H3><P>Create Data Definition: <SPAN>YCDS_DUE_MAT_LIST</SPAN></P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@AbapCatalog.sqlViewName: 'YDUEMATMANGE' @AbapCatalog.compiler.compareFilter: true //@AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'Material Due Date List' define view YCDS_DUE_MAT_LIST as select from I_Batch inner join YCDS_SUM_STOCK_01 on YCDS_SUM_STOCK_01.Material = I_Batch.Material and YCDS_SUM_STOCK_01.Plant = I_Batch.Plant and YCDS_SUM_STOCK_01.Batch = I_Batch.Batch association [1..1] to I_Product on I_Product.Product = I_Batch.Material association [1..1] to I_ProductDescription on I_ProductDescription.Product = I_Batch.Material and I_ProductDescription.Language = $session.system_language association [1..1] to I_Plant on I_Plant.Plant = I_Batch.Plant and I_Plant.Language = $session.system_language association [1..1] to I_Supplier on I_Supplier.Supplier = I_Batch.Supplier { key I_Batch.Material, key I_Batch.Batch, key I_Batch.Plant, key I_Batch.Supplier, key I_Batch.BatchBySupplier, // key YCDS_SUM_STOCK_01.InventoryStockType, // key YCDS_SUM_STOCK_01.MatlDocLatestPostgDate, YCDS_SUM_STOCK_01.StorageLocation, YCDS_SUM_STOCK_01.MatlWrhsStkQtyInMatlBaseUnit, I_Batch.MatlBatchIsInRstrcdUseStock, I_Batch.ShelfLifeExpirationDate, I_Batch.ManufactureDate, I_Product.BaseUnit, I_ProductDescription.ProductDescription, I_Plant.PlantName, I_Supplier.SupplierName, case when I_Batch.MatlBatchIsInRstrcdUseStock = 'X' then 'Restricted' else 'Unrestricted' end as BatchStatus, $session.system_date as curr_date } where I_Batch.ShelfLifeExpirationDate is not initial and YCDS_SUM_STOCK_01.MatlWrhsStkQtyInMatlBaseUnit &lt;&gt; 0</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>Create Data Definition:&nbsp;<SPAN>YCDS_DUE_MAT_LIST2</SPAN></P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@AbapCatalog.sqlViewName: 'YDUEMATMANGE2' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Material Due Date List' define view YCDS_DUE_MAT_LIST2 as select from YCDS_DUE_MAT_LIST association [1..1] to I_StorageLocation on I_StorageLocation.StorageLocation = YCDS_DUE_MAT_LIST.StorageLocation and I_StorageLocation.Plant = YCDS_DUE_MAT_LIST.Plant { key YCDS_DUE_MAT_LIST.Material, key YCDS_DUE_MAT_LIST.Plant, key YCDS_DUE_MAT_LIST.StorageLocation, key YCDS_DUE_MAT_LIST.Batch, key YCDS_DUE_MAT_LIST.Supplier, // key YCDS_DUE_MAT_LIST.InventoryStockType, // key YCDS_DUE_MAT_LIST.MatlDocLatestPostgDate, YCDS_DUE_MAT_LIST.ProductDescription, YCDS_DUE_MAT_LIST.PlantName, I_StorageLocation.StorageLocationName, YCDS_DUE_MAT_LIST.BatchBySupplier, YCDS_DUE_MAT_LIST.SupplierName, MatlWrhsStkQtyInMatlBaseUnit, YCDS_DUE_MAT_LIST.BaseUnit, YCDS_DUE_MAT_LIST.ShelfLifeExpirationDate, YCDS_DUE_MAT_LIST.ManufactureDate, YCDS_DUE_MAT_LIST.BatchStatus, dats_days_between(YCDS_DUE_MAT_LIST.curr_date,YCDS_DUE_MAT_LIST.ShelfLifeExpirationDate) as remaining_days } </code></pre><P>&nbsp;</P><P>&nbsp;</P><P>Create Data Definition:&nbsp;<SPAN>YCDS_SUM_STOCK_01</SPAN></P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@AbapCatalog.viewEnhancementCategory: [#NONE] @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Sum of Stock 01' @Metadata.ignorePropagatedAnnotations: true @ObjectModel.usageType:{ serviceQuality: #X, sizeCategory: #S, dataClass: #MIXED } define view entity YCDS_SUM_STOCK_01 as select from I_MaterialStock_2 { key Material, key Plant, key StorageLocation, key Batch, key MaterialBaseUnit, @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit' @Aggregation.default: #SUM sum( MatlWrhsStkQtyInMatlBaseUnit ) as MatlWrhsStkQtyInMatlBaseUnit } where InventoryStockType = '01' group by Material, Plant, StorageLocation, Batch, MaterialBaseUnit</code></pre><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId-403079112">2.2 Create Metadata Extensions</H2><P>Create new Metadata Extension:&nbsp;<SPAN>YC_DUE_MAT_LIST</SPAN></P><P>&nbsp;</P><pre class="lia-code-sample language-abap"><code>@Metadata.layer: #CUSTOMER @UI.headerInfo.title.type: #STANDARD @UI.headerInfo.title.label: 'Material Shelf Life Management' @UI.headerInfo.description.type: #STANDARD @UI.headerInfo.typeName: 'Material Due List' @UI.headerInfo.typeNamePlural: 'Material Shelf Life Management' annotate view YC_DUE_MAT_LIST with { @UI.facet: [{ id: 'Material', purpose: #STANDARD, type: #IDENTIFICATION_REFERENCE, label: 'Material', position: 10} ] @UI:{ lineItem: [{ position: 10 }], lineItem: [{label: 'Material'}], identification: [{ position: 10 }], selectionField: [{ position: 20 }] } Material; @UI:{ lineItem: [{ position: 20 }], lineItem: [{label: 'Material Description'} ], identification: [{ position: 20 }] } @UI.lineItem: [{exclude: true}] ProductDescription; @UI:{ lineItem: [{ position: 30 }], lineItem: [{label: 'Plant'}], identification: [{ position: 30 }], selectionField: [{ position: 10 }] } Plant; @UI:{ lineItem: [{ position: 40 }], lineItem: [{label: 'Plant Name'}], identification: [{ position: 40 }] } @UI.lineItem: [{exclude: true}] PlantName; @UI.lineItem: [{ position: 50 }] @UI.lineItem: [{label: 'Storage Location'}] @UI.identification: [{ position: 50 }] @UI.selectionField: [{position: 50}] StorageLocation; @UI.lineItem: [{ position: 60 }] @UI.lineItem: [{label: 'Storage Location Name'}] @UI.identification: [{ position: 60 }] @UI.lineItem: [{exclude: true}] StorageLocationName; @UI.lineItem: [{ position: 70 }] @UI.lineItem: [{label: 'Batch'}] @UI.identification: [{ position: 70 }] @UI.selectionField: [{position: 70}] Batch; @UI.lineItem: [{ position: 80 }] @UI.lineItem: [{label: 'Supplier Batch'}] @UI.identification: [{ position: 80 }] @UI.selectionField: [{position: 80}] BatchBySupplier; @UI.lineItem: [{ position: 90 }] @UI.lineItem: [{label: 'Supplier'}] @UI.identification: [{ position: 90 }] Supplier; @UI.lineItem: [{ position: 100 }] @UI.lineItem: [{label: 'Supplier Name'}] @UI.identification: [{ position: 100 }] @UI.lineItem: [{exclude: true}] SupplierName; @UI.lineItem: [{ position: 110 }] @UI.lineItem: [{label: 'Unrestricted Inventory Qty'}] @UI.identification: [{ position: 110 }] MatlWrhsStkQtyInMatlBaseUnit; @UI.lineItem: [{ position: 120 }] @UI.lineItem: [{label: 'Unit'}] @UI.identification: [{ position: 120 }] // @UI.lineItem: [{exclude: true}] @UI.hidden: true BaseUnit; @UI.lineItem: [{ position: 130 }] @UI.lineItem: [{label: 'Expiration Date'}] @UI.identification: [{ position: 130 }] ShelfLifeExpirationDate; @UI.lineItem: [{ position: 140 }] @UI.lineItem: [{label: 'Manufacture Date'}] @UI.identification: [{ position: 140 }] @UI.lineItem: [{exclude: true}] ManufactureDate; @UI.lineItem: [{ position: 150 }] @UI.lineItem: [{label: 'Batch Status'}] @UI.identification: [{ position: 150 }] @UI.lineItem: [{exclude: true}] BatchStatus; @UI.lineItem: [{ position: 160, importance: #HIGH }] @UI.lineItem: [{label: 'Remaining Days'}] @UI.identification: [{ position: 160 }] remaining_days; @UI.lineItem: [{ position: 170, value: 'due_range', criticality: 'Criticality' }] @UI.lineItem: [{label: 'Due Date Range'}] @UI.identification: [{ position: 170 }] due_range; // @UI.hidden: true // InventoryStockType; // @UI.hidden: true // MatlDocLatestPostgDate; @UI.hidden: true Criticality; }</code></pre><P>&nbsp;</P><P>&nbsp;</P><H2 id="toc-hId-206565607">2.3 Create Service Definition and Service Binding</H2><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf3.png" style="width: 394px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98728iCD162A9C956A3C92/image-size/large?v=v2&amp;px=999" role="button" title="shelf3.png" alt="shelf3.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf4.png" style="width: 655px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98729i22C9D0493C6324B8/image-size/large?v=v2&amp;px=999" role="button" title="shelf4.png" alt="shelf4.png" /></span></P><P>&nbsp;And then we can preview the published service:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf5.png" style="width: 655px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98731i8B09CCF0DDB516B6/image-size/large?v=v2&amp;px=999" role="button" title="shelf5.png" alt="shelf5.png" /></span></P><P>&nbsp;</P><H2 id="toc-hId-10052102"><STRONG>3. Frontend App Development</STRONG></H2><P>First create destination on BTP:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf6.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98732i100F91375D5B9B6D/image-size/large?v=v2&amp;px=999" role="button" title="shelf6.png" alt="shelf6.png" /></span></P><P>&nbsp;</P><P>Then open BAS service, and choose SAP Fiori Worklist Application:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf7.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98733i037300034A6E42CE/image-size/large?v=v2&amp;px=999" role="button" title="shelf7.png" alt="shelf7.png" /></span></P><P>&nbsp;</P><P>After publish, and authorization setup, we can see the App like below:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="shelf8.png" style="width: 664px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98734i933550D898707A4E/image-size/large?v=v2&amp;px=999" role="button" title="shelf8.png" alt="shelf8.png" /></span></P><P>&nbsp;</P> 2024-04-19T13:16:11.809000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/analyze-expensive-abap-workload-in-the-cloud-with-work-process-sampling/ba-p/13675553 Analyze Expensive ABAP Workload in the Cloud with Work Process Sampling 2024-04-19T15:56:01.041000+02:00 sebastian_kusch https://community.sap.com/t5/user/viewprofilepage/user-id/508815 <P>As an administrator or developer in the ABAP environment in the cloud, you need to keep track of the workload that kept your system busy throughout the day or at specific points in time. You want to check how many of your work processes are or were occupied with what kind of workload, consuming how much ABAP CPU time and main memory. Finally, you want to find out which ABAP coding was responsible for the high consumption of these resources.&nbsp;</P><P>In this blog post, I’d like to show you how you can use the <EM>Sampled Work Process Data</EM> app to analyze concurrent workload and resource consumption and to find the root cause of a performance problem.</P><P>&nbsp;</P><H1 id="toc-hId-863533218"><STRONG>Sampled Work Process Data App vs. Other Tools</STRONG></H1><P>Maybe you are already familiar with the <EM>System Workload</EM> app that provides an overview of the ABAP workload in your system. The following blog post gives you an insight with examples:</P><P><U><A href="https://community.sap.com/t5/technology-blogs-by-sap/analyzing-performance-degradations-in-the-abap-environment-in-the-cloud/ba-p/13557456" target="_blank">Analyzing Performance Degradations in the ABAP Environment in the Cloud</A></U></P><P>The ABAP system provides two data capturing mechanisms for the ABAP workload: ABAP statistics records and ABAP work process samples. The different strategies for data collection and timing aspects are explained in the following documentation on SAP Help Portal:</P><P><A href="https://help.sap.com/docs/btp/technical-monitoring-cockpit-cloud-version/monitoring-system-workload-data-provisioning" target="_blank" rel="noopener noreferrer">Monitoring the System Workload: Data Collection and Focus of Available Apps | SAP Help Portal</A></P><P>Both data capturing strategies are designed to cover different scenarios. You can read more about the supported monitoring use cases in the following documentation on SAP Help Portal:</P><P><A href="https://help.sap.com/docs/btp/technical-monitoring-cockpit-cloud-version/monitoring-system-workload-apps-and-their-use-cases" target="_blank" rel="noopener noreferrer">Monitoring the System Workload: Apps and Their Use Cases | SAP Help Portal</A></P><P>The ABAP statistics data of the <EM>System Workload</EM> app is persisted after the respective processing step has finished. In addition, the data on CPU time and main memory consumption is only available for the entire processing step, so you can’t determine if any interesting "hotspot" is hiding somewhere in the ABAP coding, let alone where they’re precisely located in the code.</P><P><SPAN>You might also have heard about - or already used - the ABAP Profiler, which creates ABAP traces that provide detailed insights into your program, its resource consumption and potential "hotspots" in your coding. However, using the ABAP Profiler requires you to explicitly activate it before running any specific program or application. This means that retrospective analysis is not possible. Furthermore, the results are usually limited to your application only, or at best a subset of the workload in the system. Other software running concurrently, which may cause resource bottlenecks, is not considered.</SPAN><SPAN>&nbsp;</SPAN>For more information about the ABAP Profiler, please refer to the following documentation on SAP Help Portal:</P><P><A href="https://help.sap.com/docs/abap-cloud/abap-development-tools-user-guide/profiling-abap-code?version=sap_btp" target="_blank" rel="noopener noreferrer">Profiling ABAP Code | SAP Help Portal</A></P><P>If you want to detect a large resource consumption immediately <SPAN>&nbsp;</SPAN>or detect the responsible code location without activating any tracing, you’d rather use the <EM>Sampled Work Process Data</EM> app.</P><P>&nbsp;</P><H1 id="toc-hId-667019713"><STRONG>Get an Overview of the ABAP CPU Time Consumption</STRONG></H1><P><STRONG>&nbsp;</STRONG>On the SAP Fiori launchpad of the ABAP environment in SAP BTP, I went to the <EM>Technical Monitoring</EM> area and chose the <EM>Sampled Work Process Data</EM> app. This app is available for administrator and developer roles.<SPAN>&nbsp;</SPAN></P><P>On the entry screen of the app, I get an overview of the ABAP CPU time consumption for the last 24 hours with a resolution of ten minutes. I can easily adjust the time range and the resolution using the time slider at the top.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Time Slider" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98593i61C63D21ECC77A2F/image-size/large?v=v2&amp;px=999" role="button" title="2024-03-04_15-22-58.jpg" alt="Time Slider" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Time Slider</span></span></P><P>I can even change to a granularity of single seconds. Of course, this only makes sense for a total time range of much less than 24 hours, such as 1 minute, for instance.</P><P>In the upper part of the screen, there’s a graphical overview drilled down by the <EM>Request Entry Type</EM> (for example, <EM>OData v4</EM> or <EM>SQL Service</EM>). In the lower part of the screen, there’s a table that lists the top 10 consumers with more detailed characteristics, such as the <EM>Request Entry Name</EM>. Additionally, there’s a metric that indicates the overall ABAP CPU utilization as a percentage over time. This is represented by the black line in the screenshot below, with a scale located on the right side.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABAP CPU Time Overview" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98611i3BC376181C22D131/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-19_09-48-26.jpg" alt="ABAP CPU Time Overview" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">ABAP CPU Time Overview</span></span></P><H1 id="toc-hId-470506208"><STRONG>A</STRONG><STRONG>nalyze Concurrent Workload and Resource Consumption</STRONG></H1><P><SPAN>The entry screen provides four different metrics to depict resource consumption. These metrics include ABAP CPU time, main memory, and dialog and background work process utilization. Speaking of filters, you can use the filters for </SPAN><EM>Transaction Code</EM><SPAN>, </SPAN><EM>Request Entry Type</EM><SPAN>, </SPAN><EM>Request Entry Name</EM><SPAN>, </SPAN><EM>Tenant ID</EM><SPAN> and </SPAN><EM>WM Process Class ID</EM><SPAN> to focus on what you are really interested in:</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Filter and Drilldown" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98618i696D8341DB1B6AA7/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-19_09-53-03.jpg" alt="Filter and Drilldown" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Filter and Drilldown</span></span></P><P>Filter values can be precise values or wildcards.</P><P>When it comes to drilldown, you might be interested in drilling down according to other characteristics or a more fine-grained resolution of the depicted workload. On the upper right, you can define the set of characteristics that the drilldown is based on:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adjusting the Drilldown" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98620i8BD9CE528E8DDE15/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-19_09-54-49.jpg" alt="Adjusting the Drilldown" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Adjusting the Drilldown</span></span></P><P>By default, this is only the <EM>Request Entry Type</EM>. However, you can also select the <EM>Transaction Code</EM>, <EM>Request Entry Name</EM>, <EM>Tenant ID</EM> and <EM>WM Process Class ID</EM>, either individually or in any combination that is appropriate for your specific use case. This allows you to investigate concurrent resource consumption in different dimensions. In the chart below, the top values of your drilldown characteristics (in this case, just the <EM>Request Entry Name</EM>) are displayed accordingly:</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABAP CPU Time Drilled Down by the Request Entry Name" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98621i07BE60C68C283905/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-19_09-56-04.jpg" alt="ABAP CPU Time Drilled Down by the Request Entry Name" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">ABAP CPU Time Drilled Down by the Request Entry Name</span></span></P><P>In the chart, you can clearly identify which types of workloads are competing <STRONG>concurrently</STRONG> for resources within the same 10 minutes interval. By adjusting the time slider, you can also choose much finer granularities.</P><P><STRONG>Note: </STRONG>Please be aware that the work process sampling is, as the name suggests, based on samples (snapshots) of the work process data provided by the ABAP kernel that are taken once per second. The ABAP CPU time consumption is then calculated as the delta between consecutive samples. This means that only expensive workloads running for more than a second are displayed as relevant ABAP CPU time consumers.</P><P>&nbsp;</P><H1 id="toc-hId-273992703"><STRONG>Reveal the Root Cause of Performance Problems</STRONG></H1><P>Now let’s assume that we don’t have a uniform distribution of the workload as in the example above. Instead, one of the <EM>Request Entry Name</EM> values is popping up again and again, for example, around 09:30 a.m.:&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABAP CPU Time with an Expensive Workload" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98622i672C9EB82D7CCC09/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_11-35-57.jpg" alt="ABAP CPU Time with an Expensive Workload" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">ABAP CPU Time with an Expensive Workload</span></span></P><P>I click on the bar in the chart as shown in the above screenshot (which filters for the respective <EM>Request Entry Name</EM> <STRONG>and</STRONG> time interval) and then on the <EM>Details</EM> arrow on the right of a table row. This takes me to the <EM>Request Entry Point</EM> screen for the ABAP CPU time. (If I had switched to the <EM>Main Memory</EM> or another aspect before, I would arrive at a corresponding detail view for that metric, of course.) Since I have also selected a specific time interval, I get a zoomed-in view with a resolution of single seconds, here for the time range between 09:20 and 09:30:</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Request Entry Point Screen with a Resolution of Single Seconds" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98623i70240CC009284DA8/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_09-45-22.jpg" alt="Request Entry Point Screen with a Resolution of Single Seconds" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Request Entry Point Screen with a Resolution of Single Seconds</span></span></P><P>This screens also offers a graphical overview over time, along with further details in the table. However, the drilldown characteristic in the chart is the <EM>Current Program Name</EM>, that is the name of the coding artifact (typically a class name) that was being executed when the sample was created. This chart may already give you a pretty good understanding of which parts of your application (on a technical level in terms of ABAP coding that is run) are expensive and where you may find optimization potential (as shown in the screenshot below). Clicking on the legend or directly on the chart filters the table data accordingly. You can zoom in and zoom out, as on the previous screens. The lower part of the screen shows a list of single work process samples, which include detailed characteristics and metrics describing the work process at specific points in time.</P><P>In this case, we can recognize two executions of the same workload that were both running for two and a half minutes. During the execution, the CPU time consumption per second was often close to 1000 milliseconds.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="“Most Prominent” Current Program Name in Our Example" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98624iDB3F06E1F8C3F6CE/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_09-45-22-2.jpg" alt="“Most Prominent” Current Program Name in Our Example" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">“Most Prominent” Current Program Name in Our Example</span></span></P><P>Now I click on the <EM>Details</EM> arrow at the end of a row in the table, which leads me to the <EM>Single Work Process Sample</EM> object page with even more details:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Characteristics on the Object Page" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98625i9C9A33284381D424/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_09-51-35.jpg" alt="Characteristics on the Object Page" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Characteristics on the Object Page</span></span></P><P>For a database-intensive scenario, you have the option to navigate further to the ABAP statistics record using the link on the upper right of the screen. On the <EM>ABAP Statistics Record</EM> screen, you can find – among other things – detailed data about the HANA processing time and the single expensive SQL statements, as explained in the blog post about the <EM>System Workload</EM> app mentioned at the beginning of this blog post.</P><P>Now let’s go back to the <EM>Single Work Process Sample</EM> object page. Here, I can also switch to the <EM>Work Process: Metrics</EM> tab page of the object page to learn, for instance, about the number of table entries transferred between the application server and the database within the last second before this sample was taken:</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Metrics on the Object Page" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98626i6F6A04893453B078/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_09-53-09.jpg" alt="Metrics on the Object Page" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Metrics on the Object Page</span></span></P><P>In this ABAP CPU-intensive scenario<SPAN>&nbsp;</SPAN>, work process sampling can help directly identify whether there’s room for improvement. You can recognize that your application is CPU-intensive if many single samples have a CPU time consumption that’s not too far from 1 second, as is the case here.</P><P>Typical defects include expensive operations on large internal tables. On the <EM>ABAP Stack Trace</EM> tab page of the object page, I can check whether this is the reason for poor performance:</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABAP Stack Trace on the Object Page" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98627iFCE8626D00B26DB3/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_09-54-02.jpg" alt="ABAP Stack Trace on the Object Page" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">ABAP Stack Trace on the Object Page</span></span></P><P>By navigating from here to ABAP development tools for Eclipse (ADT) or an HTML viewer (by clicking on the <EM>Details</EM> arrow next to a line in the table), I can easily jump to the respective code where, in our simple example, a LOOP statement is executed on an internal table.</P><P><STRONG>Note</STRONG>: In the case of single expensive statements (typically a READ TABLE or a LOOP statement, as in our example here, or a long-running Open SQL statement), the ABAP kernel – when regaining control and returning a stack trace –usually points to the <STRONG>next</STRONG> statement (the one directly following the really expensive one). Thus, we shouldn’t be concerned about the IF statement, but rather the LOOP statement.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABAP Code Behind the Performance Glitch" style="width: 661px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98628iD530ED1AAA016741/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_09-56-41.jpg" alt="ABAP Code Behind the Performance Glitch" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">ABAP Code Behind the Performance Glitch</span></span></P><H1 id="toc-hId-77479198"><STRONG>Verify the Impact of Performance Improvements</STRONG></H1><P>In this simple example, the performance of the statement can be significantly improved by introducing a secondary key. In addition, we slightly adjust the LOOP statement by referring to the secondary key:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Enhancement of the Static Attribute ST_PIERS" style="width: 532px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98629iAA0A542B27049E8D/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_10-25-55.jpg" alt="Enhancement of the Static Attribute ST_PIERS" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Enhancement of the Static Attribute ST_PIERS</span></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Loop Statement Using the Secondary Key" style="width: 421px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98630i10F6857C0301CD62/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_11-26-52.jpg" alt="Loop Statement Using the Secondary Key" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Loop Statement Using the Secondary Key</span></span></P><P>We can assess the impact of this tiny change by inspecting the time interval from 10:00 to 10:10 a.m., during which the same workload was run again. This can be done on both the <EM>Sampled Work Process Data</EM> entry screen ...</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sampled Work Process Data Screen After Fixing the Issue" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98631iAA7E91B2DAD2FE79/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_19-20-29.jpg" alt="Sampled Work Process Data Screen After Fixing the Issue" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Sampled Work Process Data Screen After Fixing the Issue</span></span></P><P>...and the <EM>Request Entry Point</EM> screen by selecting the respective time interval.&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Request Entry Point Screen After Fixing the Issue" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98632i0FA78025CBEF453C/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_10-24-24.jpg" alt="Request Entry Point Screen After Fixing the Issue" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Request Entry Point Screen After Fixing the Issue</span></span></P><P>We can clearly recognize that now two executions of the same workload finish within seconds and that the FIND_RELATION_DATA method does not even show up in any of the collected work process samples anymore. Here are both versions of the workload in direct comparison on the <EM>Request Entry Point</EM> screen:</P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Non-Optimized and Optimized Workload on the Request Entry Point Screen" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/98634i23CFD8A5D605C9AF/image-size/large?v=v2&amp;px=999" role="button" title="2024-04-12_19-52-14.jpg" alt="Non-Optimized and Optimized Workload on the Request Entry Point Screen" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Non-Optimized and Optimized Workload on the Request Entry Point Screen</span></span></STRONG></P><H1 id="toc-hId--119034307"><STRONG>Conclusion</STRONG></H1><P>The <EM>Sampled Work Process Data</EM> app in the <EM>Technical Monitoring</EM> area of the SAP Fiori launchpad in an ABAP environment in the cloud gives you a lot of insights into concurrent workload in your system and lets you glance under the hood of ABAP CPU or memory intensive applications. It bridges the gap between apps based on ABAP statistics records and tracing tools like the ABAP Profiler.</P><P>I’d like to thank everyone who contributed to this blogpost, especially my colleagues anke.griesbaum, christian.cop, steffen.siegmund, ingrid.mautes, karen.kuck and sabine.reich.</P><P>For more information, refer to the following documentation on SAP Help Portal:</P><P><A href="https://help.sap.com/docs/btp/technical-monitoring-cockpit-cloud-version/sampled-work-process-data" target="_blank" rel="noopener noreferrer">Sampled Work Process Data | SAP Help Portal</A></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P> 2024-04-19T15:56:01.041000+02:00 https://community.sap.com/t5/technology-blogs-by-members/sap-btp-abap-in-the-cloud-custom-code-transformation-using-abapgit-and-gcts/ba-p/13683259 SAP BTP, ABAP in the Cloud Custom Code Transformation using abapGit and gCTS 2024-04-26T09:09:05.666000+02:00 AnslemArnolda https://community.sap.com/t5/user/viewprofilepage/user-id/490939 <H1 id="toc-hId-864394280">abapGit and gCTS (Git-enabled Change and Transport System)</H1><UL><LI>The basic idea behind abapGit is to exchange source code between any ABAP systems using a Gitbased repository.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_0-1714113883072.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102165iC646DCE9E96802FD/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_0-1714113883072.png" alt="AnslemArnolda_0-1714113883072.png" /></span></P><UL><LI>By introducing gCTS, SAP is aiming for the best of both worlds, that is, repository-based<BR />development where concurrent work on the same object is possible, while retaining all the benefits of<BR />central development.</LI><LI>Following is the process flow for gCTS.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_1-1714113919791.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102166i899E36D3C6AE5650/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_1-1714113919791.png" alt="AnslemArnolda_1-1714113919791.png" /></span></P><UL><LI>You can use gCTS to distribute your custom code through a central repository, which will enable<BR />possible rollbacks before importing to the target system, if required.</LI><LI>You can possibly use abapGit to move your on-premise ABAP objects to SAP BTP, ABAP<BR />environment. In the next section, we’ll demonstrate how to use abapGit to move ABAP objects from<BR />your SAP S/4HANA on-premise environment to SAP BTP, ABAP environment.</LI></UL><H1 id="toc-hId-667880775">Custom Code Transformation Using abapGit</H1><UL><LI>Transforming on-premise ABAP code to SAP BTP requires three primary steps.<UL><LI>Evaluating current code.</LI><LI>Installing abapGit.</LI><LI>Transforming code.</LI></UL></LI></UL><H2 id="toc-hId-600449989">Evaluation of On-Premise code for Compatibility</H2><UL><LI>Make sure that your code is using the ABAP for SAP BTP language version (ABAP for SAP Cloud<BR />Platform).</LI><LI>Once the language version is changed, execute ATC check or transaction SCI to check for any issues.</LI></UL><H2 id="toc-hId-403936484">Installing abapGIT on an On-Premise and as an Eclipse Plugin</H2><H3 id="toc-hId-336505698">On-Premise</H3><UL><LI>Create a new repository on GitHub.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_2-1714114188344.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102167i02751143FEE0025B/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_2-1714114188344.png" alt="AnslemArnolda_2-1714114188344.png" /></span></P><UL><LI>Give a name to the repository and click the “Create Repository” button</LI></UL><P style=" text-align: center; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnslemArnolda_3-1714114222926.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102169i5DB0297A229CB6FA/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_3-1714114222926.png" alt="AnslemArnolda_3-1714114222926.png" /></span></P><UL><LI>Visit&nbsp;<A href="https://github.com/abapGit/abapGit" target="_self" rel="nofollow noopener noreferrer">https://github.com/abapGit/abapGit</A>&nbsp;and click on the latest build as follows. This simply has the<BR />code for an ABAP report program.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_5-1714114364743.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102174i47EEAC0D202C43FF/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_5-1714114364743.png" alt="AnslemArnolda_5-1714114364743.png" /></span></P><UL><LI>Create a report program on your on-premise SAP system and copy the code you see above into the<BR />program and activate.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_6-1714114415257.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102175i5BE6F6F488A3FE5C/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_6-1714114415257.png" alt="AnslemArnolda_6-1714114415257.png" /></span></P><UL><LI>The following screen should appear once you execute this program</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_7-1714114447825.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102176i2BAF2035C7F0CBE0/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_7-1714114447825.png" alt="AnslemArnolda_7-1714114447825.png" /></span></P><UL><LI><FONT color="#008000">abapGit has now been installed on the on-premise system</FONT></LI></UL><H3 id="toc-hId-139992193">As an Eclipse Plugin</H3><UL><LI>Open ADT-&gt;Help-&gt;Install new software and enter the following URL to load abapGIT for ABAP<BR />development on ADT.<BR /><A href="http://eclipse.abapgit.org/updatesite/" target="_self" rel="nofollow noopener noreferrer">http://eclipse.abapgit.org/updatesite/</A>&nbsp;</LI><LI>Simply click on “Next” and install the plugin</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_8-1714114536582.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102178i85717065602DA68F/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_8-1714114536582.png" alt="AnslemArnolda_8-1714114536582.png" /></span></P><H1 id="toc-hId--314686750"><SPAN>Transform code form on-premise to cloud</SPAN></H1><UL><LI>Visit your GitHub repository and copy the URL corresponding to your repository.<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_9-1714114638007.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102179i737F4A2577479924/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_9-1714114638007.png" alt="AnslemArnolda_9-1714114638007.png" /></span></LI><LI>Go back to your ABAP report program on the on-premise system, Click new online.<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_10-1714114679406.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102180iB59390444D374994/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_10-1714114679406.png" alt="AnslemArnolda_10-1714114679406.png" /></span></LI><LI>Paste the URL you copied above to the following location, along with the package that you want to<BR />commit to the Git Repository you created above. This is the package that is in your on-premise<BR />system, which you want to migrate to the cloud environment.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_11-1714114737055.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102181iA9C5475738D5103D/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_11-1714114737055.png" alt="AnslemArnolda_11-1714114737055.png" /></span></P><UL><LI>Click on “Create Online Repo”.</LI><LI>Once the execution is completed, you should see the cloned repository as follows, which is ready to<BR />be committed to the online Git Repository.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_12-1714114776492.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102182i2C73AD2DD11B82D8/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_12-1714114776492.png" alt="AnslemArnolda_12-1714114776492.png" /></span></P><UL><LI>Now click on “stage” and “commit all changes” to the online repository</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_13-1714114813371.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102183i0F62299C7ED0668D/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_13-1714114813371.png" alt="AnslemArnolda_13-1714114813371.png" /></span></P><UL><LI>Give a comment for the commit that you do each time as follows. Click on “Commit”</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_14-1714114841595.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102184i2DD0DA94A426C455/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_14-1714114841595.png" alt="AnslemArnolda_14-1714114841595.png" /></span></P><UL><LI>This will request for your GitHub credentials, to authenticate. Give them and Continue.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_15-1714114868471.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102185i71F02C4E81D65C69/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_15-1714114868471.png" alt="AnslemArnolda_15-1714114868471.png" /></span></P><UL><LI>Once the commit is complete, you should see a message as follows</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_16-1714114894483.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102187i5CC4FC204E1A87D3/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_16-1714114894483.png" alt="AnslemArnolda_16-1714114894483.png" /></span></P><UL><LI>And the source code under the package should be available in your online Git Repository.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_17-1714114920621.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102188i71A2C03399BD2B6C/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_17-1714114920621.png" alt="AnslemArnolda_17-1714114920621.png" /></span></P><UL><LI>Open ADT on Eclipse-&gt; Select Your ABAP in the cloud Project -&gt; Window -&gt; Show -&gt; Other -&gt;<BR />abapGit Repositories.</LI><LI>Click the “Plus” button to link your abapGit Repository to ADT. Give the URL corresponding to your<BR />Git Repository here as well.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_18-1714114954043.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102189i79E8D97B3F282772/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_18-1714114954043.png" alt="AnslemArnolda_18-1714114954043.png" /></span></P><UL><LI>Create a package in your ABAP in the cloud project, to which you will be importing all the supported<BR />objects in your on-premise ABAP package. Here I have given the same package name.</LI><LI>Make sure to put the “Pull after link” tick as well, so the objects will be pulled from your online Git Repository into ABAP in the cloud project.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_19-1714114997143.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102191iC24B7427E2A1821B/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_19-1714114997143.png" alt="AnslemArnolda_19-1714114997143.png" /></span></P><UL><LI>Once that is completed, you should see all supported objects on your on-premise system, imported<BR />into your ABAP in the cloud package.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AnslemArnolda_20-1714115024338.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102192iF34FF9866184EC43/image-size/medium?v=v2&amp;px=400" role="button" title="AnslemArnolda_20-1714115024338.png" alt="AnslemArnolda_20-1714115024338.png" /></span></P><P>&nbsp;</P> 2024-04-26T09:09:05.666000+02:00 https://community.sap.com/t5/technology-blogs-by-sap/sap-datasphere-sap-s-4hana-your-guide-to-seamless-data-integration/ba-p/13662817 SAP Datasphere + SAP S/4HANA: Your Guide to Seamless Data Integration 2024-04-29T20:33:46.737000+02:00 jeetendrakapase https://community.sap.com/t5/user/viewprofilepage/user-id/16635 <H2 id="toc-hId-991605806">Introduction:</H2><P>Achieving seamless data integration between SAP S/4HANA, your core operational ERP system, and SAP Datasphere, the business data platform is a critical requirement for most SAP customers. This integration unlocks powerful reporting capabilities across various business functions.<BR />This technical article aims to empower you with expert tips and strategies to simplify and enhance your SAP S/4HANA integration for operational reporting, analytical insights, and planning &amp; forecasting purposes. You are following the best practices and knowing what is supported and when to use what. you can streamline data integration unlock the full potential of this integration and bring more time to value.</P><DIV class="">&nbsp;</DIV><H2 id="toc-hId-795092301">SAP S/4HANA Data Integration Explained:</H2><P>This diagram illustrates various methods for integrating data with SAP S/4HANA, covering both data federation and replication scenarios.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_0-1714415475348.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103467iF884957781990E0A/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_0-1714415475348.png" alt="jeetendrakapase_0-1714415475348.png" /></span></P><P>&nbsp;</P><DIV class=""><H4 id="toc-hId-856744234">Source Object Types:</H4><OL><LI><STRONG>ABAP CDS Views:</STRONG>&nbsp;It provides business data along with semantic(context) information (hierarchies, text, etc.), security, associations, and&nbsp;improved performance.</LI><LI><STRONG>ODP Extractors</STRONG>: Specialized tools designed to extract specific datasets from SAP S/4HANA.</LI><LI><STRONG>ABAP Tables:</STRONG> The traditional SAP master and fact tables are used for raw business data storage.</LI></OL><H4 id="toc-hId-660230729">Delta Handling Mechanisms During Data Replication:</H4><OL><LI><STRONG>Database Trigger-based CDC Delta:</STRONG> This method leverages database triggers to capture changes in real-time. It utilizes the well-established SAP Landscape Transformation Replication Server (SLT) technology.ABAP Pipeline Engine (APE): This framework provides flexibility for building custom CDC pipelines suited to specific needs.</LI><LI><STRONG>Generic Timestamp/Date-based Delta</STRONG><SPAN>: This approach relies on a designated timestamp/date column within your ABAP CDS views to identify data modifications.</SPAN></LI></OL><H4 id="toc-hId-463717224">ODP Technical Infrastructure:</H4><UL><LI><STRONG>Operational Data Provisioning (ODP) Framework:</STRONG> This is the modern framework for CDC, replacing the older RSA7 (BW Delta Queues) approach. It simplifies data extraction and management.</LI><LI><STRONG>Operational Delta Queue (ODQ):</STRONG> This queue stores changes made to data until they are replicated.</LI></UL><H4 id="toc-hId-267203719">Data Builder Objects in SAP Datasphere facilitate your integration with SAP S/4HANA:</H4><OL><LI><STRONG>Remote Tables: </STRONG>Enable access to SAP S/4HANA data in real-time or through snapshots.</LI><LI><STRONG>Replication Flows:</STRONG> These define the path for data replication from source to target system.</LI><LI><STRONG>Data Flows:</STRONG> These specify the transformations applied to the data during replication.</LI></OL><H4 id="toc-hId-70690214">Model Import Wizard:</H4><P>This tool imports valuable metadata, context, and semantics from your CDS views, including associations, logic, and security information. Convert the&nbsp;SAP S/4HANA CDS semantics to&nbsp;SAP Datasphere data and business builder entities using the wizard, take a quick look at the below image for the I_PRODUCT CDS view same can also be done for the Sales Order, and Purchase Order CDS views. It is automatic, and you can imagine how much time/effort is required to build something similar to a standalone. This is something you will only get with Datasphere.&nbsp;</P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_0-1714142806469.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102449iB2D3B042B3E69FA0/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_0-1714142806469.png" alt="jeetendrakapase_0-1714142806469.png" /></span><P>Now you may have a question what is the benefit of getting a data model available in SAP S/4HANA into SAP Datasphere? Let's look at the use case, I strongly believe one will apply to your organization's data platform needs.</P><OL><LI>Integrate with Non-SAP Data, It is obvious that you want to keep your SAP ERP clean for business transactions while needing a data platform to combine the SAP ERP business data with other business data segments with the context.</LI><LI>Strategic or Historical Reporting, over time you may plan to achieve the data from SAP S/4HANA hence for the historical data along with the business semantics for the reporting needs.</LI><LI>Leverage the Hyperscalar capabilities like ML/AI, with SAP Business data with semantic information.</LI></OL><H4 id="toc-hId--125823291">Source Object Types Support and Compatibility:</H4><P>The top diagram conveniently highlights which source object types are compatible with specific data integration objects within the SAP Datasphere.</P><H4 id="toc-hId--322336796">Prerequisites and Additional Software Components (Middleware):</H4><P>The diagram also indicates any prerequisites or middleware components needed for specific functionalities. For instance, Remote Tables require installing, configuring, and setting up the SAP Data Provisioning (DP) Agent with the ABAPAdapter. Refer to the help guide on <A href="https://help.sap.com/docs/SAP_DATASPHERE/9f804b8efa8043539289f42f372c4862/bffbd58c15784a62af0520f171018ded.html" target="_self" rel="noopener noreferrer">Preparing Connectivity for Connections</A> and filter based on the <EM>Connection Type</EM> = <EM>SAP S/4HANA.</EM></P><H4 id="toc-hId--518850301">Optional Components:</H4><UL><LI><STRONG>SAP BW bridge</STRONG>: This component (optional) creates a data staging layer specifically for supporting SAP S/4HANA ODP extractors. This is mainly for the existing SAP BW and BW/4HANA customers to enable a path towards conversion with SAP Datasphere, BW bridge, or Hybrid use case<UL><LI><A href="https://help.sap.com/docs/SAP_BW_BRIDGE/107a6e8a38b74ede94c833ca3b7b6f51/c6afacb707764885a6fb62f511c24f34.html" target="_self" rel="noopener noreferrer">Transferring Data using ODP Options</A><STRONG><BR /></STRONG></LI></UL></LI><LI><STRONG>SAP Landscape Transformation Replication Server (SLT):</STRONG> This server replicates tables from SAP S/4HANA to the SAP Datasphere and can be integrated into your Replication Flow.</LI></UL></DIV><DIV class="">&nbsp;</DIV><H4 id="toc-hId--1213080901"><SPAN>Further Resources:</SPAN></H4><DIV class=""><P>For a deeper understanding of ABAP CDS delta mechanics and the ODP framework, refer below:</P></DIV><UL><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/cds-based-data-extraction-part-i-overview/ba-p/13425314" target="_self">CDS-based data extraction with delta handling mechanism</A>.&nbsp;&nbsp;</LI><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/operational-data-provisioning-odp-faq/ba-p/13348937" target="_self">Understanding ODP, The Functionality of ODP, and Using ODP Effectively.</A></LI></UL><P>&nbsp;</P><H3 id="toc-hId--1116191399">Recommendations for choosing the right approach for SAP S/4HANA Data Federation and Replication into SAP Datasphere:</H3><OL><LI><STRONG>Recommended option is ABAP CDS Views:</STRONG> If the ABAP CDS is available with the desired data needs then establish a direct connection between SAP Datasphere and the source system. <U>Leveraging the available CDS views is the BEST and RECOMMENDED Approach</U>. Recommend to use <EM><STRONG>released CDS views</STRONG></EM> as they are upgrade stable.<UL><LI><A href="https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/ee6ff9b281d8448f96b4fe6c89f2bdc8/5418de55938d1d22e10000000a44147b.html" target="_self" rel="noopener noreferrer">Individual C1-released CDS views across various business areas.</A><UL><LI><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_1-1714148200127.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102489iED94B288251617FC/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_1-1714148200127.png" alt="jeetendrakapase_1-1714148200127.png" /></span></LI></UL></LI><LI><A href="https://api.sap.com/content-type/CDSViews/cdsviews/cdsviews" target="_self" rel="noopener noreferrer">SAP Business Accelerator Hub List of Released CDS Views.</A> Here you can filter based on the capabilities of <EM>Data Source for Data Extraction</EM> to find extraction-enabled released ABAP CDS views.<BR /><UL><LI><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_0-1714145711251.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/102466i162F025968AD798A/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_0-1714145711251.png" alt="jeetendrakapase_0-1714145711251.png" /></span></LI></UL></LI><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/finding-the-right-cds-extractor-in-sap-s-4hana/ba-p/13521296" target="_self">Finding the right CDS Extractor in the SAP S/4HANA System</A><SPAN>. In SAP S/4HANA On-Prem or Private cloud &gt;=2020, You can use Tcode SE16N with CDS SQL View: IXTRCTNENBLDVW (I_DataExtractionEnabledView) or View Browser Fiori App.</SPAN><UL><LI>How to find the released Sales Document Item CDS view using SE16N GUI Tcode?</LI><LI><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_2-1714404263739.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103369iDAB2B0BCFD99DA0D/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_2-1714404263739.png" alt="jeetendrakapase_2-1714404263739.png" /></span>&nbsp;How to find the released Sales Document Item CDS view using the <A href="https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps('F2170')" target="_self" rel="nofollow noopener noreferrer">View Browser</A><SPAN> Fiori App? You will need the business role:&nbsp;</SPAN><SPAN>SAP_BR_ANALYTICS_SPECIALIST. Tcode&nbsp;/UI2/FLP -&gt; View Browser -&gt; Released Views for Cloud Development</SPAN><UL><LI>&nbsp;<span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_3-1714404403025.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103370iCBA862F8FA8B4310/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_3-1714404403025.png" alt="jeetendrakapase_3-1714404403025.png" /></span><P>&nbsp;</P></LI><LI><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jeetendrakapase_0-1714405855472.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/103388i9E8E8402BE9DDDC5/image-size/large?v=v2&amp;px=999" role="button" title="jeetendrakapase_0-1714405855472.png" alt="jeetendrakapase_0-1714405855472.png" /></span><P>&nbsp;</P></LI></UL></LI></UL></LI><LI><SPAN>Recommended using standard CDS views with extension capabilities, and pre-built business contents over creating custom CDS views as long-term custom CDS may not be a sustainable option with the upgrades and may lead to performance implications. However, all requirements cannot be met with the standards hence only create custom CDS when it becomes business required and no standard alternative is available.</SPAN></LI><LI><P><STRONG>Unavailable CDS Views:</STRONG> The required CDS views haven't been released yet. Missing Data Extraction Settings: The data extraction settings are not configured even if the CDS views are available. There are two approaches to resolving these issues:</P><OL><LI><P><SPAN>Customer Influence Request: Raise a customer influence request or upvote the existing one at <A href="https://influence.sap.com/sap/ino/#campaign/3024" target="_self" rel="noopener noreferrer">SAP S/4HANA Cloud Public Edition, CDS View Extraction Enablement</A>.&nbsp;</SPAN><SPAN>OR&nbsp;</SPAN><SPAN>Open a<SPAN>&nbsp;</SPAN><SPAN class="">Product Support<SPAN>&nbsp;</SPAN></SPAN>Ticket For High Priority Request: A ticket can be submitted to the relevant component for a long-term solution. Be aware that this process may take some time.</SPAN></P></LI><LI><SPAN>Build a Custom CDS View: Create a custom CDS view replicating the missing one. You can then enable data extraction on this custom view for your use.&nbsp;</SPAN><A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-datasphere-replication-with-change-data-capture-on-a-custom-sap-s4-cds/ba-p/13599587" target="_self">How to Create a Custom ABAP CDS View with Change Data Capture Delta Mechanism.</A></LI><LI><A class="" href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/how-to-deal-with-not-released-predefined-vdm-in-s-4hana/ba-p/13422152" target="_blank">How to deal with “Not released” predefined VDM in S/4HANA</A>.</LI></OL></LI></UL><UL><LI><STRONG>DATA FEDERATION FIRST THEN DATA REPLICATION</STRONG>, The approach for using the CDS view as a data federation goes back to the basics <span class="lia-unicode-emoji" title=":slightly_smiling_face:">🙂</span><OL><LI>Select the required columns from the projection. e.g. CDS view may have 200 columns however business may require 75 columns. hence select only 75 columns.&nbsp;</LI><LI>Filter the data as early as possible based on attributes like company code, sales org, plant, dates, or periods.</LI><LI>Business logic and data aggregation can be handled in the source CDS view, you do not have to do it on SAP Datasphere, unless required.&nbsp;</LI><LI>Use the view persistency option intelligently to get optimized data and high performance.</LI><LI>Middleware components like DPAgent need to be sized properly S-M-L, go with a higher side like 16GB, 32GB memory vs 4GB default and 8 cores CPU.</LI></OL></LI><LI><STRONG>Restrictions:&nbsp;</STRONG><A href="https://me.sap.com/notes/2890171" target="_self" rel="noopener noreferrer">2890171 - SAP Data Intelligence / SAP Datasphere - ABAP Integration</A><OL><LI>Not supported for data transfer if the CDS view not having the "dataExtraction" annotation.</LI><LI>CDS view for the delta load requires the "dataExtraction" and "changeDataCapture" annotations.</LI><LI>CDS Views having parameters and a table function are not supported.</LI><LI>CDS Views include Tables with a client field as a key, not a client-dependent field.</LI><LI>Data extraction halts with an error if the structure of a table or CDS view changes mid-load or replication. Unfortunately, resuming after such an error isn't currently possible, requiring a full restart of the data extraction process.</LI></OL></LI></UL></LI><LI><STRONG>An alternative option is ODP extractors: </STRONG>If the ABAP CDS view is unavailable then prefer ODP objects over the direct ABAP table replication. A&nbsp;direct connection can be established provided SAP S/4HANA has the DMIS add-on.</LI><LI><STRONG>The discouraged option is Direct ABAP Table Access and Replication: </STRONG>Bypassing CDS views to replicate tables into SAP Datasphere directly is not recommended. This approach involves replicating raw data (master and transactional) without its inherent business context and relationships. Essentially, you'd be replicating the data and then manually recreating the associations, logic, and hierarchies – a time-consuming and error-prone process. The preferred approach is to leverage the existing, comprehensive CDS data models whenever possible. However, if replicating tables is unavoidable due to specific business or compliance requirements, then the recommendations below should be followed.<OL><LI><STRONG>Standalone SAP LT Replication Server</STRONG>: For replicating tables, the recommended approach.</LI><LI><STRONG>Embedded(Add-on) SAP LT Replication in&nbsp;SAP S/4HANA</STRONG>: This option is discouraged because it's tightly coupled with the SAP S/4HANA version. Upgrading the server requires a complete SAP S/4HANA upgrade, limiting flexibility. Downporting new functionalities to older versions is also not feasible.</LI><LI><STRONG>Restrictions</STRONG>:<OL><LI><SPAN>Replicating tables with redirect views (e.g., MBEW, MARD, COEP) from your SAP S/4HANA source system is not supported.</SPAN></LI><LI>Declustering of INDX-like tables (e.g. STXL, PCL1, ...) during the transfer is not supported.</LI></OL></LI></OL></LI></OL><P>&nbsp;</P><H2 id="toc-hId--1019301897">SAP S/4HANA Connection Supported SAP Datasphere Integration Features:</H2><P>&nbsp;</P><TABLE border="1" width="100%"><TBODY><TR><TD width="15%" height="30px">&nbsp;</TD><TD width="25%" height="30px"><P>Supported Objects Types</P></TD><TD width="35%" height="30px"><P>Delta Load Supported?</P></TD><TD width="25%" height="30px"><P>Prerequisite Connectivity Components?</P></TD></TR><TR><TD width="15%"><P><A href="https://help.sap.com/docs/SAP_DATASPHERE/c8a54ee704e94e15926551293243fd1d/7c4acd33e39a451e99c87f0661772443.html" target="_self" rel="noopener noreferrer">Remote Tables</A></P></TD><TD width="25%"><UL><LI><P>ABAP Tables</P></LI><LI><P><SPAN>Extractors:</SPAN></P><UL><LI><P>ABAP_CDS</P></LI><LI><P>ODP_BW</P></LI><LI><P>ODP_SAPI</P></LI></UL><P>&nbsp;</P></LI><LI><P>Model Import</P></LI></UL></TD><TD width="35%"><P style=" text-align: center; ">YES - Real-time data replication.</P><UL><LI><P>The object in the source has to be enabled for change data capture (CDC).</P></LI><LI><P>For source views, ABAP Dictionary tables real-time replication is not supported.</P></LI><LI><P>For ABAP ODP sources, real-time replication is supported in the following cases:</P><P>ODP-BW: InfoProviders with a change log.object type ADSO), Standard DataStore objects (classic) (object type ODSO), InfoObjects</P><P>ODP-CDS: For all ABAP CDS views with primary key and that are delta-enabled</P><P>ODP-SAPI: For all extractors that are delta enabled (delta method ADD* not allowed) and have a primary key.</P></LI><LI><P>For an overview of all S-API extractors released for ODP replication. refer:&nbsp; &nbsp;<FONT size="1 2 3 4 5 6 7"><A href="https://me.sap.com/notes/2232584" target="_self" rel="noopener noreferrer">2232584 - Release of SAP extractors for ODP replication (ODP SAPI)</A>&nbsp;</FONT></P></LI><LI><P>For remote tables using an SAP HANA smart data access connection (SAP HANA on-premise via Cloud Connector or SAP HANA Cloud), you can replicate your data changes in real-time but with some restrictions as some remote object types are not supported:</P><P>The remote object needs to be a table of type "COLUMN TABLE" (other table types like Row Tables or Virtual Tables are not supported)</P><P>Some data types and SAP HANA table features are not supported. For more information, see Unsupported Data Types and Other Limitations.</P><P>Note You can’t pause the replication for connections if SAP HANA smart data access is used.</P></LI><LI><P>For remote tables connected via an SAP HANA smart data integration Cloud Data Integrator (CDI) adapter, we recommend that you use a DP Agent with the latest version.</P></LI></UL></TD><TD width="25%"><P><A href="https://help.sap.com/docs/SAP_DATASPHERE/9f804b8efa8043539289f42f372c4862/f1a39d1a763e48c8872f45c110a5a4e2.html" target="_self" rel="noopener noreferrer">DP(Data Provisioning) Agent</A></P></TD></TR><TR><TD width="15%" height="228px"><P><A href="https://help.sap.com/docs/SAP_DATASPHERE/c8a54ee704e94e15926551293243fd1d/25e2bd7a70d44ac5b05e844f9e913471.html" target="_self" rel="noopener noreferrer">Replication Flows</A></P></TD><TD width="25%" height="228px"><UL><LI>CDS_EXTRACTION <FONT size="1 2 3 4 5 6 7">(ABAP CDS Views Enabled for Data Extraction)</FONT></LI><LI>ODP_BW</LI><LI>ODP_SAPI</LI><LI>SLT (add-on DMIS )</LI></UL></TD><TD width="35%" height="228px"><P style=" text-align: center; ">YES - Load type: Initial and Delta</P><UL><LI><SPAN>The default delta load interval is 60 minutes. You can change the integer between 0 and 24 for hours and 0 and 59 for minutes, respectively. </SPAN></LI><LI><SPAN>If you enter 0 hours and 0 minutes, the system replicates any source changes immediately.</SPAN></LI><LI>Performance Issues:&nbsp;<FONT size="1 2 3 4 5 6 7"><A href="https://me.sap.com/notes/3360905/E" target="_self" rel="noopener noreferrer"><SPAN><SPAN>3360905 - SAP Data Intelligence / SAP Datasphere - ABAP Integration - Performance when using RMS / Replication Flows</SPAN></SPAN></A></FONT></LI></UL></TD><TD width="25%" height="228px"><UL><LI>SAP S/4HANA On-Premise: <A href="https://help.sap.com/docs/SAP_DATASPHERE/9f804b8efa8043539289f42f372c4862/35141e7668774958b5e59495f7a7828e.html" target="_self" rel="noopener noreferrer">Cloud Connector</A></LI><LI>SAP S/4HANA Cloud: None</LI></UL></TD></TR><TR><TD width="15%" height="124px"><P><A href="https://help.sap.com/docs/SAP_DATASPHERE/c8a54ee704e94e15926551293243fd1d/e30fd1417e954577baae3246ea470c3f.html" target="_self" rel="noopener noreferrer">Data Flows</A></P></TD><TD width="25%" height="124px"><UL><LI>CDS_EXTRACTION</LI><LI>SLT (add-on DMIS )</LI></UL></TD><TD width="35%" height="124px"><P style=" text-align: center; ">NO</P><UL><LI><FONT size="1 2 3 4 5 6 7">SAP Note:&nbsp;<A href="https://userapps.support.sap.com/sap/support/knowledge/en/3335277" target="_self" rel="noopener noreferrer">3335277 - Datasphere - No Delta or Init in Data Flow</A></FONT></LI></UL></TD><TD width="25%" height="124px"><UL><LI>SAP S/4HANA On-Premise: <A href="https://help.sap.com/docs/SAP_DATASPHERE/9f804b8efa8043539289f42f372c4862/35141e7668774958b5e59495f7a7828e.html" target="_self" rel="noopener noreferrer">Cloud Connector</A></LI><LI>SAP S/4HANA Cloud: None</LI></UL></TD></TR><TR><TD width="15%"><P><A href="https://help.sap.com/docs/SAP_DATASPHERE/c8a54ee704e94e15926551293243fd1d/845fedbd28574aa8b84239df848936f6.html" target="_self" rel="noopener noreferrer">Import Entities</A></P></TD><TD width="25%"><UL><LI>ABAP CDS Views Entities. e.g.: I_PRODUCT, I_BillingDocumentItem etc.</LI></UL></TD><TD width="35%"><P style=" text-align: center; ">N/A</P><UL><LI>Even though this object already exists from a prior import, any changes to its structure or meaning within the source system will be automatically detected, triggering an update and redeployment within your system.</LI><LI>By default objects created will be as data is federated (remote tables), you can switch to replication when required.</LI></UL></TD><TD width="25%"><UL><LI>SAP S/4HANA On-Premise: <A href="https://help.sap.com/docs/SAP_DATASPHERE/9f804b8efa8043539289f42f372c4862/f1a39d1a763e48c8872f45c110a5a4e2.html" target="_self" rel="noopener noreferrer">DP(Data Provisioning) Agent</A>, Cloud Connector</LI><LI>SAP S/4HANA Cloud: None</LI></UL></TD></TR></TBODY></TABLE><H4 id="toc-hId--1802621416"><SPAN>Further Resources:</SPAN></H4><DIV class=""><P>For a deeper understanding of the SAP S/4HANA and ECC integration scenarios with persistence options:&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-sap/exploring-integration-options-in-sap-datasphere-with-the-focus-on-using-sap/ba-p/13658329" target="_self">Exploring Integration Options in SAP Datasphere with a focus on using SAP extractors</A></P></DIV><H2 id="toc-hId--1412328907">Pre-built&nbsp;<A href="https://help.sap.com/docs/SAP_DATASPHERE/6eb1eff34e4c4b1f90adfbfba1334240/a88098ce6bfc1014a79e69594ccc91ad.html" target="_self" rel="noopener noreferrer">Business Content</A> for SAP S/4HANA:</H2><P>Overall, SAP Datasphere Business Content for SAP S/4HANA helps you unlock the full potential of your data by providing a faster, easier, and more reliable way to access, integrate, and analyze your business information. e.g.&nbsp;<A href="https://help.sap.com/docs/SAP_DATASPHERE/6eb1eff34e4c4b1f90adfbfba1334240/a878c25f6bfc1014a79e69594ccc91ad.html" target="_self" rel="noopener noreferrer">Finance Foundation for SAP S/4HANA and SAP S/4HANA Cloud</A>, <A href="https://help.sap.com/docs/SAP_DATASPHERE/6eb1eff34e4c4b1f90adfbfba1334240/a893bf4c6bfc1014a79e69594ccc91ad.html" target="_self" rel="noopener noreferrer">Sales Analysis for SAP S/4HANA and SAP S/4HANA Cloud,&nbsp;</A>etc.</P><P><STRONG>Faster Time to Value:</STRONG> Pre-built dashboards, data models, tables, and views with pre-defined business context eliminate the need for extensive development and configuration from scratch.&nbsp;</P><P><STRONG>Simplified Data Integration</STRONG>: Business Content streamlines the process of integrating data from SAP S/4HANA with other applications and data sources. This allows you to create a unified view of your data for more comprehensive analysis. With minimum effort, you will only have to replace the SAP S/4HANA server details in the connection placeholder and you are ready to consume the continent or if you want to replicate the data then just create the required replication flow and you are done. all details are provided as a part of the help guide.</P><P><STRONG>Preserved Business Context:</STRONG> Business Content captures the business meaning of the data, including units, hierarchies, and other relevant information. This ensures that users understand the data in its proper context and can make informed decisions.</P><P><STRONG>Alignment with Industry Standards:</STRONG> Business Content is often aligned with industry best practices and key performance indicators (KPIs), allowing you to benchmark your performance against industry standards</P><H3 id="toc-hId--1902245419">&nbsp;</H3><H3 id="toc-hId--2098758924">Key Takeaways:</H3><UL><LI>This breakdown highlights the various options in SAP Datasphere for data federation, extracting, transforming, and replicating data from SAP S/4HANA.The most suitable method(feature) depends on factors like real-time data federation or real-time updates vs. snapshots, data type, data volume, and the desired level of data transformation or conversions.</LI><LI>The data source object recommended precedence is ABAP CDS View &gt; ODP Extractors &gt; ABAP Tables. ABAP CDS view object type from SAP S/4HANA is the first-class citizen as a data source or provider from the ERP system. Customers can also prefer to create a custom CDS view with CDC capabilities even for the master data where date or timestamp columns are unavailable.</LI><LI>SAP S/4HANA real-time operational reporting can be done based on the Remote tables, and master data (smaller data sets) with Snapshot. For Mass data replication from SAP S/4HANA into SAP Dataspher Prefer, use the New Replication Flow.</LI><LI>&nbsp;The import model wizard provides the capability that scans the semantically rich CDS data model with associations and automatically creates the data builder and business builder objects with the default data federation scenario.</LI><LI>SAP S/4HANA Business Content provides time to value and quick win use case that can be enhanced.</LI><LI>Optional components like the BW bridge and SLT server can further enhance data integration capabilities and Safeguard existing on-prem investments and skillsets.</LI></UL><H3 id="toc-hId-1999694867">&nbsp;</H3> 2024-04-29T20:33:46.737000+02:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-workflow-administration-in-public-cloud/ba-p/13688471 SAP Workflow administration in Public Cloud 2024-05-01T18:39:36.671000+02:00 arghadipkar3013 https://community.sap.com/t5/user/viewprofilepage/user-id/686417 <P>First Login to Fiori Link for Public Cloud and Search app with Workflow as below</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_0-1714580961768.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104433iDB97E0AF4342BB8C/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_0-1714580961768.png" alt="arghadipkar3013_0-1714580961768.png" /></span></P><P>Now Select Workflow Administration App</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_1-1714580977054.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104434iE2ED008FD4F59E82/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_1-1714580977054.png" alt="arghadipkar3013_1-1714580977054.png" /></span></P><P>Here you can do a bunch of activities which needed different Tcode in On Premise System. Look out for creating Substitute for users.&nbsp;</P><P>Below for example we now execute for Restart Workflow</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_2-1714581076311.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104435i9771736B2F7CCD10/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_2-1714581076311.png" alt="arghadipkar3013_2-1714581076311.png" /></span></P><P>Below is the List Provided for Restart Workflow</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_3-1714581088365.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104436i19BC54FEBB662ECD/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_3-1714581088365.png" alt="arghadipkar3013_3-1714581088365.png" /></span></P><P>We can check details here</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_4-1714581104666.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104437i24FB4EE706FB2E46/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_4-1714581104666.png" alt="arghadipkar3013_4-1714581104666.png" /></span></P><P>We can check the Workflow Log also</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_5-1714581115333.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104438i5FF7F957E20285DD/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_5-1714581115333.png" alt="arghadipkar3013_5-1714581115333.png" /></span></P><P>Here is the Tcode for Backend system.</P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arghadipkar3013_6-1714581130725.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/104439i120829DF5DC55D57/image-size/medium?v=v2&amp;px=400" role="button" title="arghadipkar3013_6-1714581130725.png" alt="arghadipkar3013_6-1714581130725.png" /></span></P><P>&nbsp;</P><P>Below is the Video version</P><P><A href="https://youtu.be/BssG1UhVm-Y?si=yNfmXun6qD3qFOjd" target="_blank" rel="nofollow noopener noreferrer">https://youtu.be/BssG1UhVm-Y?si=yNfmXun6qD3qFOjd</A></P><P>Also check Playlist for Workflow</P><P><A href="https://youtu.be/p93SN2eAPH8?si=jR97GNo6XdkLYxTV" target="_blank" rel="nofollow noopener noreferrer">https://youtu.be/p93SN2eAPH8?si=jR97GNo6XdkLYxTV</A></P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P> 2024-05-01T18:39:36.671000+02:00 https://community.sap.com/t5/sap-maxattention-blog-posts/unlocking-the-power-of-cloud/ba-p/13662638 Unlocking the Power of Cloud 2024-05-03T14:09:31.393000+02:00 karolin https://community.sap.com/t5/user/viewprofilepage/user-id/1395662 <P>Embarking on a cloud migration journey can be a daunting task for any organization. Just like setting out on a long road trip, embarking on a cloud migration journey requires careful planning, a clear roadmap, and the guidance of experienced experts. <STRONG>SAP MaxAttention</STRONG> offers a distinctive solution, granting organizations access to a team of experts who can effectively guide them through their cloud journey.</P><P>In the study titled "The Total Economic Impact™ of <STRONG>SAP MaxAttention</STRONG> for Cloud Adoption," Forrester Consulting conducted interviews with 10 professionals from seven companies who have implemented <STRONG>SAP MaxAttention</STRONG>. The objective was to assess various aspects of cloud migration, including costs, benefits, and risks.&nbsp;The purpose of these interviews was to gain insights into the challenges, benefits, and risks associated with cloud migration. To model the results, Forrester synthesized the participants' experiences and consolidated the findings into a single composite organization representing a global enterprise entity with an annual revenue of US$25 billion. Upon careful examination of the data, Forrester concluded that <STRONG>SAP MaxAttention</STRONG> delivered a significant three-year financial impact throughout the cloud journey.</P><P>As you embark on your cloud journey, you can rely on the expertise of <STRONG>SAP MaxAttention</STRONG> professionals to provide valuable guidance and ensure your path to success. We invite you to explore the comprehensive study commissioned by SAP, titled <A href="https://news.sap.com/2023/03/forrester-consulting-study-sap-maxattention-supported-cloud-adoption/" target="_self" rel="noopener noreferrer"><STRONG>"The Total Economic Impact™ of SAP MaxAttention for Cloud Adoption,"</STRONG></A> which was published in February 2023.</P> 2024-05-03T14:09:31.393000+02:00 https://community.sap.com/t5/technology-blogs-by-members/calling-fragment-form-amp-send-it-as-an-attachment-using-abap-walk-through/ba-p/13702761 Calling Fragment Form & Send it as an attachment using ABAP Walk-Through 2024-05-15T21:53:21.876000+02:00 Amgad-El-Stohi https://community.sap.com/t5/user/viewprofilepage/user-id/144103 <P>This Blog is based on the Output Management Form and has all of its configuration completed&nbsp;</P><P>Ex for dunning: use maintenance view: V_T047E using code: sm30 to switch between frameworks through drop-down list</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AmgadElStohi_2-1715802008917.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111218iC0E3314F85AD76EA/image-size/medium?v=v2&amp;px=400" role="button" title="AmgadElStohi_2-1715802008917.png" alt="AmgadElStohi_2-1715802008917.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AmgadElStohi_3-1715802015965.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111219iB91DE235AAB0A4A7/image-size/medium?v=v2&amp;px=400" role="button" title="AmgadElStohi_3-1715802015965.png" alt="AmgadElStohi_3-1715802015965.png" /></span></P><P>First: you can identify Fields for Key &amp; Master Key internal tables for standard fragment form through putting a breaking point</P><P>By using framework: sap cloud and using fragment form template&nbsp; and of course maintain brf+ configuration</P><P>In class: CL_SOMU_FORM_SERVICES , Method : GET_DOCUMENT</P><OL><LI>Put a break point in the first line and go back to the previous program to see internal tables passed to form calling for keys.</LI><LI>Take screenshots for them, as you will be using them for the custom calling of the form as these fields are maintained according to configuration &amp; master form template derivation.</LI><LI>If you need the application ID Key, it’s a concatenation between multiple variables, You will find it in the call back class specific to a given object in the SPRO configuration</LI></OL><P>SPRO -&gt; CROSS APPLICATION COMPONENTS -&gt; OUTPUT CONTROL (here you can find all of OM Configuration)&nbsp; -&gt; DEFINE OUTPUT TYPE THEN SELECT THE ENTRY CORRESPONDING TO YOUR BRF+ ROLE and click details, you will find your call back class, in our class for dunning : CL_FIN_FO_DUNN_OUTPUT , all call back classes Implement same interface, then go into method : IF_APOC_COMMON_API~GET_FDP_PARAMETER</P><P>Second step:</P><P>Activate the legacy printout system and put a breakpoint inside the printing object whether it’s a program or function module, if you are using PDF, you can put a breakpoint in open job FM and trace back through the stack to the transaction screen printing program</P><P>In our case for dunning: It prints using FM : “PRINT_DUNNING_NOTICE_PDF”, put a breakpoint there</P><OL><LI>Start comparing the values of the key &amp; master key internal table with local variables available to locate the objects that contain the data which will&nbsp; be passed to the fragment forms Key internal tables from the standard<OL><LI>You will find all the data u need in the objects because whether it is fragment, PDF or whatever technology, the system always collects the same data passed one way or the other</LI></OL></LI><LI>After that start creating your custom code to call the fragment form<UL><LI>Consider the condition to identify which master form template to use.</LI></UL></LI><LI><STRONG>Create an enhancement in the standard program to defuse the standard code and prevent its execution, make sure that the standard code doesn’t update standard somewhere along the code as you need to confirm whether it happens through the OData service of fragment or not! (&nbsp;</STRONG><STRONG>because if not you will have to use the standard code that does that to make everything consistent )</STRONG></LI></OL><OL><LI>then test the cycle end to end</LI></OL><P><STRONG>in our case , here is the example for the PO Form</STRONG></P><OL><LI>I created a custom program se38 to test using po form</LI></OL><pre class="lia-code-sample language-abap"><code>*&amp;---------------------------------------------------------------------* *&amp; Report ZDUMMY *&amp;---------------------------------------------------------------------* *&amp; *&amp;---------------------------------------------------------------------* REPORT ZDUMMY. SELECTION-SCREEN BEGIN OF BLOCK b1. PARAMETERS: p_po_num TYPE ebeln MATCHCODE OBJECT h_ekko OBLIGATORY. SELECTION-SCREEN END OF BLOCK b1. INITIALIZATION. START-OF-SELECTION. DATA: lo_cl_somu_form_services TYPE REF TO cl_somu_form_services. DATA: lt_keys TYPE cl_somu_form_services=&gt;ty_gt_key. DATA: ls_ekko TYPE ekko. DATA: lt_master_keys TYPE cl_somu_form_services=&gt;ty_gt_key. DATA: lv_content TYPE xstring. DATA: lv_xml TYPE xstring. DATA: lv_pages TYPE fppagecount. DATA: lv_trace_string TYPE string. DATA: lv_stop_processing TYPE abap_bool. DATA: lt_message TYPE cl_somu_form_services=&gt;ty_gt_message. DATA: lv_output_length TYPE i. DATA: lt_generated_pdf TYPE STANDARD TABLE OF tbl1024 . FIELD-SYMBOLS: &lt;ls_key&gt; TYPE cl_somu_form_services=&gt;ty_gs_key. SELECT SINGLE * FROM ekko INTO ls_ekko WHERE ebeln = p_po_num. " --------------------------- Values for the purchase order form --------------------------- APPEND INITIAL LINE TO lt_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'PurchaseOrder'. &lt;ls_key&gt;-value = p_po_num. APPEND INITIAL LINE TO lt_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'SenderCountry'. &lt;ls_key&gt;-value = 'DE'. APPEND INITIAL LINE TO lt_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'PurchaseOrderChangeFlag'. &lt;ls_key&gt;-value = space. APPEND INITIAL LINE TO lt_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'Language'. &lt;ls_key&gt;-value = 'E'. APPEND INITIAL LINE TO lt_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'ReceiverPartnerNumber'. &lt;ls_key&gt;-value = ls_ekko-lifnr. " --------------------------- Values for the master form template --------------------------- APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'PrintFormDerivationRule'. &lt;ls_key&gt;-value = 'PURCHASE_ORDER_MASTER_FOR_COMPANY'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'WatermarkText'. &lt;ls_key&gt;-value = space. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'LocaleCountry'. &lt;ls_key&gt;-value = 'DE'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'LocaleLanguage'. &lt;ls_key&gt;-value = 'E'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'OutputControlApplicationObjectType'. &lt;ls_key&gt;-value = 'PURCHASE_ORDER'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'OutputControlApplicationObject'. &lt;ls_key&gt;-value = p_po_num. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'OutputRequestItem'. &lt;ls_key&gt;-value = '000001'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'OutputDocumentType'. &lt;ls_key&gt;-value = 'PURCHASE_ORDER'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'Recipient'. &lt;ls_key&gt;-value = ls_ekko-lifnr. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'RecipientRole'. &lt;ls_key&gt;-value = 'LF'. APPEND INITIAL LINE TO lt_master_keys ASSIGNING &lt;ls_key&gt;. &lt;ls_key&gt;-name = 'SenderCountry'. &lt;ls_key&gt;-value = 'DE'. lo_cl_somu_form_services = cl_somu_form_services=&gt;get_instance( ). lo_cl_somu_form_services-&gt;get_document( EXPORTING iv_master_form_name = 'SOMU_FORM_MASTER_A4' iv_form_name = 'MM_PUR_PURCHASE_ORDER' it_key = lt_keys it_master_key = lt_master_keys iv_form_language = 'E' iv_form_country = 'DE' IMPORTING ev_content = lv_content ev_xml = lv_xml ev_pages = lv_pages ev_trace_string = lv_trace_string ev_stop_processing = lv_stop_processing et_message = lt_message ). IF sy-subrc &lt;&gt; 0. ENDIF. CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = lv_content IMPORTING output_length = lv_output_length TABLES binary_tab = lt_generated_pdf. " Shows a preview of the generated PDF file in a popup window. CALL FUNCTION 'FDM_COLL_INV_PDF_SHOW' EXPORTING t_pdf = lt_generated_pdf. "================================================================================================================= "Object References DATA: lo_bcs TYPE REF TO cl_bcs, lo_doc_bcs TYPE REF TO cl_document_bcs, lo_recep TYPE REF TO if_recipient_bcs, lo_sapuser_bcs TYPE REF TO cl_sapuser_bcs, lo_cx_bcx TYPE REF TO cx_bcs, lv_string_text TYPE string, lt_text TYPE bcsy_text, lv_bin_filesize TYPE so_obj_len, lv_sent_to_all TYPE os_boolean, lt_binary_content TYPE solix_tab. CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = lv_content IMPORTING output_length = lv_output_length TABLES binary_tab = lt_binary_content[]. lv_bin_filesize = lv_output_length. TRY. * -------- create persistent send request ------------------------ lo_bcs = cl_bcs=&gt;create_persistent( ). "First line CONCATENATE 'Dear Colleague' cl_abap_char_utilities=&gt;newline INTO lv_string_text. APPEND lv_string_text TO lt_text. CLEAR lv_string_text. "Second line CONCATENATE 'Please find attached a test smartform.' cl_abap_char_utilities=&gt;newline INTO lv_string_text. APPEND lv_string_text TO lt_text. CLEAR lv_string_text. "Third line APPEND 'Best Regards,' TO lt_text. "Fourth line APPEND 'Systems Administrator.' TO lt_text. *--------------------------------------------------------------------- *-----------------&amp; Create Document *------------------------ *--------------------------------------------------------------------- lo_doc_bcs = cl_document_bcs=&gt;create_document( i_type = 'RAW' i_text = lt_text[] i_length = '12' i_subject = 'Test Email' ). "Subject of the Email *--------------------------------------------------------------------- *-----------------&amp; Add attachment to document *---------------- *--------------------------------------------------------------------- * BCS expects document content here e.g. from document upload * binary_content = ... CALL METHOD lo_doc_bcs-&gt;add_attachment EXPORTING i_attachment_type = 'PDF' i_attachment_size = lv_bin_filesize i_attachment_subject = 'Test Email' i_att_content_hex = lt_binary_content. * add document to send request CALL METHOD lo_bcs-&gt;set_document( lo_doc_bcs ). *--------------------------------------------------------------------- *------------------------&amp; Set Sender *------------------------- *--------------------------------------------------------------------- * lo_sapuser_bcs = cl_sapuser_bcs=&gt;create( sy-uname ). * CALL METHOD lo_bcs-&gt;set_sender * EXPORTING * i_sender = lo_sapuser_bcs. lo_recep = cl_cam_address_bcs=&gt;create_internet_address('Receiving Email Address'). "Add recipient with its respective attributes to send request CALL METHOD lo_bcs-&gt;add_recipient EXPORTING i_recipient = lo_recep i_express = 'X'. CALL METHOD lo_bcs-&gt;set_send_immediately EXPORTING i_send_immediately = 'X'. *--------------------------------------------------------------------- *-----------------&amp; Send the email *----------------------------- *--------------------------------------------------------------------- CALL METHOD lo_bcs-&gt;send( EXPORTING i_with_error_screen = 'X' RECEIVING result = lv_sent_to_all ). IF lv_sent_to_all IS NOT INITIAL. COMMIT WORK. ENDIF. *--------------------------------------------------------------------- *-----------------&amp; Exception Handling *------------------------ *--------------------------------------------------------------------- CATCH cx_bcs INTO lo_cx_bcx. "Appropriate Exception Handling WRITE: 'Exception:', lo_cx_bcx-&gt;error_type. ENDTRY.</code></pre><P>PS. you can use same concept if you are creating a total custom fragment on your own but you need to&nbsp;</P><UL><LI>Create OData Model&nbsp;</LI><LI>Create Master Template using Maintain Form Template Fiori APP / SFP</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AmgadElStohi_6-1715802375866.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111223iFDAA7EBA7B607125/image-size/large?v=v2&amp;px=999" role="button" title="AmgadElStohi_6-1715802375866.png" alt="AmgadElStohi_6-1715802375866.png" /></span></P><UL><LI>Create Content Template using&nbsp;Maintain Form Template Fiori APP / SFP</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AmgadElStohi_4-1715802301569.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111221i02054093B1FFC415/image-size/large?v=v2&amp;px=999" role="button" title="AmgadElStohi_4-1715802301569.png" alt="AmgadElStohi_4-1715802301569.png" /></span></P><P>Start building Up your Solution, i haven't tried build a full custom solution from A to Z but this is the main idea for it</P><P>&nbsp;</P><P>&nbsp;</P> 2024-05-15T21:53:21.876000+02:00 https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/logic-of-cdc-change-data-capture-in-abap-cds-view/ba-p/13703103 Logic of CDC (Change Data Capture) in ABAP CDS View 2024-05-16T09:04:35.754000+02:00 ashish_dey84sap https://community.sap.com/t5/user/viewprofilepage/user-id/191780 <P><U><STRONG>Background</STRONG></U></P><P>There was requirement to extract closed POs as part of Daily Delta from S4 and load to BW. We are extracting Data from S4 via creating Custom Abap CDS Views. But here we had the challenge to bring only Delta records which was closed on a particular Day.</P><P>We went ahead to implement Change Data Capture (CDC) Delta: This delta method makes use of real-time database triggers on table level. The Change Data Capture recording mechanism uses database triggers to record any changes to the tables that belong to an ABAP CDS view. To do this, the key fields of all underlying tables need to be mapped to the fields of the CDS view.&nbsp;</P><UL><LI>Below is the annotation used for CDC Delta Functionality</LI></UL><P><a href="https://community.sap.com/t5/user/viewprofilepage/user-id/15206">@analytics</a>.dataExtraction.delta.changeDataCapture.mapping</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_0-1715838869074.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111360iF00B04CD913E4337/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_0-1715838869074.png" alt="ashish_dey84sap_0-1715838869074.png" /></span></P><P>&nbsp;</P><P><STRONG><U>CDC Mechanism in Delta Enabled ABAP CDS View</U></STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_1-1715838869077.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111361i29D9280D9387FC92/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_1-1715838869077.png" alt="ashish_dey84sap_1-1715838869077.png" /></span></P><P>&nbsp;</P><P>We successfully did the technical go-live of this deliverable to Production Environment and daily deltas in terms of closed PO’s was successfully getting captured in ODQMON and was flowing to BW as part of Daily Loads.</P><P><STRONG><U>Problem Statement</U></STRONG></P><P>One Particular Day (For example 5th Oct 2023), we noticed that as part of Daily Delta loads for closed Po’s, zero records were fetched. The same happened in next day as well. We checked in ODQMON and saw that last TSN Requested Date was not changing, it was still showing the date when the last delta was captured successfully i.e. 4th Oct 2023.</P><P><STRONG><U>Root Cause Analysis</U></STRONG></P><P>After exploring, got to know that there are basically 2 Jobs in the S4 Side which drives the entire flow of delta records based on CDC mechanism.</P><UL><LI>Observer job (/1DH/OBSERVE_LOGTAB)</LI><LI>Transfer job (/1DH/PUSH_CDS_DELTA) which's started by Observer job.</LI></UL><P>In this case when we checked in SM37, Observer Job was running as per logs, But Transfer Job last run was on the day (04-OCT-2023) when Delta records were extracted successfully in BW side. After that there was no run.</P><P>Observer job&nbsp;<STRONG>/1DH/OBSERVE</STRONG><STRONG>_LOGTAB</STRONG>&nbsp;is scheduled hourly.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_2-1715838869100.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111362iAFE3CAE38D86C34A/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_2-1715838869100.png" alt="ashish_dey84sap_2-1715838869100.png" /></span></P><P>&nbsp;</P><P>Transfer Job <STRONG>/1DH/PUSH_CDS_DELTA</STRONG>&nbsp;in SM37 in S4. No Run after 4th&nbsp;Oct 2023</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_3-1715838869113.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111364iA4E5E4F944985532/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_3-1715838869113.png" alt="ashish_dey84sap_3-1715838869113.png" /></span></P><P>&nbsp;</P><P>If a record is changed, then database triggers write it into a master logging table /1DH/ML... (e.g./1DH/ML000000001).&nbsp; Afterwards, the Transfer job copies the records from master logging table to subscriber logging table /1DH/SL... (e.g./1DH/SL000000001).</P><P>After the Observer job copies the logging table entries, the view reconstruction is executed. The view reconstruction selects the latest after images from the CDS view if there exists a corresponding key in at least one subscriber logging table. The result is written into unit of Operational Delta Queue (ODQ).</P><P>In our case, we could see that&nbsp;database triggers have written data correctly into master logging table (/1DH/ML000000001) but it's not being copied from master logging table to&nbsp;subscriber logging table&nbsp;/1DH/SL000000001 &amp; /1DH/SL000000002&nbsp;because Transfer job is not running.</P><P><STRONG><U>Master Logging Table </U>– </STRONG>Having Entries</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_4-1715838869121.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111365i8AA14F0F0236C3ED/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_4-1715838869121.png" alt="ashish_dey84sap_4-1715838869121.png" /></span></P><P>&nbsp;</P><P><STRONG><U>Subscriber logging Table </U>- </STRONG>No Entries</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_5-1715838869129.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111363i0AED90D97210B52D/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_5-1715838869129.png" alt="ashish_dey84sap_5-1715838869129.png" /></span></P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_6-1715838869135.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111367i55086B84CB7D6B61/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_6-1715838869135.png" alt="ashish_dey84sap_6-1715838869135.png" /></span></P><P>&nbsp;</P><P><STRONG><U>Resolution</U></STRONG></P><P>GOTO Transaction code DHCDCMON to check the status of Observer &amp; Transfer Job. It must be green. Either Red or yellow, probably no delta can be pushed into ODQMON unit.</P><P>To correct the status, click button “Dispatcher job” (starts SAP_DHCDC_DISPATCHER job) which will schedule all the required and missing jobs.</P><P>/1DH/OBSERVE_LOGTAB (Observer Job)</P><P>/1DH/PUSH_CDS_DELTA (Transfer Job)</P><P>/1DH/CDC_HEALTH_CHECK (Health Check Job)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ashish_dey84sap_7-1715838869137.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/111366i96DC4C234C24FD19/image-size/medium?v=v2&amp;px=400" role="button" title="ashish_dey84sap_7-1715838869137.png" alt="ashish_dey84sap_7-1715838869137.png" /></span></P><P>&nbsp;</P><P>For more information, please refer SAP Note – 2930269: ABAP CDS CDC: Issues &amp; Troubleshooting</P><P>&nbsp;</P> 2024-05-16T09:04:35.754000+02:00