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

sample scenarios

Former Member
0 Likes
535

Hi,

I want to know if any one who worked on user exits and badis can share their experiences so that i can get some expereince as i have not worked on it.

Plz dont send tutorials as i already have them.

Need More inputs

points will be for rewarded

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
500

Hi,

See a the real scenario..,

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

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.

For 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"

Regards,

Renjith Michael.

Hi,

I want to know if any one who worked on user exits and badis can share their experiences so that i can get some expereince as i have not worked on it.

Plz dont send tutorials as i already have them.

Need More inputs

points will be for rewarded

Regards

3 REPLIES 3
Read only

Former Member
0 Likes
501

Hi,

See a the real scenario..,

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

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.

For 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"

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
500

Hi,

There are two ways of finding BADIs for a specific application or Transaction.

First is to go to SPRO and navigate to the business process for which you want to find the BADI and you will have a BADI option there which contains the BADI names which are present for that particular application.

Secondly,go to T-code SE24,type in the object name as cl_exithandler.Double click on the get Instance method and put a breakpoint on the line "CALL METHOD cl_exithandler=>get_class_name_by_interface".

Now run the T-code for which you want to find the BADI,the debugger will stop at the above line,double click on the instance field and there you have the first BADI for it.

Similarly,keep on pressing F8 and keep getting the BADI names till the end.

The T-codes for the definitiojn of BADIs is SE18 and for creating their implementations is SE19.

Hope it clears your doubt.

Read only

Former Member
0 Likes
500

Hi Padma,

These aer the things to AVOID in userexit/badi's.....

you should never issue COMMIT from within the BADI, because the calling transaction will do the COMMIT at thge right time after completion of all critical updates.

Note: Your COMMIT will commit everything to the database, not only your database updates.

If you do update/insert, this takes effect inside the LUW immediately but can not be ssen from outside before the transaction commits all pending database requests.

If you can't see your data in the database after the transaction is completed successfully, you either never updated the database or you tried to modify a SAP standard table which is later accessed (and modified) by the tranaction.

If you want to modify SAP standard data, find a BADI with internal tables in the interface. Modify the internal tables and let the transaction write them to the database. Update/Insert should be done only for Z-tables.

Thankyou,

Regards.