Skip to main content

Posts

How to Create a REST API in SAP ABAP — Step-by-step Guide

How to Create a REST API in SAP ABAP — Step-by-step Guide Summary: This tutorial shows how to build a REST API in SAP ABAP by creating a handler class, configuring SICF service, registering endpoints with cl_rest_router , implementing endpoint logic (example GET method), and testing the API. Based on an internal implementation reference. Why expose REST APIs from SAP? REST APIs allow SAP systems to integrate with web, mobile, and external services using standard HTTP and JSON payloads. Implementing REST endpoints in ABAP provides secure, reusable, and maintainable integration points for modern applications. Prerequisites Access to an SAP system with authorization to create classes (SE24) and SICF services (SICF). Familiarity with ABAP object-oriented concepts and basic SAP transaction codes. ABAP classes CL_REST_RESOURCE , CL_REST_ROUTER and utilities like /UI2/CL_JSON . High-level overview (4 steps) Create an API handler class (e.g. ZCL_API_HANDLER ). R...

Custom Agent Determination in SAP Flexible Workflow for Supplier Invoice Approval

Custom Agent Determination in SAP Flexible Workflow for Supplier Invoice Approval Custom Agent Determination in SAP Flexible Workflow for Supplier Invoice Approval In SAP MM, supplier invoice approval is often handled using the Flexible Workflow . However, standard configuration may not fully cover complex approval requirements. In such cases, Custom Agent Determination can be implemented using BAdI MRM_WORKFLOW_AGENTS . This blog explains how to implement a custom approval workflow for supplier invoices (MIR7), including creating custom tables, CDS views, Fiori custom logic, and defining workflow conditions. 1. Create Custom Tables Two custom tables are required: a. Table for Mapping User Approval Table: ZMMT007 (Supplier Invoice Approval Agent Assignment) FUNCTION – Function key FUNDESC – Function description APP_LVL – Approval leve...

How to Set Default Values in SAP Business Partner (BP)

How to Set Default Values in SAP Business Partner (BP) How to Set Default Values in SAP Business Partner (BP) In SAP Business Partner (BP) transactions, setting default values can help streamline data entry and ensure consistency across the system. For example, you may want to predefine a default language or tolerance group at the company level . SAP provides a standard way to handle this through the BUSDEFAULT structure and enhancement options. This guide explains how to set default BP values using customer exits and the function module BUP_BUPA_FIELDVALUES_SET . Understanding the BUSDEFAULT Structure SAP provides a structure called BUSDEFAULT , which contains fields that can be configured with default values. You can explore it using transaction SE11 . Some of the key fields available in BUSDEFAULT include: LANGU – Business partner language COUNTRY – Co...

SAP Badi Invoice Splitting Document

Mastering Invoice Splitting in SAP: A Complete Guide Mastering Invoice Splitting in SAP: A Complete Guide In SAP Financial Accounting (FI), managing invoices efficiently is critical for smooth financial operations. One of the most requested enhancements by businesses is invoice splitting , especially when dealing with complex procurement or billing scenarios. SAP provides flexibility through Business Add-Ins (BAdIs) , allowing developers to customize invoice processing in both MIRO (Invoice Receipt) and VF01 (Billing Document Creation) . This article explains the process of invoice splitting in SAP using the relevant BAdIs: FI_INVOICE_RECEIPT_SPLIT for MIRO FI_BILL_ISSUE_SPLIT for VF01 By the end, you’ll have a clear understanding of how to implement and optimize invoice splitting to meet business needs. What is Invoice Splitting in SAP? Invoice splitting ...

Enhance SAP FBL1N, FBL3N & FBL5N: Add Custom Fields in 3 Easy Steps (ABAP Guide)

Enhance SAP FBL1N, FBL3N & FBL5N: Add Custom Fields in 3 Easy Steps (ABAP Guide) Enhance SAP FBL1N, FBL3N & FBL5N: Add Custom Fields in 3 Easy Steps (ABAP Guide) In SAP Financial Accounting (FI), line item reports such as FBL1N (Vendor Line Items), FBL3N (G/L Account Line Items), and FBL5N (Customer Line Items) are heavily used. Business users often require custom fields in these reports. This guide explains how to add custom fields step by step with ABAP. Step 1: Append Structure to RFPOSX Extend the standard structure RFPOSX by appending your custom fields. Step 2: Run Program RFPOSXEXTEND Execute program RFPOSXEXTEND to regenerate the structure and make the appended fields available in the FBL reports. Step 3: Implement BADI FI_ITEMS_CH_DATA Implement BADI FI_ITEMS_CH_DATA and enhance method CHANGE_ITEMS to fill ...

Automatic Perform Posting GI After VLPOD Save in SAP

Automatic Posting GI After VLPOD Save in SAP Automatic Posting GI After VLPOD Save in SAP This guide explains how to enhance SAP to automatically perform Goods Issue (GI) with movement type Z55 after VLPOD (Proof of Delivery) is confirmed or canceled. The solution uses BADI implementation and custom function modules . Business Requirement After confirming or canceling POD in transaction VLPOD , the system should automatically trigger a MIGO Goods Issue (Z55) posting without requiring manual intervention. Technical Design BADI Implementations LE_SHP_DELIVERY_PROC : ZIMPL_POD_TRANSFER DELIVERY_PUBLISH : ZIM_DELIVERY_PUBLISH Custom Function Modules ZFG_VLPOD_POST_Z55 → To post Goods Issue ZFG_VLPOD_CNCL_Z55 → To cancel Goods Issue Enhancement Implementation 1. ZIMPL_POD_TRANSFER METHOD if_ex_le_shp_d...

How to Add Custom Field in SAP Standard Report ME5A & ME2N

How to Add Custom Field in SAP Standard Report ME5A & ME2N How to Add Custom Field in SAP Standard Report ME5A & ME2N In SAP implementation, it is often necessary to add custom fields in standard reports such as ME5A (Purchase Requisition List) and ME2N (Purchase Order List). This guide explains step-by-step how to enhance these reports using append structure and BADI ME_CHANGE_OUTTAB_CUS . Step 1: Append Structure For report ME5A : append structure in MEREP_OUTTAB_EBAN . For report ME2N : append structure in MEREP_OUTTAB_PURCHDOC . Step 2: Implement BADI ME_CHANGE_OUTTAB_CUS After appending the structure, create a new implementation in BADI ME_CHANGE_OUTTAB_CUS to populate the values of the custom fields. Custom logic should be added in the method IF_EX_ME_CHANGE_OUTTAB_CUS~FILL_OUTTAB . ABAP Code Example ...