Application Development 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: 

hey all!

Former Member
0 Kudos
83

Suppose i want to add some extra functionality to any standard SAP screen fields say push button...

suppose in va01 when i click the execute button it will not only create the sales order but also trigger an IDOC.....How will i do it?

3 REPLIES 3

former_member223537
Active Contributor
0 Kudos
45

Hi,

You can build the necessary logic in User EXit of VA01.

User Exits are provided by SAP to add such functionality.

Best regards,

Prashant

0 Kudos
45

In Tcode VA01 in the below user exits provide by SAP:

-


  • U S E R - E X I T S

  • U S E R - E X I T S

  • U S E R - E X I T S

*----


  • INCLUDE MV45ATZZ. " Data definitions in MV45ATOP

INCLUDE MV45AOZZ. " User-modules PBO

INCLUDE MV45AIZZ. " User-modules PAI

INCLUDE MV45AFZA. " User-forms < 3.0

INCLUDE MV45AFZB. " User-forms

INCLUDE MV45AFZC. " User-forms < 3.0D

INCLUDE MV45AFZD. " User-forms 3.0E

INCLUDE MV45AFZF. " User-forms 3.0F

  • include mv45afzg. " User-forms 3.1G

include mv45afzh. " User-forms 4.6B

INCLUDE MV45AFZZ. " User-forms

INCLUDE MV45AFZ4. " User-forms 4.0

You can build ur logic in above includes.

Please give me reward points

Thanks

Murali Poli

Former Member
0 Kudos
45

Hi

if you want to do any changes or adding extra functinality

1st you need to search for the exits available for that program

User exit means we have to provide the additional functionality to sap functionality by developing field exits,screen exits,menu exits.

customer-exits: some function exits provided by sap for customers to add some additional functionality to existing sap functionality

locate customer Exit within program

For this example I am using transaction MIRO Step 1Execute transaction MR1M and display program name by selecting 'Status...' from the 'System' menu Step 2Double click on the program (screen) name to enter source code, or access code via SE80.Step 3Search source code for the 'Customer-Function' string using the find button. Remember to select 'In main program'. Step 4A list of search results should be displayed indicating where all function exits can be found. You can now double click on each of them to go to its position in the source code. This also allows for the insertion of breakpoints so that you can test if the exits are called in the appropriate place. Get Function Module linked to Function Exit

Get actual function module for Function Exit

Once you have found the Function Exit within the source code (Find Function Exit) you need to access the actual function module it executes. This is done using the following steps: Step 1Locate desired 'Call Customer-function' statement within source code. Step 2If code is not within main program (module pool) e.g. SAP* then you will need to find this out by selecting 'Main Program' from the 'GOTO' menu. The Main program for transaction MR1M is SAPLMR1M.Step 3The actual function module name can now be calculated based on the information retrieved,it is defined by the following format:EXIT_ActivateThis will now be active for all instances of this data element, but you can assign specific program and screen combinations by pressing the ‘Assign prog./screen’ button. You can also change the code you entered in the field exit function module by pressing the ‘Edit FM’ button.Access values outside the customer exit

When implementing a customer exit (i.e. field, user etc) have you ever wanted to be able to read additional field values available in the main SAP program but not available in your exit. Now with the use of field-symbols you can have access to any field available in the main SAP program. The code below demonstrates how this is done within a field exit on BSTNR which can be tested using transactionME21. Information on creating field exits can be found here.

FUNCTION field_exit_bstnr.*"----


""Local interface:" IMPORTING" REFERENCE(INPUT)" EXPORTING" REFERENCE(OUTPUT)*"----

-


  • create field symbol FIELD-SYMBOLS: <status>.* Assign value of variable from calling prog to field symbol ASSIGN ('(SAPMM06E)RM06E-BSART') TO <status>.* Display value retrieved in message* Note: Messages of type i and w are not allowed IF sy-subrc = 0. MESSAGE e003(zr) WITH <status> 'kkk'. ENDIF.ENDFUNCTION.

Adding fields to standard Infotype

SAP allows you to add additional fields to any standard Infotype. Step 1Using transaction PM01 chose the 'Enhance Infotype tab' and press the create 'All' button. Step 2The following screen will appear allowing you to enter the new fields you wish to add to the Infotype. i.e. ZZSPINST and ZZBACS Step 3Once saved and activated the new fields will appear in the Infotype screen and database table (See below)Infotype screen(PA20) Infotype database table

Modifying Standard SAP ‘System’ and ‘help’ Menu options · Use Menu Painter (Transaction SE41), enter program MENUSYST, status MEN and click change. · Modify SAP Standard by adding function codes: · For each of the function codes click on Extras and choose ‘Active functions in multiple statuses’.

Implementing Business Add-Ins (BADI)

The use of object orientated code within SAP has lead to new method of enhancing standard SAP code called Business Add-Ins or BADI's for short. Although the implementation concept is based on classes, methods and inheritance you do not really have to understand this fully to implement a BADI. Simply think of methods as a function module with the same import and export parameters and follow the simple instructions below.

Steps:1. Execute Business Add-In(BADI) transaction SE18

2. Enter BADI name i.e. HRPBSGB_HESA_NISR and press the display button

3. Select menu option Implementation->Create

4. Give implementation a name such as Z_HRPBSGB_HESA_NISR

5. You can now make any changes you require to the BADI within this implementation, for example choose the Interface tab

6. Double click on the method you want to change, you can now enter any code you require.

7. Please note to find out what import and export parameters a method has got return the original BADI definition (i.e. HRPBSGB_HESA_NISR) and double click on the method name for example within HRPBSGB_HESA_NISR contract is a method

8. When changes have been made activate the implementation

Reward pts if answered:)