Posts

Showing posts with the label SAP Programming

How to Create and Use an SAP Function Module for Order Details Retrieval in ABAP

Image
 Let’s take real life scenario to develop a function module. Requirement :- Create a function module that takes Single Order Number as input. Displays details of Order Number (Order Header + Order Item ). Suppose below is my header and item table. Header. Item Table Solution :- Step 1 :- Go to SE37. Step 2 :- Give a name and click on create button. Step 3 :- Provide the function group and short description and click on save button. Step 4 :- In import tab we will declare single input as a parameter. Step 5 :- Let’s create a type structure which contains fields from both header and item table which will be given in export section. Step 6 :- Create a table type for same structure. Step 6 :- Pass the type structure and table type in export section of function module to create a internal table and work area. Step 7 :- Open Source Code, Create a type structure for order header and order item table. Step 8 :- Write select query to fetch ...

ABAP Event Magic: Navigating Interactive Classical Reports for Dynamic Displays

Image
 Welcome back everyone, We were discussing about Interactive Classical Report events, So, let’s continue it. System Variables in Interactive Classical Report Events :- SY-LISEL :- It is a system variable which returns the contents of the selected line. SY-LSIND :- It is a system variable which returns the index of the displayed list. Interactive Classical Report Events :- 1. At Line-Selection :- When user double clicks on the line or select a line and press F2 or select a line and click choose at that time at line-selection event triggers. Suppose, user double click on the below line :- Then the output should be showing the respective line items for the respective header items in a new page :- Note :- F2 is the shortcut key for double click. It is a reserve key by SAP used for double click purpose. Let’s take a requirement to understand the At Line Selection event. Requirement :- Let’s use our order header and order item table, which we have been using so ...

Harnessing the Power of Message Class for Effective Program Communication

Image
 Welcome back everyone to our Complete SAP ABAP Master Series, We have started Message Class in our last blog, So let’s continue it. Message Class :- Suppose, I want to open a program in ABAP Editor which does not exist, then the SAP System will automatically generate a message that the Program does not exist. Messages play a very crucial and vital role in SAP. Types of Messages :- A(Abort) E(error) I(Information) S(success/status) W(warning) X(exit) Note :- We should always use Message class for writing Messages, Never hard code messages inside the program. Requirement :- Let’s understand the importance of Messages through a requirement. Suppose, I have the below program, I hope you remember the below code, Since we had discussed this program in our previous blogs. Now, Once we are trying to execute the program and we provide a wrong input number, then Suppose the Customer wants us to display a message that Order Number does not exist. Solution :- S...