Skip to main content

Posts

Showing posts from 2025

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 ...

ABAP Dump Open Screen Painter

If this error come when you try to open ABAP Screen Painter, you can follow this tips.   1. Go To Transaction Code SM59   Double click EU_SCRP_WIN32 and open Logon & Security Tab Maintain Callback Positive List RS_SCRP_GF_PROCESS_640 RFC_GET_FUNCTION_INTERFACE RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RBUILDINFO RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RDDICFIELDS RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RDOCU RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RELEMTABLE RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RHELPGETTEXT RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RICONS RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RKEYS RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RKEYTEXTS RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RMESSAGES RS_SCRP_GF_PROCESS_640 RS_SCRP_GF_RPROPTABLE RS_SCRP_GF_PROCESS_640 RS_SCRP...

SAP ABAP - CALL BP TCODE From ABAP

REPORT ycall_bp. PARAMETERS: p_bpnum TYPE but000-partner. DATA: lo_request TYPE REF TO cl_bupa_navigation_request,       lo_options TYPE REF TO cl_bupa_dialog_joel_options. * Create request and options objects CREATE OBJECT lo_request. CREATE OBJECT lo_options. * Set Business Partner number (example) lo_request->set_partner_number( p_bpnum ). " your BP number * Set activity (e.g., '03' for display) lo_request->set_bupa_activity( '03' ). * Optional: Set a specific sub-header tab (e.g., 'CVIC01' for Commercial View) lo_request->set_bupa_sub_header_id( 'CVIC01' ). * Optional: Hide the locator (search) area lo_options->set_locator_visible( space ). * Call the BP transaction with navigation CALL METHOD cl_bupa_dialog_joel=>start_with_navigation   EXPORTING     iv_request              = lo_request     iv_options              = lo_options     iv_in_new_internal...

SAP ABAP - Read Table With Index New Syntax

  *&---------------------------------------------------------------------* *& Report YABAP_LEAR01 *&---------------------------------------------------------------------* *& Title      : Read Table With Index New Syntax *&---------------------------------------------------------------------* REPORT yabap_lear01. DATA: ls_mara TYPE mara. START-OF-SELECTION.   SELECT * FROM mara     INTO TABLE @DATA(lt_mara)       UP TO 10 ROWS.   WRITE :/ '.'.   "Old Method   CLEAR ls_mara.   READ TABLE lt_mara INDEX 5 INTO ls_mara.   IF sy-subrc = 0.     WRITE :/ 'Old Method Result :', ls_mara-matnr.   else.     WRITE :/ 'Data not found!'.   ENDIF.   WRITE :/ '.'.   WRITE :/ '============================================'.   WRITE :/ '.'.   "New Method   CLEAR ls_mara.   TRY.       ls_mara = lt_mara[ 6 ].       WRITE :/ 'N...

SAP ABAP - Extract Number From String

REPORT yextract_number. DATA number(10) VALUE '0123456789'. DATA string_val TYPE char100. WRITE :/ 'First Option ========================'. string_val = '  SHIPMENT 335'. WRITE :/ 'Before', string_val. REPLACE ALL OCCURENCES OF REGEX '[^\d]' IN string_val WITH space. CONDENSE string_val NO-GAPS. WRITE :/ 'After', string_val. WRITE :/ 'First Option ========================'. WRITE :/ '##########################################'. DATA : lv_string TYPE string. DATA : lv_num TYPE string. lv_string = 'A1313.33BBC'. lv_num = lv_string. WRITE :/ 'Second Option ========================'. WRITE :/ 'Before', lv_string. REPLACE ALL OCCURRENCES OF REGEX '([[:alpha:]])' IN lv_num WITH ''. WRITE :/ 'After', lv_num. WRITE :/ 'Second Option ========================'.

SAP Transaction Code S_ALR_87013645 Language Screen is Germany

  1. Open Transaction Code GR53 and fill Report Group 1KMA 2. Run Generate Try open S_ALR_87013645 again and here the result

SAP ABAP - Smartforms as Email Attachment

  *&---------------------------------------------------------------------* *& Report YMAIL01 *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT ymail01. DATA:   lv_subject            TYPE so_obj_des,   lv_attachment_subject TYPE  sood-objdes,   ls_mailto             TYPE zsmail_to,   lt_mailto             TYPE TABLE OF zsmail_to,   lt_otf                TYPE TABLE OF itcoo,   lt_mail_content       TYPE soli_tab,   ls_mail_content       TYPE soli. DATA:   document_output_info TYPE  ssfcrespd,   job_output_info      TYPE  ssfcrescl,   job_output_options   TYPE  ssfcresop,   ssfctrlop...

SAP ABAP - Custom Agent Determination Supplier Invoice Flexible Workflow Approval

Approval Supplier Invoice document (MIR7) using flexible workflow with custom agent determination. Using custom agent determination for supplier invoice approval with flexible workflow in SAP involves several steps. Below is a step-by-step guide to help you set this up: Step 1: Understand the Requirement In my case, custom agent determination need to maintain with custom table. Below the custom table needs: After create both of tables, need to create custom CDS view which will be used in custom logic apps code First CDS View ZInvoiceWf  @AbapCatalog.sqlViewName: 'ZIWFINVOICE' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @ClientHandling.algorithm: #SESSION_VARIABLE @EndUserText.label: 'Supplier Invoice Workflow' @VDM.viewType: #COMPOSITE @VDM.lifecycle.contract.type: #SAP_INTERNAL_API @ObjectModel.usageType.sizeCategory: #M @ObjectModel.usageType.serviceQuality: #A @ObjectModel.usageType.dataClass: #MA...