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: 

Add custom fields in Additional Data B tab (header) in VA01/02 using BADI

Former Member
0 Kudos

Hi experts,

My requirement is to add custom fields from custom table( z or y table) to Additional Data B tab (header) of VA01 transaction. How can we do it using BADI's? I do not want to use the access key and modify respective screens in SAPMV45A.

I'v seen many threads related to this issue but none of them were answered. Hope I'll get it with your help. Thanks in advance.

Edited by: srivarma on Dec 8, 2011 10:09 AM

Edited by: srivarma on Dec 8, 2011 10:15 AM

26 REPLIES 26

madhu_vadlamani
Active Contributor
0 Kudos

Hi Varma,

Welcome to SCN.

My requirement is to add custom fields from custom table( z or y table) to Additional Data B tab (header) of VA01 transaction

What is the business requirement.In general we will add either header table or item table of sales order and the same will create in tables.

Regards,

Madhu.

0 Kudos

Hi Madhu,

thanks for your quick reply. I want to collect several details like pan number and secondary address of the customer on additional data B tab and store them in a custom table when the order is saved. By looking at so many threads I'v found out that BADI's is the only way to do it if we are not willing to use the access key.

0 Kudos

Hi Varma,

Yes you can use the badi with out access key.Use set data and put data in that methods in the badi methods.I did one for invoice and delivery.Please check and post if need more information.

ACTIVATE_TAB_PAG

fcaption = 'Title'. "this is the title of your tab

fprogram = ''.:program name where you created the screen.

fdynpro = '0200'."screen no

TRANSFER_DATA_TO_SUBSCREEN

set PARAMETER ID 'ZCF' FIELD f_vbkd-ZCF.

TRANSFER_DATA_FROM_SUBSCREEN

get PARAMETER ID 'ZCF' FIELD f_vbkd-ZCF.

In the program where you created the screen use the same concept set and get data words.

Regards,

Madhu.

0 Kudos

hi madhu,

thank you for your detailed explanation with code snippets. I understood very well. I have the same question for you which I posed to Mr. Vishnu.

+ No matter how many ways I tried,I couldn't access the code in those (ACTIVATE_TAB_PAGE , TRANSFER_DATA_TO_SUBSCREEN or TRANSFER_DATA_FROM_SUBSCREEN) methods, they are in display mode. It needs an access key to swap it to change mode. How did you look into the code and modify these methods? I mean using which transaction se18, se19 , se24, se84??? It'll be extremely helpful to me if you exp me the procedure which i should follow+

In addition, I think this BAdi will add a new tab to VA01/02/03 header details, but does not modify the screen of existing Additional Data B tab.

thanks.

Edited by: srivarma on Dec 14, 2011 8:10 PM

0 Kudos

You need to create a Z implementation to the BADI using SE19. You will create a custom Z class for the implementation where the methods will be inherited that you can modify.

In SE18 for the BADI BADI_SD_TAB_CUST_H, click implementation overview to see the existing implementation WB2_SOGUI_LAYOUT_H, that SAP already did. You can see and learn from how the methods are implemented there.

0 Kudos

hi vishnu,

I got it now. thanks. I have one more doubt, will this BADI modify screen of existing empty Additional Data B tab of VA01/02 ?

I think this will add a new tab to VA01/02/03 header details, which is slightly deviating from my requirement of using/ modifying Additional Data B tab.

thanks.

0 Kudos

It will add a new sub screen with whatever title you give it.

If you want to modify the Additional Data B tab tab, you would need a access key.

BADIs are there to add subscreens without modifying existing screens. If you want to touch SAP standard screens, it would become a modification (and of course BADIs are precisely to avoid modifications in SAP name space)

BADIs don't change SAP objects at design time (coding modification), they will plugin additional screens / functionality at run time.

0 Kudos

Hi vishnu,

Thank you. Perfect explanation for a beginner like me. I'll try completing my task. I'll reply you, if in need of any help.

thanks.

0 Kudos

Hi Vishnu

I was just checking the BADI BADI_SD_TAB_CUST_H its marked for SAP internal use how can we use it?

Thanks

Nabheet

0 Kudos

Hi ,

Could you the send the complete code . I have tried with that code it is showing error.

My code :

data : lwa_CUS_ITEM_TAB type SALES_CUST_TAB_PAGE. "SALES_CUST_TAB_PAGE_T. "CT_CUS_ITEM_TAB.

lwa_CUS_ITEM_TAB-ITEM_CAPTION = 'Item Tab'.

lwa_CUS_ITEM_TAB-ITEM_PROGRAM = 'ZSD_SUBSCREEN_VA01'.

lwa_CUS_ITEM_TAB-ITEM_DYNPRO = '8000'.

INSERT lwa_CUS_ITEM_TAB INTO CT_CUS_ITEM_TAB INDEX SY-TABIX.

0 Kudos

hi vinod ,

I saw your code but i can't understand where it has to write. I created a custom class in se24 as vishnu said.

If you have solution please guide me.

0 Kudos

Hi madhu,

Please Explain me how to do through badi ?

0 Kudos

Hi Vinodh,

Could you please sahre your knowledge on how you created this Zimplementation.

Former Member
0 Kudos

Hi,

Add append structure with the custom fields in table VBAP, then in SE80 go the program SAPMV45A

screen no 8459 or 8309 and add the new fields, do the necessary validation in the flow logic of the screen. Also do check the note 302497.

Thanks,

Shailaja Ainala.

0 Kudos

Hi shailaja,

what you have said is right. Even my first thought was the same, but that process needs an access key. I don't want to use the access key. How can I do it using Badi's?

0 Kudos

Hi,

I am sure there are no BADIS for the same.

Thanks,

Shailaja Ainala.

0 Kudos

Hi shailaja,

I am sure there are no BADIS for the same

so does this mean that the only way to do it is to the get access key and modify respective screens. thanks.

Edited by: srivarma on Dec 8, 2011 6:03 PM

0 Kudos

The Additional data A and B tabs in VA01/02/03 are designed by SAP, for being modified by customer before the advent of BADI based plugin screens (of the type we use on Customer/Vendor master or many enjoy transactions)

The screens 8459 or 8309 are never touched by SAP during upgrades. I know, taking access key could mean that the objects we are changing should be registered for SCCR and special care need to be taken during upgrades to protect the changes as they fall in SAP naming spaces.

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

I guess, SAP didn't provide any BADIs for VA01/02/03 screen modification as many customers have already fulfilled that need for additional screen/custom fields by using the Additional data A and B tabs

0 Kudos

hi vishnu,

thanks for the detailed explanation. I understood your point. problem is that, I don't have an access key. I have found some BADI

BADI_SD_TAB_CUST_H for Tab Page for Own Details u2013 Header Detail .

Will it help me in any way?

0 Kudos

SriVarma,

Cool! I didn't know this BADI!

Playing around with existing implementations I can see that, BADI_SD_TAB_CUST_H, can definitely enhance the Sales order header with additional tab strip screens. Similarly BADI_SD_TAB_CUST_I can be used to enhance Sales order item screens.

Here is what I understand from the coding of an existing implementation

ACTIVATE_TAB_PAGE - takes a module pool program name and a subscreen that you created and adds it as a additional tab page to sales order header screen. You need to pass back f_program and f_dynpro with your program and screen number that you painted

TRANSFER_DATA_TO_SUBSCREEN - can be used to read and pass data to the fields on the subscreen you created

TRANSFER_DATA_FROM_SUBSCREEN - can be used to pass back whatever changes done by user to the respective Z variables in VBAK

PASS_FCODE_TO_SUBSCREEN - Pass the fcode the user selected to your subscreen.

I would suggest that you create a function group and create screens, functions etc within that and use those in these methods. Refer existing implementations. The global data of the function group can then be used to communicate between all the above methods

0 Kudos

Hi vishnu,

thanks again for elaborate explanation. No matter how many ways I tried, I couldn't access the code in those (ACTIVATE_TAB_PAGE , TRANSFER_DATA_TO_SUBSCREEN or TRANSFER_DATA_FROM_SUBSCREEN) methods, they are just in display mode. It needs an access key to swap it to change mode. How did you look into the code and modify these methods? I mean using which transaction se18, se19 , se24, se84??? It'll be extremely helpful to me if you exp me the procedure which you followed.

I would suggest that you create a function group and create screens, functions etc within that and use those in these methods.

yes, i did create a module pool and screens . once i know the modification of this badi's 4 methods, i'll use my prog and screens.

thanks.

Edited by: srivarma on Dec 14, 2011 7:56 PM

former_member240605
Participant
0 Kudos

HI SRIVARMA ,

I am very new in this field. I followed your post. I find out the badi also but I can't impliment this badi. It's saying that this badi is internal use only. In your post vishnu said to create a custom z class and i have done this but after that i can't understand what to do. So i can't proceed please suggest me how can i solve yhis problem.

Edited by: sandipan.sap on Feb 29, 2012 3:01 PM

former_member1716
Active Contributor
0 Kudos

Hi all,

I have given an idea about this in my post below,

http://scn.sap.com/community/abap/switching-enhancing-and-adapting-standard-programs/blog/2013/12/12...

Please have a look it will be very useful

0 Kudos

Hi Satish ,

i tried but didn't found badi "BADI_SLS_ITEM_SCR_CUS" in my system .

can you please suggest any alternate way . system 720 final release .

0 Kudos

Hi Satish ,

i tried but didn't found badi "BADI_SLS_ITEM_SCR_CUS" in my system .

can you please suggest any alternate way . system 701 final release .

0 Kudos


Hi Sanjay,

You need to have atleast 720 to achieve this requirement with the given BADI.

Thanks,

Satish