Posts

Showing posts with the label ABAP Programming

Mastering ABAP: A Step-by-Step Guide to Function Modules and Groups for Modularized Programming

Image
  Function Modules :- It is a modularization technique. The transaction code to create a function module is SE37. To create a function module, we need to create a function group. Function Group :- Function group is a container for the function modules. The transaction code to create a function group is SE80. A function group can store up to 99 function modules. Requirement :- let’s create a function module for sum of two numbers. 1. Creation of function group :- Step 1 :- Go to SE80 transaction code → Object Navigator. Step 2 :- From the drop down select function group. Step 3 :- Give a name of function group. Step 4 :- press enter. Step 5 :- Click on yes a popup screen will appear. Step 6 :- Give short description → press enter → Assign package and transaction request and press enter. Step 7 :- Right click on function group and click on activate to activate the function group. Step 8 :- You will see two includes, will be added afte...

Breaking it Down: Exploring Modularization Techniques in ABAP Programming

Image
 Welcome back everyone, We have just finished our classical reports in our last blog, So let’s start with Modularization Techniques. Modularization Techniques :- Modularization is a technique used to divide the application program into smaller units. This helps to maintain the code in an easy manner and reduce the code redundancy. The various modularization techniques are as follows :- Includes Function Modules Subroutines Class-Methods 1. Include Programs/Includes :- Include Program is a modularization technique. We use include programs to organize a program code in to smaller units. We can create include programs with the help of SE38(ABAP Editor). The type of include programs is ‘I’. We can not execute a include program. We can reuse the same include program multiple times in our executable reports. The most important use of include programs is for lengthy data declarations used in different programs. The Syntax to use a Include Program in to another type...

Mastering ABAP Events: Unraveling Interactive Classical Report Events and Control Break Statements

Image
 Welcome back everyone, We were discussing about Interactive Classical Report Events, So let’s continue it. 3. Top of Page During Line-Selection :- This event calls when the first WRITE statement occurs in a program for a page on secondary list. The purpose of this event is to provide title/header at the beginning of a new page on secondary list. Let’s take a requirement to understand it more clearly. Requirement :- I want on the first page my header details should be displayed and on the second page item details should be displayed. Also there should be a title for the secondary list. Code :- ************************************************************* *Start of Program *Declaring Strcutrure for header TYPES: BEGIN OF ty_header, order_number TYPE zar_order_number, order_date TYPE zar_order_date, payment_mode TYPE zar_payment_mode, currency TYPE zar_curency, END OF ty_header. ********************* *Internal table an...

Unlocking SAP ABAP Secrets: Interactive Classical Reports with GET CURSOR, At User Command, and a Comparison of HIDE Statements

Image
 Welcome back everyone, We were discussing about the interactive classical reports, so let’s continue it. Interactive Classical Reports- GET CURSOR :- In Interactive Classical Reports, GET CURSOR statement is used to create secondary list according to cursor position. The parameter FIELD provides the name of an output field. The parameter VALUE provide the output value. Syntax : GET CURSOR FIELD <lv_field> VALUE <lv_value>. In the above syntax - the field name and field value will be returned in to variables lv_field and lv_value respectively. Requirement :- If you remember, In our last two blog, We have been displaying the order header table in a basic list and order item table in the secondary list. We have used SY-LISEL and HIDE statements to achieve the requirement. Now, we have to use the get CURSOR to achieve the same to same requirement. Code :- ************************************************************* *Start of Program *Declaring Strcut...