Skip to Content

Quite often we come across instances where we require custom fields on the face of quotations, orders, etc. To achieve this, SAP has provided an Additional tab named Additional Data tab B at header and item level in VAxx transactions. However, over a period of time, these additional tabs get cluttered with many custom fields, especially in a matured project. Now if the business demands more custom fields on quotations, orders on a new tab altogether, what is the solution?


Yes, you’re right! We require more tabs; preferably next to Additional Data tab B.


How do we go about achieving this functionality?


Well, we first need to add custom fields to VBAK table using APPEND STRUCTURE. It’s assumed we all know it already.

Now, if you’re using a system with Enhancement Pack 6 installed, you’d be delighted to know SAP has provided a BAdI named BADI_SLS_HEAD_SCR_CUS/BADI_SLS_ITEM_SCR_CUS. You can find this in SPRO

/wp-content/uploads/2014/09/spro_551067.jpg

All you need to do is just implement this BAdI. Use the methods ACTIVATE_TAB_PAGE to populate name of the Tab, custom program name and the dynpro number. Next, use TRANSFER_DATA_TO_SUBSCREEN and TRANSFER_DATA_FROM_SUBSCREEN methods for passing the data to and fro from screen to workarea. More info here. And Voila! You can see the custom tab added next to Additional Data Tab B.

HOWSOEVER! For a few unfortunate souls like me who come to know their SAP system is not yet on Enh Pack 6, adding a new tab to VAxx becomes a challenge because the aforementioned BAdIs are not available in the older systems.

So, what needs to be done?

Well, I’m sure most of you have heard of this transaction named VFBS.

Yes, we’re now going to add a new tab to sales transactions in SAP using this very transaction!

Step1: Execute VFBS, enter program name as SAPMV45A

/wp-content/uploads/2014/09/step1_551068.jpg

Step2: Select Tab Control and click Change button and add below records for header and item tabs

  • Program Name: SAPMV45A
  • Screen Group: K0 (Screen Group for Header) and in case of item, the screen grp is P0
  • Number: 131 or the number immediately after Additional Data Tab B
  • Funct. Code: Any custom function code (eg. ZCM)
  • Description: Any meaningful description you want on the tab

/wp-content/uploads/2014/09/step2_551096.jpg

  Save and come back to the main screen

Step3: Enter program name as SAPMV45B, select the first radio button Function Codes and click Change

/wp-content/uploads/2014/09/step3_551097.jpg

Create new entries as below

/wp-content/uploads/2014/09/step3a_551100.jpg

TTyp – A, H and V are Create/Change/Display modes respectively

FCode – ZCM and ZCM2 are function codes for Header and Item tabs

Save the entries and back on the main screen of VFBS


Step4: Select the second option – Paths between process locations

/wp-content/uploads/2014/09/step4_551101.jpg

The idea behind creating entries in this step is to simply copy the standard SAP data already maintained for Additional Data Tab B

The function code for Additional Data Tab B on Header Level is KZKU and PZKU is for item as shown below in the screenshot taken from step 3

/wp-content/uploads/2014/09/step4a_551102.jpg

/wp-content/uploads/2014/09/step4b_551103.jpg

Now find the entries maintained for KZKU and PZKU function codes.

/wp-content/uploads/2014/09/step4c_551104.jpg

/wp-content/uploads/2014/09/step4d_551105.jpg

We’re going to clone these entries as is and change the FCcode and Subsequent Panel to ZCM (Header) and ZCM2 (Item)

/wp-content/uploads/2014/09/step4e_551106.jpg

Step5: Select the third radio button on the main screen and click on the Change button

/wp-content/uploads/2014/09/step5_551107.jpg

Now find for panel KZKU – Header

/wp-content/uploads/2014/09/step5a_551108.jpg

Clone it and rename Panel to ZCM. Change the Location description to something meaningful

/wp-content/uploads/2014/09/step5b_551109.jpg

K0 as explained in step # 2, is the header group. Screen # 4002 is the dynpro number for Header tab.

Below screenshot taken using System->Status in VA22 on Additional Data Tab B

/wp-content/uploads/2014/09/step5c_551110.jpg

Detailed view of the record created in this step is as shown below

/wp-content/uploads/2014/09/step5d_551111.jpg

I’ve kept Screen module 2 as 8309. This can be changed to screen # 8310 too. In that case, we’d simply need to add a line of code on the flow logic of screen # 4312 below this line.

/wp-content/uploads/2014/09/step5e_551112.jpg

CALL SUBSCREEN 8310 INCLUDING ‘SAPMV45A’ ‘8310’.

Also, we need to add a subscreen of the same name in the screen Layout

Below is the screenshot of Item details. Again, in this case, we can change Screen Module2 to 8460

/wp-content/uploads/2014/09/step5f_551113.jpg

Now execute any VAxx transactions like VA02, VA22, etc, you’ll get to see the newly added tab.

/wp-content/uploads/2014/09/result_551117.jpg

To restrict visiblity of this tab to only a particular transaction, below is the code which needs to be added using an Enhancement Implementation in INCLUDE MV45AF0C_CUA_SETZEN – FORM CUA_SETZEN

/wp-content/uploads/2014/09/code_551118.jpg

Hope you find this useful!

To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

  1. Jelena Perfiljeva

    Thanks for sharing! We are upgrading one system right now, so BADIs will come in handy for sure. Finally some progress comes to the VAxx transactions. Now we never have to switch to HANA! 😀

    (0) 
  2. Simone Milesi

    Thanks for this!

    I’m adding a bunch of custom fields on my SO header and without this i have to loose an huge amount of time merging them in existing screen.

    (0) 
      1. Aasim Khan Post author

        Simone,

        Are you able to see the Business Addins in the SPRO path? I’m pretty sure these BAdIs are made available to all the systems with Enh Pack 6 and above.

        (0) 
  3. Suren Anakala

    hi Aasim Khan,

    To locate the tab at Header/item additional tabs, Badis BADI_SLS_ITEM_SCR_CUS / BADI_SLS_HEAD_SCR_CUS to be used as you stated, but could you please let me know to position the tab in first screen itself, i.e. screen where you can see ‘Item overview’ tab, there you might be knowing the tab ‘Reason for rejection’.

    User wants the new tab to place very next to ‘Reason for rejection’ tab.

    Actually new fields to add should be at line item level, hence they don’t want to go each and every item to see those fields, instead they want to see like an ‘item overview’ tab to see the fields for al the items in single tab.

    Hope you understand the requirement. And nowhere i found the BADIs to support and for sure, access key is not the solution.

    Please do needful and provide inputs if any, Thanks.

    Regards,

    Suren.

    (0) 
    1. Aasim Khan Post author

      Suren,

      You can use the above technique and check the Tab Control option in VFBS txn with SAPMV45A as the program name. You’ll see screen group for Item Overview, Reason for rejection, etc along with its sequence Number. I’d suggest you do changes in the Number column in your sandbox server to see how the screen behaves.

      (0) 

Leave a Reply