Monday 31 March 2014

Adding extra tabs in standard transactions for sales and contracts without access key

NTRODUCTION:

This post will explain in detail about adding an additional Tab to standard transactions for sales order (VA01, VA02, and VA03)contract documents (VA41, VA42, and VA43) and other related transactions of the program SAPMV45A.

HISTORY:

-->When I had this requirement of adding an additional tab, I started with my research on this across SCN and other SAP related sites. Irrespective of my long research I could not find any solution for this requirement without the need of ACCESS KEY.

-->However there are solution for this requirement which requires ACCESS KEY.  There are two additional tabsADDITIONAL TAB A and ADDITIONAL TAB B which SAP has provided to add customer specific fields. The related screens for modifying these tabs are 8459, 8309.

FEW IMPORTANT POINTS ABOUT THESE TABS:

è The Additional TAB A and B are designed by SAP before the advent of BADI based plug in screens.

è The screens 8309, 8549 are never touched during upgrades, however taking access key could mean that the objects we are changing should be registered for SCCR and special care should be taken during upgrades to protect the change as they fall in SAP naming spaces.

è SAPMV45A / 8459 or 8309 even if they are in SAP naming space they are for customer modifications and SAP won’t overwrite them during upgrades.

è There are few ABAPers who are in a wrong assumption that SAP didn’t provide any BADI for this screen modification since many customers have already satisfied their need with the TABS A and B which is wrong.

è SAP has provided a BADI to add additional TABS up to 5(as far as my knowledge) to accommodate any user specific fields which depends on the later requirements of the customer.

STEP BY STEP IMPLEMENTATION OF THE BADI:

In this blog post I will explain in detail steps on how to implement the BADI.

STEP 1:

Go to transaction SE18 and give the badi name as BADI_SLS_ITEM_SCR_CUS. Click Display.

1.PNG
TEP 2:

You will be lead into this page where you can see several BADI definitions, you can see the purpose of each BADIs by reading its description.

2.PNG

STEP 3:

Now our intention here is to add additional tabs only at item level so we select the BADI accordingly, however there are different BADI for different purpose.
Now right click on the badi BADI_SLS_ITEM_SCR_CUS as below and select create implementation.
3.PNG 

STEP 4:

Click on the paper icon as marked below in red to create a new implementation.
4.PNG


STEP 5:

Give a meaningful name for the implementation as shown below.
5.PNG


STEP 6:

Give a meaningful name for the enhancement implementation and description as shown below and click the TICK icon as shown below marked in red.
6.PNG

STEP 7:

Now you will be popped up with another window as below.
7.PNG

STEP 8:

Give a meaningful name for the implementation as shown below in the boxes below.
8.PNG


STEP 9:

Give a meaningful name for the implementation as shown below in the boxes below. Please note that all the details that you have filled earlier is for enhancement and now it is for BADI.
9.PNG

STEP 10:

Give a meaningful name for the implementation as shown below in the boxes below. Class name should be same as given below, this is the class method where you will write the code.
10.PNG

STEP 11:

Activate now, after activation you will be displayed with a screen as shown below which indicates that the enhancement and BADI implementation is complete.
11.PNG

STEP 12:

Now Go out and come again into the transaction SE18 and you can see the below screen.
12.PNG


STEP 13:

Click on the enhancement implementation tab and you will see the implementation that you have created, double click on that.

13.PNG

STEP 14:

Now you will be able to see the window as below.
14.PNG

STEP 15:

Now you will be able to see the window as below. Double click on the class method.

15.PNG


STEP 16:

Now you will be able to see the window as below. Double click on the first method as shown below to code for adding the tab.

16.PNG

Now you will be able to see the screen as below, in the field caption give the ‘name of the tab’,
In the field program give the ‘module program name’, in the field dynpro give the ‘screen number’, give all the details in single quants.
Important points:
1)      Module Program: This program should contain the screen which will have the required fields and the respective logic for the fields.
2)      Screen Number: This should be screen which you want to get displayed under the Tab that you have defined.
3)      Please note that the screen that you create here must be a sub screen and not main screen failing which it will lead to a runtime error.
4)      Please note that in the if condition I have given as
                                                --> If sy-tcode cp ‘VA4*’.
Which means this tab will be there for all the item details in the contract transactions like va41, va42, va43. So you can code as per your requirement.

l1.PNG


Now after activating if you go to the required transaction you will be able to see the tab you have added as below. These fields are placed as per your requirement.

l2.PNG

No comments:

Post a Comment