Good post on using BAPI'S at SDN
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/18187
Saturday, March 13, 2010
Saturday, February 6, 2010
Post after a long time - resolve is to be regular
Passing Thought:
To accelerate your career, you need to demonstrate that you are part of an elite group that has the talent and experience required to optimize SAP software.
Established Thought:
"The focus is on growth, margin and innovation. It has to be kept in mind that all three have to be dealt [with] simultaneously"
And the established thought is from SAP's co-founder and chairman Hasso Plattner
SAP Hits Reset Button With CEO Change
Is there a relation between the Passing thought and the one that is Established?
Here it is - Expect that SAP will keep throwing new hats in the ring, those who are trying to be the SAP Guru have to do two things without fail:
ONE - Make sure you know inside out about the project that you are working on or ever worked upon.
TWO - The new technologies in SAP are exciting, keeping oneself updated with them is a good thing but getting overwhelmed by them will do no good, and quiet a few of the ideas that SAP proposes fizzes out when the response is not great from the target audience.
THREE - Keep looking for ways to learn on your own, it gives unique perspective - it requires going through SDN, SAP Help Documents, Course Materials, Practicing on Sandbox and interacting over the highly informative forums. Try to keep everything focused else its easy to lose the days without gaining a sharp edge.
e.g.: You never know a small upgrade or maintenance you did on integration of Flex PLM with SAP could make you one rare ABAP guy hard to find.
Once the project is finished and you are well into another heated project, connecting the dots is so much tougher, not denying the post-closure analysis or the learnings during enhancement, but the best learnings are in chaos, when there is no time to document, the skills to use are learnt on a fly. Learning from the same task done by two different person could be fairly different based on the attention level and tools used to keep a record of learnings.
Make a list of things you completed while in your last project, go through the blue Print as a checklist and see if you have covered all or most of the things. Understanding the bigger picture and the overview of technical solutions for the problems faced.
To accelerate your career, you need to demonstrate that you are part of an elite group that has the talent and experience required to optimize SAP software.
Established Thought:
"The focus is on growth, margin and innovation. It has to be kept in mind that all three have to be dealt [with] simultaneously"
And the established thought is from SAP's co-founder and chairman Hasso Plattner
SAP Hits Reset Button With CEO Change
Is there a relation between the Passing thought and the one that is Established?
Here it is - Expect that SAP will keep throwing new hats in the ring, those who are trying to be the SAP Guru have to do two things without fail:
ONE - Make sure you know inside out about the project that you are working on or ever worked upon.
TWO - The new technologies in SAP are exciting, keeping oneself updated with them is a good thing but getting overwhelmed by them will do no good, and quiet a few of the ideas that SAP proposes fizzes out when the response is not great from the target audience.
THREE - Keep looking for ways to learn on your own, it gives unique perspective - it requires going through SDN, SAP Help Documents, Course Materials, Practicing on Sandbox and interacting over the highly informative forums. Try to keep everything focused else its easy to lose the days without gaining a sharp edge.
e.g.: You never know a small upgrade or maintenance you did on integration of Flex PLM with SAP could make you one rare ABAP guy hard to find.
Once the project is finished and you are well into another heated project, connecting the dots is so much tougher, not denying the post-closure analysis or the learnings during enhancement, but the best learnings are in chaos, when there is no time to document, the skills to use are learnt on a fly. Learning from the same task done by two different person could be fairly different based on the attention level and tools used to keep a record of learnings.
Make a list of things you completed while in your last project, go through the blue Print as a checklist and see if you have covered all or most of the things. Understanding the bigger picture and the overview of technical solutions for the problems faced.
Tuesday, March 31, 2009
Tuesday, March 24, 2009
USER EXITS
User exits :
1. Introduction
2. How to find user exits
3. Using Project management of SAP Enhancements
1. Introduction:
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
EXIT_<3 digit suffix>
The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION <3 digit suffix>
Example:
The program for transaction VA01 Create salesorder is SAPMV45A
If you search for CALL CUSTOMER-FUNCTION i program
SAPMV45A you will find ( Among other user exits):
CALL CUSTOMER-FUNCTION '003'
exporting
xvbak = vbak
xvbuk = vbuk
xkomk = tkomk
importing
lvf_subrc = lvf_subrc
tables
xvbfa = xvbfa
xvbap = xvbap
xvbup = xvbup.
The exit calls function module EXIT_SAPMV45A_003
2. How to find user exits?
Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT
If you know the Exit name, go to transaction CMOD.
Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.
You will now come to a screen that shows the function module exits for the exit.
3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .
- Go to transaction CMOD
- Create a project called ZVA01
- Choose the Enhancement assign radio button and press the Change button
In the first column enter V45A0002 Predefine sold-to party in sales document.
Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed
Press Save
Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.
Now the function module is displayed. Double click on include ZXVVAU04 in the function module
Insert the following code into the include: E_KUNNR = '2155'.
Activate the include program. Go back to CMOD and activate the project.
Goto transaction VA01 and craete a salesorder.
Note that Sold-to-party now automatically is "2155"
*****************************************************
What is User Exits and Customer Exits?
Difference between user exits & customer exits:
User exit - A user exit is a three character code that instructs the system to access a program during system processing.
SXX: S is for standard exits that are delivered by SAP. XX represents the 2-digit exit number.
UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number
Customer exit - The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks. *-- Mani
The following document is about exits in SAP :-
The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.
SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
Types of Exits
There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.
Menu Exits
Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.
SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.
Screen Exits
Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.
Function Module Exits
Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.
When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.
Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.
These calls have the following syntax:
CALL CUSTOMER-FUNCTION ‘001’.
Field Exits
Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.
The field exit concept lets you create a special function module that contains this logic.
You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.
In 4.6c, you can use "RSMODPRF" program to create field exits.
An example of a user exits :-
MODULE user_exit_0001 INPUT
CASE okcode.
WHEN 'BACK OR EXIT'.
CASE sy-dynnr.
WHEN '100'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN '200'.
******************************************************************************
**** Note that you can write any code that satisfy your needs. ****
**** But in this case, this was wrote as a sample code for reference sake. ****
**** And you can test it. ****
******************************************************************************
SET SCREEN 100.
LEAVE SCREEN.
ENDCASE.
ENDCASE.
1. Introduction
2. How to find user exits
3. Using Project management of SAP Enhancements
1. Introduction:
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
EXIT_
The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION <3 digit suffix>
Example:
The program for transaction VA01 Create salesorder is SAPMV45A
If you search for CALL CUSTOMER-FUNCTION i program
SAPMV45A you will find ( Among other user exits):
CALL CUSTOMER-FUNCTION '003'
exporting
xvbak = vbak
xvbuk = vbuk
xkomk = tkomk
importing
lvf_subrc = lvf_subrc
tables
xvbfa = xvbfa
xvbap = xvbap
xvbup = xvbup.
The exit calls function module EXIT_SAPMV45A_003
2. How to find user exits?
Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT
If you know the Exit name, go to transaction CMOD.
Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.
You will now come to a screen that shows the function module exits for the exit.
3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .
- Go to transaction CMOD
- Create a project called ZVA01
- Choose the Enhancement assign radio button and press the Change button
In the first column enter V45A0002 Predefine sold-to party in sales document.
Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed
Press Save
Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.
Now the function module is displayed. Double click on include ZXVVAU04 in the function module
Insert the following code into the include: E_KUNNR = '2155'.
Activate the include program. Go back to CMOD and activate the project.
Goto transaction VA01 and craete a salesorder.
Note that Sold-to-party now automatically is "2155"
*****************************************************
What is User Exits and Customer Exits?
Difference between user exits & customer exits:
User exit - A user exit is a three character code that instructs the system to access a program during system processing.
SXX: S is for standard exits that are delivered by SAP. XX represents the 2-digit exit number.
UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number
Customer exit - The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks. *-- Mani
The following document is about exits in SAP :-
The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.
SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
Types of Exits
There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.
Menu Exits
Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.
SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.
Screen Exits
Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.
Function Module Exits
Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.
When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.
Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.
These calls have the following syntax:
CALL CUSTOMER-FUNCTION ‘001’.
Field Exits
Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.
The field exit concept lets you create a special function module that contains this logic.
You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.
In 4.6c, you can use "RSMODPRF" program to create field exits.
An example of a user exits :-
MODULE user_exit_0001 INPUT
CASE okcode.
WHEN 'BACK OR EXIT'.
CASE sy-dynnr.
WHEN '100'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN '200'.
******************************************************************************
**** Note that you can write any code that satisfy your needs. ****
**** But in this case, this was wrote as a sample code for reference sake. ****
**** And you can test it. ****
******************************************************************************
SET SCREEN 100.
LEAVE SCREEN.
ENDCASE.
ENDCASE.
Monday, February 16, 2009
Example of Function Module in Subroutine
REPORT ZTEST_11.
parameters :name(20) type c.
data:begin of itab occurs 0 ,
value(20),
end of itab,
choise like sy-tabix.
at selection-screen on value-request for name.
perform f4 changing name.
*&---------------------------------------------------------------------*
*& Form F4
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_NAME text
*----------------------------------------------------------------------*
FORM F4 CHANGING P_NAME.
itab-value = 'sap'.
append itab.
itab-value = 'sap1'.
append itab.
itab-value = 'sap2'.
append itab.
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL = 40
ENDPOS_ROW = 12
STARTPOS_COL = 20
STARTPOS_ROW = 5
TITLETEXT = 'Select an ID'
IMPORTING
CHOISE = choise
TABLES
VALUETAB = itab
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2.
CHECK choise > 0.
clear screen.
READ TABLE itab INDEX choise.
name = itab-value.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F4
parameters :name(20) type c.
data:begin of itab occurs 0 ,
value(20),
end of itab,
choise like sy-tabix.
at selection-screen on value-request for name.
perform f4 changing name.
*&---------------------------------------------------------------------*
*& Form F4
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_NAME text
*----------------------------------------------------------------------*
FORM F4 CHANGING P_NAME.
itab-value = 'sap'.
append itab.
itab-value = 'sap1'.
append itab.
itab-value = 'sap2'.
append itab.
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL = 40
ENDPOS_ROW = 12
STARTPOS_COL = 20
STARTPOS_ROW = 5
TITLETEXT = 'Select an ID'
IMPORTING
CHOISE = choise
TABLES
VALUETAB = itab
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2.
CHECK choise > 0.
clear screen.
READ TABLE itab INDEX choise.
name = itab-value.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F4
Sunday, February 1, 2009
SAP BW
My new found interest is BW, trying to find more details about BW.
I find: 'Getting Started with SAP-BW' pretty good point to start!
I find: 'Getting Started with SAP-BW' pretty good point to start!
Thursday, January 15, 2009
Enhancements
Enhancements:
It allows us to add our own functionality to SAP’s standard business application without having to modify the original applications.
SAP creates enhancements for specific programs, screens and menus within standard R/3 applications. These enhancements do not contain any functionality.
Instead, the enhancements act as hooks where we can hang our own add-on functionality onto these hooks.
Advantages with Enhancements:
• They do not affect standard SAP source code.
• They do not affect software updates
NOTE: Customer enhancements may not be available for all programs and screens found in the SAP system. You can only use customer exits if they already exist in SAP System.
Enhancement Approaches:
Procedural
- Using Function Modules
- Are called Customer Exits
Object Oriented
- Using Classes and Methods
- Are called BADIs
Procedural, we have two types.
1 – Using Subroutines.
2 – Using Function Modules.
Customer Exits
Types of Exits
Entire SAP Product can be divided in to 3 parts:
- Screens (Front End)
- Programs
- Tables (Back End)
We use:
Screen and Menu Exits to enhance the Front End
Function Exits to enhance the programs
APPEND STRUCTURES/CI Includes to enhance Back End
Menu Exits add items to pull down menus in standard SAP applications. The menu items can be used to call up own screens or to trigger entire add-on applications.
These can be created by defining special menu items in Menu Painter.
Screen Exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer sub-screen from the standard screen’s flow logic.
Function Module Exits add functionality to R/3 applications. They play role in both menu and screen exits.
When new items are added to standard menu, function module exit is used to define the actions that should take place once menu is activated.
Function module ecits also control the data flow between standard programs and screen exit fields.
Note: We can take the advantage of the exits only when SAP provides it in the Standard Transactions.
To locate the exits for any transaction:
Ther are many way for locating the exits, we go through the commonly used ones:
1. Goto SE93 – find the program for the transaction – goto program and find the Package / Development Class bu going to –
GOTO – ATTRIBUTES.
Now, goto SMOD transaction, find out the enhancement for package / development class by pressing F4 on enhancement.
Enter the name of Development Class / Package of the standard program.
Enhancements will be displayed. Select individual enhancement (in case more than one enhancement are there).
Enter enhancement name, select component option and click on display.
Observe the function module exits.
2. Use a piece of code – redundantly available online to pass the transaction and it returns all the enhancements used in the transaction.
3. Open the program in display mode and find the string CALL_CUSTOMER
Double click on CALL CUSTOMER function module exit.
Link to Short Tutorial on User Exits
It allows us to add our own functionality to SAP’s standard business application without having to modify the original applications.
SAP creates enhancements for specific programs, screens and menus within standard R/3 applications. These enhancements do not contain any functionality.
Instead, the enhancements act as hooks where we can hang our own add-on functionality onto these hooks.
Advantages with Enhancements:
• They do not affect standard SAP source code.
• They do not affect software updates
NOTE: Customer enhancements may not be available for all programs and screens found in the SAP system. You can only use customer exits if they already exist in SAP System.
Enhancement Approaches:
Procedural
- Using Function Modules
- Are called Customer Exits
Object Oriented
- Using Classes and Methods
- Are called BADIs
Procedural, we have two types.
1 – Using Subroutines.
2 – Using Function Modules.
Customer Exits
Types of Exits
Entire SAP Product can be divided in to 3 parts:
- Screens (Front End)
- Programs
- Tables (Back End)
We use:
Screen and Menu Exits to enhance the Front End
Function Exits to enhance the programs
APPEND STRUCTURES/CI Includes to enhance Back End
Menu Exits add items to pull down menus in standard SAP applications. The menu items can be used to call up own screens or to trigger entire add-on applications.
These can be created by defining special menu items in Menu Painter.
Screen Exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer sub-screen from the standard screen’s flow logic.
Function Module Exits add functionality to R/3 applications. They play role in both menu and screen exits.
When new items are added to standard menu, function module exit is used to define the actions that should take place once menu is activated.
Function module ecits also control the data flow between standard programs and screen exit fields.
Note: We can take the advantage of the exits only when SAP provides it in the Standard Transactions.
To locate the exits for any transaction:
Ther are many way for locating the exits, we go through the commonly used ones:
1. Goto SE93 – find the program for the transaction – goto program and find the Package / Development Class bu going to –
GOTO – ATTRIBUTES.
Now, goto SMOD transaction, find out the enhancement for package / development class by pressing F4 on enhancement.
Enter the name of Development Class / Package of the standard program.
Enhancements will be displayed. Select individual enhancement (in case more than one enhancement are there).
Enter enhancement name, select component option and click on display.
Observe the function module exits.
2. Use a piece of code – redundantly available online to pass the transaction and it returns all the enhancements used in the transaction.
3. Open the program in display mode and find the string CALL_CUSTOMER
Double click on CALL CUSTOMER function module exit.
Link to Short Tutorial on User Exits
Subscribe to:
Posts (Atom)