Posts

Showing posts with the label sap abap

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 Strcutrure

Unlocking the Power of HIDE Statements in Interactive Classical Reports: A Practical Guide with Examples

Image
 Welcome back everyone, We were discussing about Interactive Classical Event and We had seen the functionality of At line Selection. Now, Before jumping to next event, let’s discuss some important interactive classical report statements. 1. HIDE Statement :- The HIDE statement is one of the fundamental statements for interactive reporting. We can use HIDE statement to store the line-specific information while creating a basic list. This stored information will be used while creating secondary list. Syntax : HIDE<f>. The above statement places the contents of the variable <f> into the HIDE area. We can consider hide area as a table which stores the field name, field value and line number ( system variable SY-LINNO). Pre-requisites for HIDE statements :- HIDE statement must be written after the WRITE statement. HIDE statement must be called inside the loop. Working of the HIDE Statement :- The user selects a line for which data has been stored in the HIDE

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

Exploring ABAP Classical Report Events: Start Of Selection, End Of Selection, Top of Page, and End of Page

Image
 Welcome back everyone, We have started Classical report events in the last blog. so, Let’s continue it. 3. Start Of Selection This event calls when user clicks execute button on the selection screen. The selection logic is the part of this event. Let’s create a type structure for our header table in our program, which we have seen in the last blog. Implementation :- Note :- Please go to the debug mode and check which events are triggering at what time, It will help everyone to understand the entire concept. Code :- *********************************************** *Start of Program *********************************************** *Declaring type strcuture 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 and Work Area DATA : lt_header type table of ty_header, ls_h

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 :- Step