Technology: SAP ABAP Simplified Part-IV
-SAP Consultant, L & T Infotech
This is the 4th and last article of the series SAP ABAP Simplified and is also published by GoArticles. This acrticles is morever focused on explaining concepts of function modules and Badis. For your reference earlier articles of the series are as follows: SAP ABAP Simplified part -1, SAP ABAP Simplified part -2, SAP ABAP Simplified part -3
Function Modules:
Function modules are like sub routines which can be called from any part of ABAP program. The difference between sub routines and Function modules is that: Sub routines are useful with in a particular Program where as once a function module is created; it can be used in any program. We can say Function Modules are global where as sub routines are not. The type of the data element used in the import or export parameters of Function Module is to be defined initially in the dictionary.
A Function Group is to be defined prior to the definition of Function module. This function module is embedded to the function group. A function group contains any number of function modules.
A Function module contains the following elements:
1. Attributes
2. Import parameters
3. Export parameters
4. Changing
5. Tables
6. Exceptions
7. Source Code.
Attributes:
It defines the details of function module like the function group under which the function module is created, type of the function Module, and the general data like user who created and changed the object, and in which package it is present.
Import parameters:
The input to the function module is passed through the import parameters. Here we can only define a structure (which contains only 1 record) or separate fields.
Output Parameters:
The output generated after executing the program will be passed through export parameters. Here also we can pass only a structure with single records or as separate fields.
Changing:
The parameters which can be used as both input and output are declared using Changing tab of function module.
Tables:
The input or output parameters that contains multiple records are passed in and out of the function module using Tables Tab of function module. A structure will be treated as a table if it is defined in the associated type of this section.
Source code:
The real program logic will be written in the source code portion. All the manipulations with the import parameters are done in this section and the result is send through output parameters/tables/changing. A function module can make a call to any number of function modules. All the manipulations that are performed in report program can be done in Function modules also.As before mentioned we can define the type of the function module in the attributes section whether it is a Normal function module or Remote function Module.
By selecting the appropriate radio button the type is selected. The output of the stand alone function module is viewed using Execute button or F8.Here the user is allowed to give the required input parameters. It will pop up a window to enter the input value if the parameter is selected as Mandatory in the import parameter section.
BAdis:
Discussing the similarities of BAdis and User-Exits:
1. Both BAdi and User-exits are enhancement concepts.
2. Both will allow the users to write their own code in addition to the already existing standard code.
However, it replaces the user-exit concept which has fewer advantages compared to BAdi. BAdis are implemented using Object Oriented concept. The difference stays here that there can be only one user-exit for a definition but there can be n number of BAdis for a single BAdi definition which is called as BAdi Implementation. More over reusability of BAdis makes the biggest difference.
Through BAdi definition the enhancement point is defined and with the help of BAdi implementation the required code for the BAdi is implemented. There can be any number of implementations for a definition. Call to that particular implementation is done based on the requirement.
The process flow in User-Exit is sequential where as in BAdi the process is in the form of modules. BAdi provides the filter option to ensure that the specific implementation is called. The original code would not get affected when a BAdi is used. This is very useful when a particular application is a shared application.
Here we have reached to the end of SAP ABAP Simplified Series. Hope this series will be of greate help you. Comments are always welcome so that we can improve on our further articles.



Hi Swarna,
The Articles you are written are simply superb.Thanks for Sharing with many people.If you have some time you can write some more articles like this spanning different topics in SAP ABAP which are very useful for many people.Hope to see more articles.Again Thanks lot for your work.
Suresh
Hi Swarna:
Very good articles on SAP ABAP. Expect more articles from real time perspective.
Regards,
Ramesh
Hi Suresh & Ramesh,
Thanks for the support. Soon we will come up with new articles both on theoretical part and with practical examples.
Regards,
Swarna Munukoti.
Nice to know you people liked our articles. We are working on some more articles on SAP, Netweaver, MBA, Healthcare, Philosophy and more. I request people to read articles from other categories as well. Also we have launched the forums, please register yourself and explore some really great SAP code snippets and much more.
Visit forums here.
http://forums.madeitsimple.com
If anyone want to contribute then do mail us at following id:
madeitsimple@gmail.com
ameya@madeitsimple.com
Regards,
Ameya
Leave a comment!
Web Content by Ameya Pimpalgaonkar is copyright protected & licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.
Based on a work at www.madeitsimple.com.
Online Advertising
Online Advertising
Bon Voyage »
Untouched Holiday Destinations : Tarkarli
New weekend at new destination…this time at TARKARLI..it is a paradise of tiny islands and hamlets and beautiful casuarina trees…it is in sindhudurg district of maharashtra,near karli river which meets the Arabian sea..the blue beach …
Finconomy »
How to start investing in financial markets?
Often at the start of one’s career one struggles with this question. How should I start investing my hard earned money so that after sometime I can get profits on it and also save income …
General »
CAT 2009 results out
After so many delays and technical glitches, IIMs are out with the result of their elite of the all exams; CAT. You can check your CAT results on CAT IIM website which is catiim.in However …
Downloads »
Download SAP Enterprise Portal Themes
Adapting the visual appearance of SAP Enterprise Portal to the customer’s Corporate Identity is very important. The portal is always there; it constitutes the frame in which users work. Designing this frame to effectively convey …
News Updates »
CAT 2009 results out
After so many delays and technical glitches, IIMs are out with the result of their elite of the all exams; CAT. You can check your CAT results on CAT IIM website which is catiim.in However …
Reviews »
Website Review: DoFollow Forums
The website that I am going review today is DoFollowForum.com. I came across this site recently when I was working on link building for my website. As every one knows not a number of links …
Healthcare »
Homeopathy and Kids - Part two
I hope homeopathy and kids - part 1 was interesting and helpful for all our readers. Part 2 elaborates more remedies that can help your child to develop better and learn better. If you think …
In Focus »
Happy Republic Day to all Indians
Soon after the Indian National Congress, at the forefront of the country’s independence movement, adopted the ‘purna swaraj’ or complete independence resolution at its Lahore convention on New Year’s Day in 1930, Mahatma Gandhi called …
MBA »
Management programs in public service & teaching
Want to make a difference in publich service? Looking for future in public service and policy? Learn about management programs that will grant you entry in public services & policy making. Almost everyone who is interested to …
Media »
Cool Apple iMac lamp
So you have got the iPad or you may have got MacBook Pro. Whatever apple product you may have, your collection is incomplete unless you get cool iMac G4 lamp. Now what is it? Yet …
Technology »
Accessing deep structures in ABAP
It is always a challenging part to work with complex data types in ABAP. And one of these types is handling deep structures. However it depends on how well we understand the structure design. We …
About us
Categories
All writings are copyright protected
Web Content by Ameya Pimpalgaonkar is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.
Based on a work at www.madeitsimple.com.
Archive
Blogroll
Tag Cloud
ABAP ABAP Simple abap simplified AIMCAT apple apple imac apple iPhone Aromatherapy career CAT CAT 2008 CAT 2009 Crack SNAP Economy English EP Essential oils GK for SNAP GMAT Grammar Holiday how to use essential oils IIFT GK list of essential oils MBA MBA in niche sector MBA opportunities Media money Netweaver Niche MBA degree parner Parnerkar Parnerkar Maharaj Poornawad prepare for SNAP GK Recession Recession and MBA SAP SAP ABAP SAP ABAP Simplified SAP EP SNAP GK TIME VARecent Posts
Most Commented
About Ameya