0% found this document useful (0 votes)
5 views37 pages

Sap Abap

The SAP ABAP Data Dictionary (DDIC) is a central repository for metadata related to database objects, including tables, views, data types, and more. It manages data handling during transport between systems and defines various properties such as delivery class, technical settings, and lock objects to ensure data consistency and integrity. Key components include transparent, pooled, and cluster tables, as well as search helps, foreign keys, and maintenance tools like the Table Maintenance Generator (TMG).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views37 pages

Sap Abap

The SAP ABAP Data Dictionary (DDIC) is a central repository for metadata related to database objects, including tables, views, data types, and more. It manages data handling during transport between systems and defines various properties such as delivery class, technical settings, and lock objects to ensure data consistency and integrity. Key components include transparent, pooled, and cluster tables, as well as search helps, foreign keys, and maintenance tools like the Table Maintenance Generator (TMG).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAP ABAP------------Data Dictionary

It is a central repository in the sap system where all the metadata related to the database objects are
stored.
The DDIC is used to manage and maintain the definitions of the database objects.

• Database table
Transparent Table, Pooled Table, Cluster Table

• View
Database view, Projection view, Maintenance view, Help view

• Data type
Data element, Structure, Table Type

• Type Groups

• Domain

• Search help

• Lock Object

--------------------------------------------------------------------------------------------------------------------------------------------
---

**Delivery & Maintenance Tab:

* Delivery Class :
determines how the table data is handled during the transport between different SAP systems
(like from development to production) and how it is managed in upgrades
Also tell the type of data that the table will store

A - Application table (Master / Transactional Data)


C - Customizing Table (Config / Changeable data)
L - table for storing Temp data
G - Customizing table

* Master Data : accessed very frequently but changed rarely Examples: Customer Master, Material
Master, vendor Master

* Transactional data : always changing Examples: Sales Order, PO, invoice

* Config data : something we can customize Examples: Pricing Config

* Data Browser/Table View Editing:


SE16 (Data Browser) or SM30 (Table Maintenance)

1 Display/Maintenance Allowed:
User can both view & Maintain data using se16 and SM30 after TMG

2 Display/Maintenance Allowed with Restrictions:


we can control access via Authorization object also can restrict data maintenance for specific user role
we can implement these by Authorization object / TMG events / Custom logic

3 Display/Maintenance Not Allowed:


user can only view data using se16 but cannot maintain data using SM30
data can still be inserted using ABAP PROGRAMS / DRECT UPDATE methods / BAPI / FMs

--------------------------------------------------------------------------------------------------------------------------------------------
---

* First Field MANDT:


Determines whether the table is client dependent of not.
* The table needs to be have at least one more primary key field

--------------------------------------------------------------------------------------------------------------------------------------------
---

* technical Settings Tab:

1) Data Class:
Determines in which table space the data is going to be stored.
Physical area of database where the database table is stored.

APPL0 - Master Data


APPL1 - transactional Data
APPL2 - Organization & Customizing data
USER & USER1 - Provided for customer use

--------------------------------------------------------------------------------------------------------------------------------------------
---

2) Size Category:
determines the size of the initial memory reserved for the table on the database
Total 0 to 9 Size categories

--------------------------------------------------------------------------------------------------------------------------------------------
---

3) Table Buffering of Database Tables:


Stores frequently accessed data on application server
Keeping a copy of table data in application layer instead of going to database every time

Buffering

Buffering not allowed – Table buffering is not performed for the table.
Buffering allowed, but switched off – Table is allowed to be buffered but currently its off. If required we
can on buffering.
Buffering Activated – Table buffering is performed for the table

Buffering Type

Full Buffering: The entire table is stored in the buffer when one record of table is accessed.
Generic Buffering: When a record of table is accessed all records having this record in generic key field
are loaded in buffer.
Single-record Buffering: only accessed Individual records are buffered.
Note : For single record buffer – If SELECT SINGLE is used to access a non-buffered row, an attempt is
made to load the row.
If the row is not found, this is noted in the buffer and the database is not accessed again the next time
SELECT SINGLE is used.

--------------------------------------------------------------------------------------------------------------------------------------------
---

4) Log Data Changes:


Its a check box.
Data changes are logged in the log table DBTABLOG.
The changes can also be analyzed using transaction SCU3.
This also requires the profile parameter rec/client to be set to one of the following.

ALL ( Logging is cross-client )


clnt1, clnt2, ... ( Changes are logged only in the specified clients clnt1, clnt2, … )
OFF (No logging)

If logging is activated, access to the database table slows down and lock situations can arise for the log
table.
Hence, the logging is not set up in the systems usually.

--------------------------------------------------------------------------------------------------------------------------------------------
---

5) DB-Specific Properties:
Either a row store or column store is selected as Storage type.
The data is stored in different way in row and column store.
In HANA dB, the preference is to use Column Store.

--------------------------------------------------------------------------------------------------------------------------------------------
---

* Enhancement Category:
Se11 --> Extras --> Enhancement category
This is also an optional step, but we get a warning while activation if this step is not performed.

* Types:

1) Can be Enhanced(Deep): allows adding complex data types used in oops ABAP / CDS
2) Can be enhanced(Char type or numeric): allows adding CHAR and NUM INT DEC
3) can be enhanced(Char type only): Only Char field can be added
4) Cannot be enhanced: Default - No further fields should be added

--------------------------------------------------------------------------------------------------------------------------------------------
---

* Indexes:
An index helps the database find the rows faster.

1) Primary Index (Default Index):


Primary index is auto created by system when table is created.
It is build on primary key fields of table
The primary key fields uniquely identify each record in the table, ensuring data integrity
The primary index is always a unique index, meaning no two records can have the same combination of
values in the primary key fields
It provides the fastest access to records when the selection criteria in your SELECT statements match the
primary key fields.

2) Secondary Index (Manually created):


We can create secondary index on the transparent tables
Secondary index are manually created by developers in se11 on any non-key field that are frequently
used in WHERE clause of SELECT statements.
secondary index are created to improve performance of data retrieval when primary index cannot be
effectively used.

Note :
No more than five indexes should be created for any one table
An index should only consist of a few fields; as a rule, no more than four
Table fields with the predefined data types STRING and RAWSTRING must not be index fields.
It is recommended that table fields with the data type FLTP are not index fields.

--------------------------------------------------------------------------------------------------------------------------------------------
---

* Check Table:
Check table is validation at field level
it defines valid values for a field in another table
we pass check table while creation foreign key relationship in item table key field.
ensures data consistency only values existing in check table can be entered in main table
Provides input help F4 from check table

* value Table:
Value table is validation at Domain level
Provide values on F4 help for the table field.
it provides default possible values for the field.
it ensures that item table contains valid values after checking with header table for specific field.
Value table acts as check table for all item tables where we have same key field containing value table as
header table
so we can create direct foreign key proposal.

--------------------------------------------------------------------------------------------------------------------------------------------
---

* Foreign Key:
It links item table to header table
It ensures value entered in Item table must exist in header table
This ensures data consistency and provides F4 help.

Steps:
SE11 - Item table - GOTO - foreign key / Foreign key button
select field in item table which is common in header and item tables
assign check table i.e. header table
define cardinality i.e. relation type

Cardinality:
1:1 - each item entry must have exactly one header entry
1:N - one header entry can have many entries in item table
N:N - both side can have multiple entries
--------------------------------------------------------------------------------------------------------------------------------------------
---

* TMG Table Maintenance generator:

TMG offers 39 different events.

* Note : Data Browser/Table View Editing -- Must be -- Display/Maintenance Allowed

Se11 -> table -> Utilities -> TMG


TMG is a tool used to maintain table data using SM30

* Authorization Group:
Mostly &NC& is without any authorization
If the table needs to be maintained by only particular group of people, then the Authorization group needs
to be filled
To maintain the authorization group refer to SU21

* Function group:
it is the name to which the generated maintenance modules will belong to.
Generally Function Group name can be same as table name.

Maintenance screens : Provide the desired screen numbers.

Maintenance can be done in 2 ways.

1. Maintenance and Overview both on one screen.

2. Maintenance on one screen and Overview on another screen

* There are two different Maintenance type – One Step and Two Step method

* One Step Method:


Only Overview Screen is generated
We can maintain multiple records at a time using SM30

* Two Step Method:


Both Overview & Single Screen are generated
We can only maintain single record at a time
overview screen contains only the key fields and single screen contains all the fields
On single screen you can only maintain screen, Like Delete and Insert, You cannot update from single
screen
From overview screen you can delete and update.
When you press ‘New Entries’ button then it will take you to Single Screen.

* Note :
If New field added in table after TMG is generated then we either need to delete and regenerate TMG
OR
Click change pencil icon and regenerate (This case is used with we have Events for TMG)

* TMG Events:
Environment --> Modification --> Events.
It allows us to build custom logic at specific points in table maintenance process.
* Types if TMG Events:
01 -- Before saving data in DB -- Can validate user input
02 -- after saving data in DB -- Trigger update in table
03 -- Before deleting an entry -- Stop delete if record is still used
04 -- After deleting an entry -- Log who deleted record
05 -- Create new entry -- Setting default values / performing validation checks

* Note : In TMG event editor custom code should be written in SUBROUTINE i.e. FORM & ENDOFRM.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Database table

1) Transparent Table:

It has 1:1 relationship between data dictionary table and database table
the structure in se11 is same as in DB
examples : MARA, VBAK
used for storing application data (Master and transactional data)

2) Pooled Table:

It has Many to one relationship with database table


multiple small tables are stored in a single table pool in database
used for storing control data
examples : ATAB - AT01
Primary foreign key relationship is not required
Structure at DB level - Tabname (Table names) varkey (Primary keys fields) dataln (Data length) vardata
(Non key fields)

3) Cluster Table:

It has many to one relationship with database table


multiple cluster tables are stored in a single table cluster
data from multiple tables is compressed and stored together good for saving space
commonly used for HR and accounting
examples : BSEG
Primary foreign key relationship is mandatory
Structure at DB level - Key (Common keys between tables ) Pageno(Continuation of data) vardata
(remaining fields)

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Views: A View is a Virtual table, it a logical representation of one or more database tables

1) Database view:

It is collection of one or more database tables


Tables should have relationship between them
Its based on inner join between two or more transparent tables
Example : A view between VBAK & VBAP

2) Projection View:
Its applicable to single table
allow us to select required field from a table for view
cannot contain join
can be used in open SQL
Example : join on MARA with only MATNR, MTART, MATKL

3) Maintenance View:

Its purpose is to maintain multiple tables


we must consider MANDT field in maintenance view
tables should have relationship between them
cardinality must be 1:1

4) Help View:

It is used in search help


Tables should have relationship between them
cardinality must be 1:1
fetches values from multiple tables to display during input help

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Data Type:

1) Data element :
it defines the technical attributes of a table field like data type and length
and also provides semantic information like field label

2) Structure :
Its a collection of fields of different or same data types.
Structures are primarily used in ABAP programs to define work areas, internal tables

Difference - A table has data but structure does not have any data it hold data only during program
runtime (in memory)

Include-
----------
it is a reusable structure
Can be included in any number of tables or structures, making it a highly reusable component
we can insert include structure at any point in table
it is applicable to only custom Z tables not applicable to SAP standard tables
Max 9 includes we can add in a table

Append-
----------
it is not a reusable structure
Assigned to only one specific table or structure.
it always insert at last of table
it is applicable for both custom Z & SAP standard tables
if an APPEND structure is tied to its table, and you cannot directly delete it; you’d typically delete the
whole table

3) Table Type :
It is used to define structure and functional attributes of an internal table which will be used in ABAP
program
A table type is defined by referencing to a line type.
An existing dictionary type can be used as line type such as -
database tables,
structure,
views,
data elements,
direct type definitions or even another table type.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Type Groups: (also known as a type pool)

used to define and store a collection of data types and constants


It is a container or a group for defining custom data types like structure type, table type etc
common type groups provided by SAP are -- SLIS and ABAP
while creating types within type group all names must start with the name of the type group followed by
underscore
Example:
ZSDOC_TY_VBAK
ZSDOC - type group name
TY_VBAK - structure type in type group
one type group can be used in multiple programs
we declare type group in abap program using TYPE-POOLS statement

the disadvantage is that the entire type group is loaded even if few types are needed
so instead of type groups we prefer to use the types defined through global classes

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Domain:
It defines technical attributes of a table field such as data type and length and the number of decimal
places for a field
we can define same domain to multiple fields having same properties

Value Range:
It can define a fixed value range or a value table, which restricts the possible values that fields referring to
this domain can hold.
This ensures data consistency and validity.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Search help

It provides a list of possible values for a screen field

Types :

1) Elementary Search help: Single search help

2) Collective search help: Combines multiple elementary search helps.


This will basically create tabs in RESTRICTION DIALOG BOX for multiple elementary search helps

Selection method: determines from where the data will be fetched Example: database table or (help)
view

Search help exit : A Search Help Exit in SAP ABAP is a custom ABAP function module that extends and
modifies the standard behavior of a search help.
It provides a mechanism to implement custom logic at various stages of the search help process, allowing
for dynamic filtering, data manipulation, and enhanced functionality beyond the standard search help
capabilities.

Dialog Types:

1) Display values immediately: Values will be displayed immediately

2) Dialog with value restriction: a restriction dialog will appear before displaying values

3) Dialog depends on set of values: if table has less than 100 entries it will display values immediately
if more then 100 a restriction dialog will appear

Search help parameter: Give required Field for search help

LPOS: List position - when values get displayed -- it is sequence of columns once data is displayed

SPOS: Screen position - before displaying values -- sequence of fields on restriction dialog box

Modify: it modifies data element basically we can create new data element and add it.

SDI’s: if checked it greys out the field restricting user input, making it read only

Default values: provides default values for a field Note:- Importing must be unticked.

importing: user Input for field

Exporting: to export value from hit list to screen field


Meaning: after values displayed when user select any one records
only fields having exporting checked will be exported to input fields

steps to assign search help to a table:


[Link] to table
[Link] required field
[Link] search button
[Link] search help name
[Link]/ignore warning
[Link] copy
[Link] & activate table

How to use search help in program:

use key word "MATCHCODE OBJECT" search help name


Example :- PARAMETERS : P_VBELN TYPE vbeln MATCHCODE OBJECT ZSH_VBELN.

--------------------------------------------------------------------------------------------------------------------------------------------
---
• Lock Object
Its used to ensure data consistency and prevent conflicts when multiple users or programs attempt to
access and modify the same data simultaneously
Lock objects name starts with prefix ’EZ’ or ’EY’
T-code to see locked entries is SM12

Enqueue Server: In SM12 entries are temporary which comes from enqueue servers

Lock Modes:

1) "Read Lock" also called as "Shared Lock" (S):

Allows multiple users to read the data simultaneously but prevents any user from modifying it.
An exclusive lock request is rejected if a shared lock exists

2) "Write Lock" also called as "Exclusive Lock" (E):

Allows only one user to access and modify the data. No other user can read or write the locked data.
Write locks can be requested multiple times for same transaction.

3) "Enhances Write Lock" also called as "Exclusive but not cumulative Lock" (X):

Similar to an exclusive lock, but it can only be called once within the same transaction.
Subsequent calls within the same transaction are rejected.

4) Optimistic Lock (O):

Initially behaves like a shared lock, allowing multiple users to access in update mode.
The first user to save the data acquires an exclusive lock, and other shared locks are released.

Steps to create Lock Object:


1. EZ_order click create
2. give description
3. Pass table name
4. select lock mode
5. In lock parameters table the primary key of table will auto appear along with MANDT
6. save and activate

Lock Object FM:

When we activate Lock Object SAP generated 2 FMs


Enqueue_EZ_ORDER & Dequeue_EZ_ORDER
Enqueue - Locking
Dequeue - Unlocking

Now we can create a custom program and call the required FM either to lock and unlock based on
process.

Allow RFC checkbox: It tell us FMs attributes processing type is either Regular FM or Remote-enabled
FM

--------------------------------------------------------------------------------------------------------------------------------------------
---

SE11 - database table - Initial Values Checkbox.



Eg: for field type INT it will take ’0’ Zero as its initial value

Path to check - Utilities -> Database Object -> Display


Even if the checkbox is not checked many databases will initialise the value of field as not null

--------------------------------------------------------------------------------------------------------------------------------------------
---

* SAP Memory:

Programs in different sessions ( Across Sessions )

Example :- Set material number in sap memory

SET PARAMETER ID ’MAT’ Field lv_matnr.

Get material number later:

GET PARAMETER ID ’MAT’ Field lv_matnr.

Note : ’MAT’ is a parameter id which will be available in data element - Further Char tab for field MATNR.

Use when:
you want to prefill fields in transactions like MM03 / VA01
OR
Navigate between screens or programs outside your code

--------------------------------------------------------------------------------------------------------------------------------------------
---

* ABAP Memory:

You can store variables in memory and access them across program in the same call chain.

Using :

EXPORT to memory ID
IMPORT FROM memory ID

Example:

(Sender)
DATA : lv_matnr type matnr value ’M123’
Export lv_matnr to MEMORY ID ’MATKEY’.

(Receiver)
DATA: lv_matnr Type matnr.
IMPORT lv_matnr FROM MEMORY ID ’MATKEY’.
Write:/ ’Material Number:’, lv_matnr.

Use when:
Calling another program with "SUBMIT" or "CALL TRANSACTION"
OR
You want to pass multiple variables internally

--------------------------------------------------------------------------------------------------------------------------------------------
---

* Enhancements in SAP :-
=========================

• User Exits :-
================

User exits are considered modifications.


They are commonly found or used in SD modules
here we insert custom logic to modify the SAP standard functionality without changing core SAP code
User exits are implemented as subroutines using the FORM...ENDFORM

* How to find User Exit:-

Note: Program or t-code must belong to SD module only

1) Find with key word "PERFORM USEREXIT"

-> For T-code VA01


-> SYSTEM
-> STATUS
-> Open Program
-> Click global FIND icon
-> pass Key word "PERFORM USEREXIT"
-> Make sure IN MASTER PROGRAM is selected
-> ENTER
-> this will give you list of all USER EXITS available for that T-code.

2) Go to SE80

-> choose PACKAGE and pass VMOD


-> Expand INCLUDES

VA01 (Create sales order) program "SAPMV45A" here user exits will begin with "MV45A"
VL01N (Create Outbound Delivery) program "SAPMV50A" here user exits will begin with "MV50A"

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Customer Exit :-
===================

Available across many modules (MM,SD,FI)


Customer exits are predefined hooks in sap standard system where developers can add their own custom
code without modifying original sap program.
These exits are provided for programs screens and menus
To FIND a customer exit use T-code SMOD and to IMPLEMENT any customer exit use T-code CMOD

Note :- One customer exit can be assigned to only one project

SMOD - To find CE
CMOD - To implement CE
MODSAP - Table to find CE
MODACT - Table to find project for CE

Types of Customer Exits:-


=========================

1) Function module exit:-


=========================

This allows us to add our custom code in sap program with help of FM.

Syntax: CALL CUSTOMER-FUNCTION ’range 000 to 999’


Example - CALL CUSTOMER-FUNCTION ’001’.

ways to find FME:-

* Put break point on statement CALL CUSTOMER-FUNCTION.


Steps:
go to standard tcode or program
provide /h and execute
BREAKPOINTS --> BREAKPOINTS AT --> BREAKPOINTS AT STATEMSNTS
give statement --> CALL CUSTOMER-FUNCTION
so in the program whatever customer FMs are available it will stop there
double click 3 digit number and check attributes of FM to know the FME details.

* Put package name in SMOD (Utilities -> Find -> Package name)
get package name for standard program from attributes and search you will get list of all available FMEs.

* Go to tcode SE84 Enhancements Customer Exit


similar as way 2 using package name find FMEs

Note :- To implement any type of customer exit use T code CMOD


go to CMOD
provide project name and click create
click enhancement assignment
now pass exit name which u found using CMOD
click on components tab
double click and open FME
inside source code open the include and write your custom code
Note : after changes go to change mode and ACIVATE project & enhancement.

2) Menu Exit :-
===============

ME allows us to add menu items to the menu of sap program.


These menu items have function codes that starts with "+" sign
Example :- +CU6, +CU7

To find ME :-

go to system -> status -> GUI status of any sap program


expand MENU BAR and check for function code starting with ’+’ on all tabs
then get the package for sap program
put in SMOD - utilities - find - package
in list look for customer function text
inside it check under FUNCTION CODES that required function code available or not
use that exit name while implementation in CMOD
this will only add menu button but u need to write custom logic for that button
so under function exit inside Z include we can code it

Example : IF SY-UCOMM = ’+CU6’


CALL TRANSACTION ’ ’.
ENDIF
Note: So in case of menu exit we need to implement both Menu as well as function exit.

3) Screen Exit :-
=================

It allows us to add fields to the screen of sap program with help of customer sub-screen
SAP provides sub-screens areas within a standard screen

Syntax :- CALL CUSTOMER-SUBSCREEN ’sub screen area’ INCLUSING ’program name’ ’screen
number’.

To Find SE:-
Go to sap programs -> system -> status -> screen number and find CALL CUSTOMER-SUBSCREEN
OR
Go to SMOD -> utilities -> FIND -> put package name
look for text - sub screen on initial screen
get that exit name and area

To Implement SE:-
Go to CMOD
Provide project name and click create
click enhancement and provide CE name
click component which will show all available exits
double click on required exit
create screen and design respective layout on screen

Note : inside screen painter attributes remember to select DYNPRO TYPE as SUBSCREEN
then we need write logic in FMEs

--------------------------------------------------------------------------------------------------------------------------------------------
---

• BADI (Business ADD IN):-


==========================

Its an object oriented enhancement framework that allows us to add custom functionality.

SE18 - For BADI Definition


SE19 - For BADI Implementation

Way to find Classic BADI:-

Go to se24 -> CL_EXITHANDLER -> display


Double click GET_INSTANCE method
Put break point at line no 28 CASE SY-SUBRC
before breakpoint go to required transaction
and perform till u need to find BADI for particular process
then put break point and do F8 until u get required exit name

Note :- check description of Exit name in SE18 Attributes to figure out what the exit will do

OR

get the package name for sap program


go to SE18 -> BADI name click F4 button -> Information system
select classic BADI and pass package
this will give list of available BADIs check description of BADIs and get required one.

Steps to Implement classic BADI:-

go to SE19 -> under create implementation pass classic badi name which was found in SE18
give implementation name -> click interface tab -> A class name will appear double click and save
this will open class and show all methods -> and write custom logic in required method

* In SE18 Display BADI under properties we have TYPE

SAP INTERNAL :- If this is checked then we cannot create BADI implementation, this will be for SAP use
only

MULTIPLE USE :- If ticked then we can create multiple implementation for the BADI
If unticked then we can create single implementation only

FILTER DEPEND :- When you mark a BADI as filter-dependent in SE18, you must specify a "Filter Type"
which is a data element.
This data element determines the type of the filter value that will be used.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Enhancement Framework :-
==========================

1) Explicit :-

Explicit enhancements are available at any line as point and section.

* Enhancement Point :-

It will not give us default implementation


you can add additional code you cannot replace existing code

* Enhancement Section :-

It will give us default implementation


we can change or replace existing code
once we create section the default implementation will also come in our new section
so either we can change or replace that code.

2) Implicit :-
Implicit points are available at starting or at last of program

--------------------------------------------------------------------------------------------------------------------------------------------
---

• OOPs ABAP:-
============

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Class:

A class is a blueprint or a template for creating object


it defines attributes and methods that an object will have
A class itself does not occupy memory its just definition

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Definition:

the CLASS....DEFINITION block defines the components such as attributes and methods of the class
it has different visibility sections

PUBLIC SECTION - can be Accessed outside class


PROTEDCTED SECTION - can be Accessed within the class and subclass
PRIVATE SECTION - can be Accessed within the class itself

• Implementation:

The CLASS...IMPLEMENTATION block contains the actual code for the methods defined in the
DEFINATION part

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Object:

An object is an instance of a class


when you create an object you are allocating memory for it based on the blueprint provided by the class
you can create multiple objects from a single class and each object will have its own unique set of
attribute values.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Attributes:

Attributes are variables that hold the data associated with an object
they define the state of the object
for example: A class called cl_car might have attributes like car_color and current_speed

--------------------------------------------------------------------------------------------------------------------------------------------
---
• Methods:

Methods are procedures or functions that define the behaviour of an object


they are used to manipulate the objects data(attributes)
for example: a cl_car class might have methods like accelerate, brake and get_speed.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Interface:

An interface defines a set of method signatures but does not provide any implementation.
It is used to define a contract that classes must follow.
A class that implements an interface must provide implementations for all the methods declared in the
interface.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Singleton Class:

It ensures that only one instance of class can exist throughout the entire application runtime and provides
a global point of access to that single instance.
we cannot create the instance/object outside the class
we write the logic for instance/object in class itself -- class methods

Steps to create Singleton Class:

* Constructor is kept PRIVATE


* Declare static variables
* Static method to return the single instance

Example : the constructor of class is declared as private or protected.


this prevents external code from directly instantiating the class using CREATE_OBJECT or NEW
thereby enforcing the once instance only rule.

Use Singleton When :-

The object represents a global resource like printer we don’t need to have printer for each person.
We want only one version of consistency

Avoid singleton when :-

Each user/ session needs its own independent object


you are working with parallel processing

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Constructor:

A constructor is a special method in Object-Oriented ABAP that is automatically called when an object of
a class is created.
The constructor is used to initialize the object, set default values for attributes,
and perform any necessary setup when the object is instantiated.
It is defined using the CONSTRUCTOR keyword.
A constructor cannot return any value and typically doesn’t have a return type.

• Example:

CLASS my_class DEFINITION.


PUBLIC SECTION.
METHODS: constructor.
PRIVATE SECTION.
DATA: name TYPE string.
ENDCLASS.
CLASS my_class IMPLEMENTATION.
METHOD constructor.
name = ’John Doe’.
ENDMETHOD.
ENDCLASS.

In this example, when an object of my_class is created, the constructor method is called,
and the attribute name is initialized with the value "John Doe."

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Abstract Class : class that cannot be directly instantiated, meaning you cannot create objects of an
abstract class itself.
Its primary purpose is to serve as a blueprint or a common base for other classes, known as
subclasses.

Key characteristics of abstract classes in ABAP:

Cannot be instantiated
Subclasses must implement abstract methods
Can contain concrete methods and attributes
Used for defining common functionalities and interfaces

Example:

CLASS lcl_abstract_base DEFINITION ABSTRACT.


PUBLIC SECTION.
METHODS: process_data ABSTRACT. " Abstract method with no implementation
METHODS: log_message. " Concrete method with implementation
ENDCLASS.

CLASS lcl_abstract_base IMPLEMENTATION.


METHOD log_message.
WRITE ’Logging a message from the abstract base class’.
ENDMETHOD.
ENDCLASS.

CLASS lcl_concrete_subclass DEFINITION INHERITING FROM lcl_abstract_base.


PUBLIC SECTION.
METHODS: process_data REDEFINITION. " Implementation for the abstract method
ENDCLASS.
CLASS lcl_concrete_subclass IMPLEMENTATION.
METHOD process_data.
WRITE ’Processing data in the concrete subclass’.
ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
DATA: lo_instance TYPE REF TO lcl_concrete_subclass.
CREATE OBJECT lo_instance.

lo_instance->process_data( ). " Calls the implementation in the subclass


lo_instance->log_message( ). " Calls the concrete method from the abstract class

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Pillars of OOPs ABAP:


=========================

1) Encapsulation: Bundling data (attributes) and the methods that operate on that data into a single unit (a
class) and controlling access to that data.

Achieved primarily through visibility sections (PUBLIC, PROTECTED, PRIVATE) within a class. Attributes
and methods declared in the PRIVATE section are only accessible within the class, while those in the
PUBLIC section form the interface for external interaction

• Example:

Class lcl_account Implementation


public section
methods: deposit Importing iv_amt type i.
get_balance returning value(rv_bal) type i.
private section
data : my_balance type I.
Endclass.

class lcl_account implementation.


method deposit.
my_balance = my_balance + iv_amt.
endmothod.
method get_balance.
rv_bal = my_balance.
endmethod.
endclass.

here my_balance is private / Hidden outside world can only use methods

--------------------------------------------------------------------------------------------------------------------------------------------
---

2) Abstraction : Showing only essential features and hiding complex details.

Abstraction utilizes interfaces and abstract classes/methods, while encapsulation uses visibility sections.
• Example:

Interface zif_payment.
methods process_payment importing iv_amount type i.
endinterface.

class zcl_creditcard definition.


public section.
interface zif_payment.
endclass.

class zcl_creditcard implementation.


method zif_payment~process_payment.
write:/ ’Credit Card Payment Of:’, iv_payment.
endmethod.
endclass.

User only knows they must call process_payment not how it works internally.

--------------------------------------------------------------------------------------------------------------------------------------------
---

3) Inheritance : Child class reuses/extends parent class features.

• Example:

Class lcl_animal definition


public section
methods speak.
endclass.

class lcl_animal implementation.


method speak.
write:/ ’generic sound’.
endmethod.

class lcl_dog definition inheriting from lcl_animal.


public section.
methods speak redefinition.
endclass.

class lcl_dog implementation.


method speak.
write:/ ’bark’.
endmethod.

lcl_dog inherits from lcl_animal but changes behaviour.

--------------------------------------------------------------------------------------------------------------------------------------------
---

4) Polymorphism: Same method / Interface call behaves differently for different objects.

• Example:
Data: lo_animal type ref to lcl_animal.

lo_animal = NEW lcl_dog( ).


lo_animal->speak( ). "Bark"

lo_animal = NEW lcl_animal( ).


lo_animal->speak( ). "generic sound"

Same Speak( ) method but different results depending on object.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Method Overloading:

Purpose: Allows a single class to have multiple methods with the same name but different parameter lists
(number, type, or order of arguments). This provides flexibility by enabling methods to perform similar
operations on different types or quantities of data.

Scope: Occurs within a single class.

Polymorphism: An example of compile-time polymorphism (static binding), as the compiler determines


which overloaded method to call based on the arguments provided during compilation.

Return Type: The return type can be different for overloaded methods, but it is not a factor in
distinguishing them.

Inheritance: Not directly related to inheritance, as it operates within a single class.

ABAP Achieves Overloading through "OPTIONAL PARAMETERS"

• Example:

CLASS cl_math DEFINATION.


PUBLIC SECTION.
METHHODS add
IMPORTING i_num1 TYPE i
i_num2 TYPE i OPTIONAL
RETURING VALUE(r_result) TYPE i.
ENDCLASS.

CLASS cl_math IMPLEMENTATION.


METHOD add.
IF i_num2 IS INITIAL.
r_result = i_num1.
ELSE.
r_result = i_num1 + i_num2.
ENDIF.
ENDMETHOD.
ENDCLASS.

START OF SELECTION.
DATA(lo_math) = NEW cl_math( ).

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Method Overriding:

Purpose: Allows a subclass to provide a specific implementation for a method that is already defined in its
superclass. This enables specialization of behavior for derived classes while maintaining a common
interface.

Scope: Occurs between a superclass and its subclass(es). Inheritance is required.

Polymorphism: An example of run-time polymorphism (dynamic binding), as the method to be executed is


determined at runtime based on the actual object type.

Return Type: The return type of the overridden method in the subclass must be the same as, or a subtype
of, the return type of the method in the superclass.

Inheritance: Fundamentally relies on inheritance, as a subclass overrides a method inherited from its
superclass.

• Example:

Class lcl_animal definition


public section
methods speak.
endclass.

class lcl_animal implementation.


method speak.
write:/ ’generic sound’.
endmethod.

class lcl_dog definition inheriting from lcl_animal.


public section.
methods speak REDIFINATION.
endclass.

class lcl_dog implementation.


method speak.
write:/ ’bark’.
endmethod.

• Note: "REDIFINATION" keyword is mandatory in subclass definition

--------------------------------------------------------------------------------------------------------------------------------------------
---

• In essence:

Overloading allows you to define multiple versions of a method within the same class, differentiated by
their parameter lists.
Overriding allows a subclass to redefine the implementation of a method inherited from its superclass.

--------------------------------------------------------------------------------------------------------------------------------------------
---
• Multiple Inheritance:

ABAP does not support multiple inheritance directly through classes. However, multiple inheritance can
be achieved using interfaces. A class can implement multiple interfaces, thereby inheriting the method
signatures from all the interfaces.

• Example:

INTERFACE if_car.
METHODS drive.
ENDINTERFACE.

INTERFACE if_airplane.
METHODS fly.
ENDINTERFACE.

CLASS cl_flying_car DEFINATION.


PUBLIC SECTION.
INTERFACES if_car.
INTERFACES if_airplane.
ENDCLASS.

CLASS IMPLEMENTATION.

METHOD if_car~drive.
WRITE:/ ’Car is driving on road’
ENDMETHOD.

METHOD if_airplane~fly.
WRITE:/ ’Car is flying in sky’
ENDMETHOD.

ENDCLASS.

START OF SELECTION.
DATA(lo_flying_car) = NEW cl_flying_car.
lo_flying_car->if_car~drive( ).
lo_flying_car->if_airplane~fly( ).

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Instance Attribute:

Belongs to the object (Instance) not to the class


Every object you create has its own copy of attribute
changing the value in one object does not affect another object

• Example: Each student in class has unique names

DATA: gv_name TYPE string.

--------------------------------------------------------------------------------------------------------------------------------------------
---
• Static Attribute:

Belongs to the class itself not to any object


Shared across all objects of the class
If one object changes it the change is visible to all other objects

• Example: All student share same school name, is school name changes, it changes for everyone.

CLASS-DATA: gv_school TYPE Sting.

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Instance Method:

Belongs to an object
You need to create an object first before calling them
They can access both Instance and Static Attributes

• Example:

DATA(lo_obj1) = NEW cl_demo( ).


lo_obj1->Instance_attri = 10.
lo_obj1->show_inst_attri( ).

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Static Method:

Belongs to the class itself not to any object


Can be called without creating an object
They can only directly access static attributes not instance attributes

• Example:

cl_demo=>static_attri = 100.
cl_demo=>show_static_stti( )

--------------------------------------------------------------------------------------------------------------------------------------------
---

• Events in OOPs.

By which event/method of one class can be called in method of another class.

• Steps:

1) DEFINE the event inside the class "EVENTS"


2) RAISE the event inside some method "RAISE EVENT"
3) HANDLE the event in another class/Program "METHODS....FOR EVENTS"
4) LINK/REGISTER the event handler "SET HANDLER"

• Example:
• EVENT PUBLISH CLASS:

CLASS cl_alarm DEFINITION.


PUBLIC SECTION.
EVENTS fire_detected. "STEP 1 DEFINE EVENT
METHODS check_smoke.
ENDCLASS.

CLASS cl_alarm IMPLEMENTATION.


METHOD check_smoke.
write:/ ’Smoke Dected’.
RAISE EVENT fire_detected. "STEP 2 RAISE EVENT
ENDMETHOD.
ENDCLASS.

• EVENT HANDLER CLASS.

CLASS cl_firefighter DEFINATION.


PUBLIC SECTION.
METHODS handle_fire for EVENT fire_detected OF cl_alarm. "STEP 3 EVENT HANDLER
ENDCLASS.

CLASS cl_firefighter IMPLEMENTATION


METHOD handle_fire.
WRITE:/ ’Fire Fighter arrived’.
ENDMETHOD.
ENDCLASS.

• PROGRAM:

START OD SELECTION.

DATA(lo_alarm) = NEW cl_alarm( ).


DATA(lo_firefighter) = NEW cl_firefighter( ).

SET HANDLER lo_firefighter->handle_fire FOR lo_alarm. "STEP 4 LINK EVENT

lo_alarm->check_smoke( ).

--------------------------------------------------------------------------------------------------------------------------------------------
---

ADOBE FORM / PDF FORMS :

Adobe form are interactive forms


we can interact with output of adobe form
Adobe form provides output in form of PDF
T-Code - SFP
In adobe form first we need to create interface, the same interface can be used in multiple adobe forms
Adobe form also generates a FM at run time
Adobe LiveCycle designer (ADLC) is required to design layout with the help of adobe form

Difference in Adobe form and smart forms:

Smart form are not interactive forms whereas adobe forms are interactive forms
in Smart form the form interface global definition pages windows are all together
whereas in adobe form the form interface global definition are part of interface and we design layout
separately

Types of interfaces:

ABAP Dictionary Based Interface: This interface has different standard parameters in the form interface.

XML Schema based interface : we use this interface if we create forms in form builder in webdynpro for
abap.

Smartform Compatible interface: this also has different standard parameters in form interface.

Note : if you want table data to continue on next pages then select that table in layout go to pallet - object
- table - check - Allow page break within content

logo : If we want to add logo in master page - select master page - insert - standard - image - browse and
add - check Embed image data or else image will not show in output.

adding Page no : go to master page - select page 1 - insert - Custom - "Page n of m" it will show current
page (n) with total page (m)

to display barcode : go to body page - select the subform in which u want to add barcode - insert -
barcode - eg: Code 128A and bind the field.

* How to use textmodule in form - create text module in SMARTFORM tcodec - in sfp add text in context -
and then drag and drop in form from data view.

* **How to create reusable text using SO10** - create text and save - add text in context of form - and
drag and drop in form from data view to reuse the same text.

* Integration into program:

FP\_JOB\_OPEN - here we can manage parameters like no preview or no dialog box etc.

FP\_FUNCTION\_MODULE\_NAME - this will generate FM name for our form

lv\_funcname - here we will store generated fm name and call

FP\_JOB\_CLOSE - close job

* Scripting language in Adobe form

1. FormCalc - its default scripting language - best for date \& time , Financial, calculations, logical etc.

2. JavaScript - use in case of interactive \& dynamic things

EG : javascript to make field visible or invisible

this - means current selected field

IF ( [Link] == ’C’ )
{
[Link] = "visible";
}
ELSE
{
[Link] = "hidden";
}

JavaScript - here we are making text filed Document Cat visible only for given sales order number in
condition.

  ("this file path to the sales order number field in hierarchy")

if ( [Link]("[Link]").rawvalue == "ID10000000" )
{
[Link] = "visible";
}
else
{
[Link] = "hidden";
}

* Adobe form translation tcode se63 - other text - PDF based form for form texts
* smartoform module text - tcode se63 - other text - sapscript form and style - sap smart form - name of
text module
* include text - SO10 translation of text - change lang and create new include text

Note : if we are using any language variable then change context text lang for both include and module
text in context of form

Sending Adobe form as EMAIL: BCS (Business Communication Service)

In case of SMARTFORMS we need to convert it to OTF then to PFD but in ADOBE FORMS its already
and PDF form so we can send directly in mail

CL_BCS : Class is used for creating send request i.e. adding recipient sending document etc
CL_DOCUMENT_BCS : This class is used for creating document and adding attachment
CL_SAPUSER_BCS : This class is used for creating SAP users
CL_CAM_ADDRESS_BCS : This class is used for creating external recipients

SCMS_XSTRING_TO_BINARY : Convert Xstring data of form to Binary data

Tcode SBWP : for sap user to check status

SOST : for external mail user to check status

dynamic logo in adobe form :

CL_SSF_XSF_UTILITIES
GET_BDS_GRAFIC_AS_BMP

BDS(Business Document server)

SE78 : we can upload graphics to sap system

--------------------------------------------------------------------------------------------------------------------------------------------
---
IDOC: Intermediate Documents

It is a data container which is exchanged between sap or non sap systems

T Code :

WE02 / WE05 - To Display IDOC


WE81 - Message type
WE82 - Mapping of message type and IDOC Type
WE30 - IDOC Type
WE31 - Segments
BDBG - Generate ALE Interface for BAPI
WE21 - Ports in IDOC Processing
SM59 - RFC Connections
AL11 - File Directory’s
WE20 - Partner Profiles
BD54 - Logical System
WE41 - outbound Process Code
WE42 - Inbound Process Code
WE57 - Mapping of Message Type, IDOC Type and FM

Data Exchange methods:

ALE - Application link enabling

since the format of data is not changing so it is called as ALE

ALE is always between sap to sap data exchange

EDI - Electronic data interchange

here format of data exchange will change from EDI to X12 and from X12 back to IDOC

It supports both sap to non-sap and non-sap to sap and sap to sap as well

IDOC Architecture:

1. Control Record : It provides control information such as IDOC Type, message type, port, partner
number
it also provides direction of idoc 1 is outbound and 2 is inbound
Table : EDIDC

2. Data Record : It provides data in IDOC which is stored in segments


Table: EDID4

3. Status Record : It provides status of IDOC success/failure


1-49 for outbound idoc
50-75 for Inbound idoc
Table : EDIDS

Message Type : it specifies the meaning of data


it tells for which purpose the idoc is going
TCODE - WE81

IDOC Type : It is also called as Basic Type


it specifies the structure of data which is to be exchanged
TCODE - WE30

Segments : these are basic elements of an IDOC Type


Data is stored in segments in IDOC
TCODE - WE31

IDOC ALE interface for BAPI :

TCODE to create ALE Interface for BAPI - BDBG


Table to store BAPI_ALE Interface for inbound - TBDBE

IDOC Settings :

Port : It defines technical link between sender and receiver system


TCODE - WE21

Common types of port are File Port and TRFC Port

TRFC Port - stands for Transaction port here we define port for RFC destinations created using SM59

File Port - here we can specify the directory where the IDOC file should be placed done using AL11

Partner Profile : A partner is one with whom we conduct business or exchange data.
KNA1 partner number should already exist in customer table.
TCODE - WE20

Process Code : It contains details of function module that are used for IDOC processing
every process code has FM which is used to process IDOC

Types of Process codes:

1. Inbound Process Code : It processes IDOC and sends data to application TCODE - WE42

2. Outbound Process Code : It takes data from application and send data to IDOC TCODE - WE41

--------------------------------------------------------------------------------------------------------------------------------------------
---

SAP ABAP WEBDYNPRO

Q1: What is Web Dynpro ABAP? Explain its architecture and key components.
Web Dynpro ABAP is SAP’s standard UI technology for building web-based applications in ABAP.
It follows the MVC architecture:

Model: Business logic (ABAP classes, RFCs, BAPIs).


View: UI elements displayed to the user.
Controller: Handles events and communication between model and view.
Key Components:
Component: Root object of the application.
Component Controller: Central controller for data exchange.
Views & Windows: Define UI and navigation.
Context: Data binding between UI and backend.
Advantages: Platform-independent, reusable components, automatic client rendering, strong integration
with ABAP backend.

Q2: Explain the role of Context in Web Dynpro ABAP. How does data binding work?

Context in Web Dynpro ABAP is the data storage area that holds application data during runtime. It
consists of nodes (collections of attributes) and attributes (individual fields).
Purpose:

Acts as a bridge between UI elements and backend logic.


Enables data binding, which automatically synchronizes UI fields with context attributes.
Levels:
Component Controller Context: Global data accessible across views.
View Context: Local data for that view only.
Binding:
When you bind a UI element to a context attribute, any change in the UI updates the context and vice
versa.
Advanced:
Nodes can have cardinality and supply functions for dynamic data loading.

Q3: Explain the difference between Component Controller and View Controller in Web Dynpro ABAP.
When do you use each?

Component Controller:

Global controller for the entire Web Dynpro component.


Holds data and logic that must be shared across multiple views/windows.
Created once per component instance.

View Controller:

Local controller for a specific view.


Handles UI-specific logic and events for that view only.
Created per view instance.

When to use:

Use Component Controller for global data (e.g., user session info, RFC calls).
Use View Controller for UI-specific logic (e.g., button click handling in that view).

Q4: How does navigation work in Web Dynpro ABAP? Explain Windows, Plugs, and Navigation Links.

Navigation in Web Dynpro ABAP is managed through windows, plugs, and navigation links.
A window contains multiple views. Each view has inbound plugs (entry points) and outbound plugs (exit
points).
Navigation links connect outbound plugs of one view to inbound plugs of another.
When an outbound plug is triggered, the linked view is displayed, enabling controlled navigation between
screens.

Q5: What are Supply Functions in Web Dynpro ABAP Context Nodes? Why do we use them?

A Supply Function is a special method linked to a context node that automatically populates data for that
node when it is accessed at runtime.

Why do we use them?

To lazy-load data only when needed, improving performance.


To avoid unnecessary backend calls for nodes that may not always be used.
To centralize logic for filling context nodes.

How it works:

Each context node can have an optional Supply Function.


When the node is accessed for the first time (or cleared), the supply function is triggered automatically.
Inside the supply function, you write logic to fetch data (e.g., from a database or RFC) and fill the node.

Q6: What are the different types of controllers in Web Dynpro ABAP? Explain their roles.

Web Dynpro ABAP has four main controllers:

Component Controller

Global controller for the entire component.


Holds data and logic shared across multiple views/windows.
Created once per component instance.

View Controller

Local controller for a specific view.


Handles UI-specific logic and events for that view only.
Created per view instance.

Window Controller

Manages navigation between views inside a window.


Handles inbound/outbound plugs and navigation links.

Interface Controller

Exposes data and methods of a component to other components.


Used for component reuse and cross-component communication.

Q7: How do you handle events in Web Dynpro ABAP? Give an example of an action triggered by a button
click.

Events are triggered by UI actions (e.g., button click) and handled in the view controller.
Example:
Create a button in the view layout.
Assign an action to the button (e.g., ON_CLICK).
Implement the corresponding event handler method in the view controller:

METHOD on_action_on_click.
DATA lv_text TYPE string.
lv_text = ’Button clicked!’.
wd_context->set_attribute( name = ’MESSAGE’ value = lv_text ).
ENDMETHOD.

Show more lines


This updates the context attribute MESSAGE, which is bound to a UI element.

Q8: What is the difference between Interface Controller and Component Controller? Why do we need an
Interface Controller?

Component Controller:

Internal to the component.


Manages global data and logic for that component only.

Interface Controller:

Exposes selected data and methods of the component to other components.


Enables component reuse and cross-component communication.

Why needed?
If you have multiple Web Dynpro components and need to share data or call methods between them, you
use the Interface Controller.

Q: How do you create dynamic UI elements in Web Dynpro ABAP?

Use View Container UI elements and Dynamic Programming APIs.


Steps:

Create a View Container in the layout.


Use CREATE_VIEW method in the Window Controller to instantiate views dynamically.
Use IF_WD_VIEW_MANAGER interface for dynamic view handling.

Q: How do you display ALV in Web Dynpro ABAP?

Use SALV_WD_TABLE component.


Steps:

Add SALV_WD_TABLE as a used component.


Create a component usage in your main component.
Bind your internal table to the ALV context node.
Configure ALV settings using IF_SALV_WD_TABLE_SETTINGS.

Key Features:

Sorting, filtering, column configuration.


Event handling for user actions.
Q: How do you optimize performance in Web Dynpro ABAP?

Lazy Loading: Use Supply Functions for context nodes.


Reduce Round Trips: Minimize server calls by grouping actions.
Context Design: Avoid deep context hierarchies.
Reuse Components: Instead of creating multiple similar components.
ALV Optimization: Use field catalog and avoid unnecessary columns.

Q: How do you share data between two different Web Dynpro components?

Use Interface Controller of the source component.


Steps:

Expose required context nodes or methods in the Interface Controller.


In the target component, create a Component Usage for the source component.
Access the interface controller using:

DATA lo_comp_api TYPE REF TO if_wd_component.


lo_comp_api = wd_this->wd_cpuse_sourcecomp( )->get_interface_controller( ).

Call methods or bind data as needed.

Q: How do you integrate FPM with Web Dynpro ABAP?

FPM provides reusable floorplans (OVP, GAF, QAF) for consistent UI.
Steps:

Create a Web Dynpro component implementing FPM interfaces like IF_FPM_OVP_COMPONENT.


Configure the component in FPM configuration editor (transaction FPM_CONFIG_EXPERT).
Define UIBBs (UI Building Blocks) for different sections.

Benefit: Standardized UI, easy navigation, and better user experience.

Q: How do you call an RFC in Web Dynpro without blocking the UI?

Use Asynchronous RFC (aRFC).


Steps:

Define an asynchronous method in the component controller.


Implement callback method to handle the response.
UI remains responsive while RFC executes in the background.

Q: How do you create dynamic ALV columns in Web Dynpro?

Use SALV_WD_TABLE component and field catalog.


Steps:

Prepare a dynamic internal table based on user input.


Bind it to ALV context node.
Configure columns dynamically using IF_SALV_WD_COLUMN_SETTINGS.

____________________________________________________________________________________
_____________________________________________________________________

Outbound Process (SAP → Non-SAP)

IDoc Creation in SAP

Triggered by an application (e.g., Sales Order, Invoice).


Uses Message Type (e.g., ORDERS) and IDoc Type (e.g., ORDERS05).

Partner Profile Configuration

Define Outbound Parameters in WE20 for the partner.


Assign:

Message Type
IDoc Type
Output Mode (Immediate or Collect)
Communication Method (e.g., File, RFC, HTTP)

Port Configuration

Create a Port in WE21:

File Port: Writes IDoc to a directory.


RFC Port: Sends IDoc via RFC.
XML/HTTP Port: For web services.

Idoc Processing

IDoc is generated and placed in status 30 (Ready for Dispatch).


Use Program RSEOUT00 or automatic job to send IDoc.

Transfer to Non-SAP System

Via:

File Interface (Flat file/XML)


Middleware (e.g., PI/PO, MuleSoft)
Direct HTTP/RFC

Monitoring

Check IDoc status in WE02 or WE05.


Common statuses:

03: Successfully sent


12: Dispatch OK

Inbound Process (Non-SAP → SAP)

Receive IDoc Data


Non-SAP system sends IDoc via:

File drop
RFC call
Middleware integration

Port & Partner Profile

Configure Inbound Parameters in WE20:

Message Type
IDoc Type
Process Code (links to Function Module)

Process Code & Function Module

Assign Process Code in WE42.


Function Module (e.g., IDOC_INPUT_ORDERS) processes the IDoc.

IDoc Posting

IDoc enters SAP in status 64 (Ready to Post).


Posting done by:

Background Job (RBDAPP01)


Immediate processing if configured.

Monitoring

Use WE02, WE05 for IDoc status.


Common statuses:

53: Successfully posted


51: Error during posting

Key Points

Middleware often simplifies mapping and protocol conversion.


Error Handling: Use BD87 for reprocessing failed IDocs.
Security: Ensure proper RFC user roles and file permissions.

____________________________________________________________________________________
_______________________________________________________________________

Outbound Process (SAP → SAP)

IDoc Creation

Triggered by an application (e.g., Sales Order, Delivery).


Uses Message Type (e.g., ORDERS) and IDoc Type (e.g., ORDERS05).

Partner Profile Setup (WE20)

Define Outbound Parameters for the SAP partner system.


Assign:

Message Type
IDoc Type
Output Mode (Immediate or Collect)
Communication Method: RFC (common for SAP-to-SAP)

Port Configuration (WE21)

Create RFC Port pointing to the target SAP system.


RFC destination created in SM59.

IDoc Dispatch

IDoc generated → status 30 (Ready for Dispatch).


Sent via RFC using Program RSEOUT00 or automatic job.

Monitoring

Check IDoc status in WE02 or WE05.


Status:

03: Successfully sent


12: Dispatch OK

Inbound Process (SAP → SAP)

Receive IDoc via RFC

Target SAP system receives IDoc automatically through RFC port.

Partner Profile Setup (WE20)

Define Inbound Parameters for the sending SAP system.


Assign:

Message Type
IDoc Type
Process Code (links to Function Module)

Process Code & Function Module (WE42)

Assign Process Code to handle IDoc (e.g., ORDERS → IDOC_INPUT_ORDERS).

IDoc Posting

IDoc enters with status 64 (Ready to Post).


Posting done by:

Background Job (RBDAPP01)


Immediate processing if configured.

Monitoring

Use WE02, WE05 for IDoc status.


Status:

53: Successfully posted


51: Error during posting

Key Differences from SAP ↔ Non-SAP

Communication is RFC-based, not file or HTTP.


No need for middleware or file conversion.
Both systems understand IDoc structure natively.

You might also like