Saturday, October 6, 2018

How to add Custom Subscreen and Field to VL02N using BAdI

In order to implement a BAdI,we have to create a function group.
Create a function group using SE37.

Open the Function group in SE80. Activate it.

After activation check the status

Select Function group and right click on it.
Right click -> Create -> Screen

Program name will be come like SAPL Followed by Function Group.
Give the screen number example 9000,9001..etc.

Give the screen decription and select screen type as Subscreen.

Go to Layout as shown below

Create or Design the screen as required and provide field parameters.
In this case Data Base table field is referred as new field,which is already
appended in LIPS using SE11.
Save and activate it.

Now goto SE18 and open the Badi name (LE_SHP_TAB_CUST_ITEM).

Select Implementatio -> Create in Menu path

Give some name to it.

Provide short text and click on Method ACTIATE_TAB_PAGE.

Write code to activate extra subscreen in VL02N.

Activate the implementation.

Go to VL02N and check at Item level for newly added Subscreen and field.

Tuesday, June 26, 2012

Overview of OOP's in ABAP/4

OBJECT ORIENTED PROGRAMMING IN ABAP/4

Class : A Class is a user defined data type with attributes,method types and events for a particular entity or business scenario or business application.
Class creation is of 2 step process :
1) class definition 2) class implementation

Object : Objects are instances of classes
Each object has unique identity i.e, memory and its own attributes.
Once an object is created,we have an instance of class with separate memory

Object creation is also of 2 step process.
1) Object/Instance declaration 2) Object creation

Components of a Class :
Attributes : Any data,variables,constants declared within a class are called as attributes of a class
Methods : Methods contain a block of code,providing some functionality for a class. These are similar to function modules in ABAP. Methods can access all the attributes of a class.
Events : Event is a mechanism by which method of one class can raise method of another class, without the hazard of instantiating that class.
Interfaces : Interfaces are similar to classes which contain methods. These are mainly used to extend the scope or functionality of the class.
Interfaces contains methods without any implementation.
where as a class contains methods with implementation.
Interface can be used by 'n' no of classes to extend the functionality of the class.
All the interface methods will be automatically copied to the classes in a particular class without effecting the other classes.

Instance and Static Components :
Instance Component : These components exists separately in each instance(Object) of the class and are referred using instance components selector using '->'.

Static Component: These components exists globally for a class and are referred to using static component selector '=>'.

Visibility components :
Each class component has a visibility
In ABAP Objects,the whole class definition is separated into three visibility section.
PUBLIC : Data declared in public section can be accessed by the class itself, by its subclasses as well as by other users outside the class.
PROTECTED : Data declared in the protected section can be accessed by the class itself, and also by its subclasses but not by external users outside the class.
PRIVATE : Data declared in the private section can be accessed by the class only, but not by its subclasses and by external users outside the class.

Global Class and Local Class :
Classes in ABAP Objects can be declared either globally or locally.

Global Class : Global classes and Interfaces are defined in class builder using SE24 in ABAP workbench.
All ABAP programs in an R/3 system can access the global classes.

Local Class : Local classes are defined in an ABAP program (SE38) and can only be used in the program in which they are defined.

Constructors :
These are special type of methods.
Constructor method is executed automatically whenever a object is created or instantiated.
These methods are mainly used to set default values in a class.
constructor method is called for each instance is created.

Instance Constructor : The name of the instance constructor method is 'constructor'.
These methods have only importing parameters.
There are no exporting parameters.

Static Constructor : this method is executed automatically whenever a first call to the class is made.
The static constructors will not have any importing or exporting parameters.
Name of the static constructor is 'class_constructor'.

FINAL and FRIENDS:

FINAL: It is a keyword which specifies whether inheritance is possible or not.
If FINAL option is selected, we cannot create inheritance (or) the class cannot be inherited.
If ‘FINAL’ option is not selected, we can create inheritance.

FRIENDS: By default , the child class cannot access the private variables of a SUPER class.
It can access only PUBLIC&PROTECTED variables.
FRIEND’ is a concept which is used to access the PRIVATE variables of a SUPER class.
So, To access the PRIVATE variables of a super class, the SUPER class has to treat the child as a friend.

OOP's Concepts :

There are 4 OOP's concepts.

1)Inheritance : In OO ABAP we use an existing class to derive a new class (child class). The new class contains the attributes of the parent class (derives according to the visibility of attributes and methods) in addition to new attributes and methods added to it. The child class derives all the attributes and methods declared in parent class as public visibility. The child class can not inherit private members. The protected members in parent class are derived in child class but their visibility changes to private.

2)Abstraction : It is a class which contains methods with implementation as well as methods without implementation.

we cannot create an object to the abstract class instead create an object to the child class and call the methods(Hiding the main class).

3)Encapsulation : Through encapsulation we restrict the visibility of attributes and methods in the object.

4) Polymorphism : It is a concept by which the same method names will behave differently in different classes i.e each method will have its own implementation in different different classes but with the same name.

Sunday, October 24, 2010

Transaction code for a Maintainance Table

How to Create T Code for a Maintainance Table
Create T Code using SE93


Provide short text and select Transaction with Parameters(parameters transaction)


Provide Transaction as SM30 and select Skip initial screen check box.
In Default values section,Provide Table name and other details as below.


Finally Save the Application

Wednesday, October 6, 2010

How to down load Spool into PDF file in Local system

Down Load Spool into PDF file in Local system.

Pick the spool number from SP01,which you want to down into PDF.



Execute RSTXPDFT4 Report in SE38.



Provide Spool number,which you picked from SP01 and file path,where to download.
Execute the report.



Spool will be now downloaded into PDF in local system.

Tuesday, August 10, 2010

Append SAP standard table

It is a standard procedure to add new custom fields to the standard tables.
Append structure name should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP.

Open LIPS table and click on Append structure.



Click on Create button as below



Provide structure name starts with ZZ or YY.



Give the Field name and data element and save and activate.



Usually it takes time ans its depends on data in the table.

Tuesday, August 3, 2010

Warehouse Management(WM) Interface

Warehouse Management Involves in below modules.

Thursday, April 1, 2010

Implementing Enhancement Point

Implementing Enhancement :

Take an example like Inbound IDoc : IDOC_INPUT_INVOIC_MM
Go To SE37 and give Function module name as IDOC_INPUT_INVOIC_MM
Click on Display.



Click on Enhancement Source Code Button on Application tool bar


Now the Editor will be changed as below


Now put cursor on ENHANCEMENT-POINT and Right click
Go to Enhancement Implementation -> Create


Click on Creat Button


Give Enhancement Name and Description and press enter


Select your Enhancement and press enter


Now the Enhancement will be ready to Implement


Enhance the Logic between ENHANCEMENT - ENDENHANCEMENT as below


Save the code,Check the syntax and Activate the Code.