Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Enhancements

Former Member
0 Likes
550

Hi,

Can anybody plz tell me the enhancements/ the user exit, for automatically assignment of external Batch Number in the transaction while creating any Production Order. I have checked with the sample program available, for finding the various Enhancements of this transaction. But what result i got, my problem is not resolved.

Plz help me out in this regard; If possible, can some body plz drop me a piece of very complex code for any relevant transaction to successfully apply an enhancements. So that i can refer some tips from that...

Thanking u in advanced

Sangram

Hi,

Can anybody plz tell me the enhancements/ the user exit, for automatically assignment of external Batch Number in the transaction while creating any Production Order. I have checked with the sample program available, for finding the various Enhancements of this transaction. But what result i got, my problem is not resolved.

Plz help me out in this regard; If possible, can some body plz drop me a piece of very complex code for any relevant transaction to successfully apply an enhancements. So that i can refer some tips from that...

Thanking u in advanced

Sangram

2 REPLIES 2
Read only

Former Member
0 Likes
501

Hi,

SAPLV1ZE - CFCs for external batch number assignment

Pls reward points.

Regards,

Ameet

Read only

0 Likes
501

Hi

1.<b><u> Customer exits:</u></b> Implemented as Function Modules within z includes. Anybody can change it and no access key is required.

2.<b><u> User Exit:</u></b> Implemented as subroutines within includes (any include except y or z includes). You need access for the specific include and then you can any subroutine (user exit) within that Include.

BADIs are the enhanced version of user exits where the same logic is implemented via classes and object (OOP)

Enchancement point is the latest once introduces with ECC6.0 . Not very sure about that but you can change it without any access key.

<i><b>Please go through the following link which will help you understand the exits in a much better way:</b></i>

http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec07a25db911d295ae0000e82de14a/content.htm

http://www.sap-img.com/abap/what-is-the-difference-between-smod-and-cmod.htm

http://sap.niraj.tripod.com/id21.html

http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm

http://www.sap-img.com/ab038.htm

<u><b>User Exits.</b></u>----


http://www.erpgenie.com/sap/abap/code/abap26.htm

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sapgenie.com/abap/code/abap26.htm

http://www.sap-img.com/abap/what-is-user-exits.htm

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

http://www.easymarketplace.de/userexit.php

http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

http://www.sappoint.com/abap/userexit.pdfUser-Exit

<u><b>

customer exits</u></b>

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662...

<u><b>Menu Exit.</b></u>

http://www.sappoint.com/abap/spmp.pdf

http://www.sappoint.com/abap/userexit.pdf

http://www.sapdevelopment.co.uk/enhance/mod_sapmenu.htm

http://www.sapdevelopment.co.uk/enhance/enhancehome.htm

***************************************************************************

1. Previously there were only user-exits.

2. Then came the concept of customer-exits.

3. user exits were nothing but subroutines

FORM/PERFORM

called from standard programs.

4. The FORM defintion was placed inside

an empty include file.

5. So It was called EVERYTIME.

and we need to MODIFY/REPAIR the

standard include .

6. Then it came with concept of customer-exit

7. It consists of calling a FUNCTION MODULE,

which is called only if

the user-exit is ACTIVATED (other wise not called)

In this case, the code in put inside

a pre-defined Z include.

8. Functionality of both is same, howerver

we can note the following important differences

a) Customer exit is called only if activated.

(hence, it does not waste resources)

b) in customer exit, REPAIR does not happen

to the standard include.

Exits are basically the hooks whcih SAP has provided to add your own code.

<b>Screen Exit</b> is nothing but enhancing the screen like creating some more fields, subscreen and so on.

<b>Check this method to create a screen exit</b>

1. Go to the screen>System>Status-->Program (Double

click this program. It will take you to the program.

2. Now, Goto-->Object Directory Entry.

3. Make a note the package name.

4. Now run the transactions SMOD, press F4 and enter the

above noted package, press enter.

5. It will display list of Exits.

6. Now go back to the initial screen SMOD.

7. Specify the exit name here and select the radio button

Components.

8. It will display four group boxes one for FM, second

for Fcodes, thrid for Screen areas and last for

includes.

9. Goto transaction CMOD, create a new project, and

click the button "Enhancement assignments" and

specify your enhancements that you got in SMOD.

10. Now bouble clikc the enhancement, it will take you to editor with some includes starting with Z, double clikc the include you want to edit and proceed.

<b>Have a look at below link It will definately help you to undestand the same.</b>

http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

<u><b>User exits :</b></u>

1. Introduction

2. How to find user exits

3. Using Project management of SAP Enhancements

<b>1. Introduction:</b>

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_<program name><3 digit suffix>

The call to a functionmodule exit is implemented as:

CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

<b><i>Example:</i></b>

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

<b>find user exits</b>

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"

<u><b>Check this links</b></u>

http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm

http://www.sap-img.com/ab038.htm

http://www.easymarketplace.de/userexit.php

http://www.sap-img.com/abap/what-is-user-exits.htm

http://www.sap-basis-abap.com/sapab013.htm

<b>Screen exits</b> allow you to add your own fields to specified screens in standard R/3 transactions. To take advantage of customer-specific subscreens, you first need to create projects as described in the section Creating an add-on project. Then, you must include the SAP enhancement that contains the screen exit you want to use in your project. From the main screen of the Project management transaction, proceed as follows:

Select Enhancement components and choose Change.

The system lists all customer exits contained in the enhancements included in your project.

Place the cursor on the screen exit you want to create your own subscreen for.

Choose Edit component.

The system prompts you to enter a development class for your subscreen. Use the development class that contains all of the objects created for this specific enhancement project. The system then transfers you to the Screen Painter.

Create your subscreen using the Screen Painter.

Add modules to the screen flow logic as needed.

Enter the name of the module in the flow logic editor, then double-click on the module name and the system automatically creates the module in the corresponding function module program.

Generate your screen and choose Back (the green arrow) to return to the Project management transaction.

Once you activate your enhancement project, the fields defined in your subscreen will appear in the standard R/3 transaction.

<u><b>Using Predefined Screen Data</b></u>

When you use a screen exit, you need to be aware of how your subscreen and the fields it contains relate to the data on the standard R/3 screen. The global data defined in the standard SAP program is not known to the program that controls your customer subscreen. In the same way, the fields you use in your subscreen are not known to the SAP program in which they appear. To compensate for this problem, SAP creates special flow logic modules when defining screen exits.

SAP creates a special Process Before Output module (PBO module) with a function module exit. You can use this function module exit to transfer specific field values from the SAP program to your customer subscreen. SAP also includes a Process After Input (PAI) module that has a function module exit for transferring values back from your subscreen to the SAP program.

The function module exits in these PBO and PAI modules are only activated if you create actual modules for each exit. For more information on how to create customer-specific function modules, refer to the section Creating customer-specific function modules.

The import and export parameters for the PBO and PAI function module exits are predefined by SAP. As a result, you can only transfer values to and from your subscreen if they correspond to the parameters determined in the existing function module exit interface.

<b>

To Find a Screen Exit in a Given SAP Standard T-code. Check this code</b>

 TABLES: MODSAP, MODACT, TSTC.
 
PARAMETERS: INPUT1 LIKE TSTC-TCODE DEFAULT ' ',
            INPUT2 LIKE MODSAP-TYP DEFAULT ' '.
 
DATA: SEARCH1(6),
      SEARCH2(3),
      SEARCH3 LIKE MODSAP-MEMBER.
 
DATA : FIRST_ROW VALUE 'Y'.
 
CONCATENATE: '%' INPUT1 '%' INTO SEARCH1,
'%' INPUT2 INTO SEARCH2.
 
SELECT * FROM TSTC WHERE TCODE LIKE SEARCH1.
 
FIRST_ROW = 'Y'.
 
CHECK TSTC-PGMNA NE SPACE.
 
CONCATENATE '%' TSTC-PGMNA '%' INTO SEARCH3.
 
SELECT * FROM MODSAP WHERE TYP LIKE SEARCH2
AND MEMBER LIKE SEARCH3.
 
SELECT SINGLE * FROM MODACT WHERE MEMBER = MODSAP-NAME.
 
IF FIRST_ROW EQ 'Y'.
   WRITE: /0 TSTC-TCODE, 6 TSTC-PGMNA, 16 MODSAP-NAME, 32 MODSAP-TYP,
          45 MODSAP-MEMBER, 70 MODACT-NAME.
   FIRST_ROW = 'N'.
ELSE.
   WRITE: /16 MODSAP-NAME, 32 MODSAP-TYP, 45 MODSAP-MEMBER, 70 MODACT-NAME.  
ENDIF.
 
CLEAR : MODSAP, MODACT.
 
ENDSELECT.
 
IF SY-SUBRC NE 0.
   WRITE : /0 TSTC-TCODE, 6 TSTC-PGMNA, 30 'No exits found'. 
ENDIF.
 
CLEAR TSTC.
 
ENDSELECT.
 
END-OF-SELECTION.
 
CLEAR: SEARCH1, SEARCH2, SEARCH3.
 
* End

<u><b>Check this link</b></u>

<u><b>USEREXIT</b></u>

Userxits allow us to add our own functionality to SAP standard program

without modifying it . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The userexits are generally collected in includes and attached to the standard program by the SAP.

All Userexits start with the word USEREXIT_...

FORM USEREXIT_..

z..

ENDFORM.

The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary

customer code is inserted in the customer include starting with the z..

in the form routine.

e.g. USEREXIT_SAVE_DOCUMENT_PREPARE

Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions

instead they are using EXITs which come bundeled in enhancement packages . Neverthiless existing USEREXITS will be supported by SAP an all the newer versions of SAP.

<b><u>CUSTOMER EXITS</u></b>

There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.

These are different from USEREXIT in the way that they are implemented

in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits .

These start from the word EXIT_ followed by the program name and then followed by a three digit number.

e.g. EXIT_SAPMV45A_002

This exit is found in SD in enhancement V45A0002.

TYPES OF EXITS

1<i>)MENU EXITS

2)FUNCTION EXITS

3)TABLE EXITS

4)SCREEN EXITS

5)KEYWORD EXITS

6)FIELD EXITS</i>

We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD

selecting the enhancement e.g. V45A0002 and selecting the component

(one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.

An exit can be coded only once.

<u><b>Difference Between BADI and User Exits</b></u>

Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

<b>As with customer exits two different views are available:</b>

In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).

All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.

The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects.

Now u can get an easy knowledge to which you have to choose

<u><b>Check this link</b></u>

http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm

Reward all helpfull answers

Regards

Pavan